Skip to content

☁️ Deploying to Remote Environments

SuperStack is Docker-native, so deployment is simple and portable. Here's how to deploy it to a remote server.

A clear goal of SuperStack is that only compose.yaml should be required on the remote server. No other file should need to be copied there.

βœ… 1. Prepare your Images

For services that are built, add image: URIs to your own container repository (e.g. your Docker Hub or GitHub Container Registry account), for example:

compose.yaml
caddy:
  image: ghcr.io/youruser/yourapp-caddy

postgres:
  image: ghcr.io/youruser/yourapp-postgres

πŸ› οΈ 2. Build and Push your Images

Build your images locally and push to your registry:

docker compose build
docker compose push

πŸ“¦ 3. Deploy the Compose File

Only compose.yaml is required on the remote server.

Copy it to your server:

scp compose.yaml youruser@yourserver:

πŸš€ 4. Launch your Stack

SSH into your server and bring up the stack.

For production, avoid using .env files. Instead, set secrets directly:

.env
JWT_SECRET=your-secret \
CADDY_PORT=80 \
PG_USER=admin \
PG_PASS=supersecret \
POSTGREST_AUTHENTICATOR_PASS=supersecret \
docker compose up -d

πŸ’‘ Avoid leaking secrets by disabling shell history.

Alternatively, use environment injection in your CI/CD.


That’s it β€” your backend is live.

If this is the first time bringing up your stack, the migrations will run automatically. Subsequently, to upgrade your app you should:

docker compose pull
docker compose up -d
docker compose exec postgres migrate