Set up a brand new app on the VPS
Everything needed to take a new app from "doesn't exist yet" to
live with HTTPS and a working git push deploy.
1. DNS provider
Add a wildcard A record (one-time)
A wildcard record covers any subdomain you create now or later, so you never need to touch DNS again when adding a new app. Skip this if it's already in place. Propagation can take a few minutes up to a few hours depending on your provider's TTL.
dig +short <anything>.<your-domain> until
it returns the VPS IP before requesting a Let's Encrypt
certificate, otherwise the HTTP-01 challenge in step 2 will fail.
Add an apex/root A record (only for the no-subdomain app)
Only needed if one app should be reachable at the bare domain (no subdomain) — for example a main marketing site. Only one app can own the apex domain at a time. Skip this if every app will live on a subdomain.
2. Dokku: nginx & HTTPS
Create the app and assign the domain
These commands only touch the new app — existing apps and their domains are untouched. Use whichever fits this app.
Map the app's ports
Tell nginx which container port to forward public traffic to. Without this, Dokku won't know how to route incoming HTTP/HTTPS requests to your app's process.
80 (HTTP) and 443
(HTTPS) to internal container port 3000 — adjust the
last number to match the port your app actually listens on.
Enable HTTPS for this app only
Scope the Let's Encrypt commands to <app_name>
instead of looping over dokku apps:list — that loop
re-touches every app's nginx config and certificate, which is
unnecessary risk when you're only adding one app.
dokku letsencrypt:cron-job --add only needs to be run
once per server. Check first with
dokku letsencrypt:cron-job — if it's already
installed, skip re-adding it.
for app in $(dokku apps:list); do dokku letsencrypt:enable $app; done
here. It's only appropriate for renewing every existing
certificate at once, not for onboarding a single new app.
3. Git push setup
Add the Dokku git remote
Point the local repo at the app on the VPS.
dokku remote already exists locally, remove it
first with git remote remove dokku.
Set the deploy branch
Make sure Dokku deploys from master.
Set the build subfolder (optional)
Only needed if the app to deploy isn't at the root of the
repository — for example a monorepo where the deployable app
lives under apps/web. Skip this if the build is at
the project root.
Push to deploy
4. Extra steps
Env vars, storage, and cleanup
Set config, mount persistent storage if the app needs it, then clean up build leftovers.
DATABASE_URL=/app/storage/db.sqlite as an env var
so the app points to the mounted volume, if it uses SQLite.