Command Guide

Create and remove Dokku apps

A full step-by-step checklist for creating a Dokku app, assigning a subdomain, adding HTTPS, pushing code, setting environment variables, and safely removing an app.

Create app

1

Create Dokku app

In VPS

Create the Dokku app first, then assign a subdomain to it.

Create app
dokku apps:create <app_name>
Assign subdomain
dokku domains:set <app_name> <subdomain>.fastfastapps.com
2

Configure ports

In VPS

Map the public-facing HTTP/HTTPS ports to the port your app's process listens on internally, so Dokku's nginx proxy knows where to send traffic.

Set ports
dokku ports:set <app_name> http:80:3000 https:443:3000
http:80:3000 https:443:3000 Forwards public port 80 (HTTP) and 443 (HTTPS) to internal container port 3000. Replace 3000 with whatever port your app actually binds to.
3

Add HTTPS

In VPS

Enable Let's Encrypt HTTPS for Dokku apps, add the renewal cron job, and clean unused resources.

Shell
EMAIL=<email_address>
for app in $(dokku apps:list); do
  dokku letsencrypt:set $app email ${EMAIL}
  dokku letsencrypt:enable $app
done
dokku letsencrypt:cron-job --add
dokku cleanup
docker system prune -af
4

Add Dokku remote to Git repository

In local machine

Add the Dokku server as a Git remote for your local Git repository.

Command
git remote add dokku dokku@fastfastapps.com:<app_name>
Branch note You can use any branch name when pushing to Dokku.
Push format
git push dokku <branch_name>
Existing remote You may already have a Dokku remote. Remove it first if needed.
Optional
git remote remove dokku
5

Push code

In local machine

Push your branch to Dokku. Dokku will build the app and deploy it to the VPS.

Command
git push dokku <branch_name>
6

Add environment variables

In VPS

Set environment variables for your Dokku app.

Set config
dokku config:set <app_name> KEY=VALUE

To see all currently set env vars for an app:

Show config
dokku config:show <app_name>

To clean all config and trigger a rebuild, clear the app config.

Clear config
dokku config:clear <app_name>

Operations

▶

View logs

In VPS

Stream or tail the logs for a running Dokku app.

Tail logs
dokku logs <app_name>
Follow (live)
dokku logs <app_name> -t
Last N lines
dokku logs <app_name> -n 100
▶

Run command on a container

In VPS

Execute a one-off command inside an app container — useful for migrations, console access, or debugging.

Run command
dokku run <app_name> <command>
Open a shell
dokku run <app_name> bash
One-off container dokku run spawns a temporary container. It shares the same image and environment variables as the deployed app but does not affect running processes.
▶

Volume configuration

In VPS

Create a persistent storage directory, set the correct ownership, and mount it into the app container.

Shell
dokku storage:create ticketsplit
chown -R 32767:32767 /var/lib/dokku/data/storage/ticketsplit
dokku storage:mount ticketsplit /var/lib/dokku/data/storage/ticketsplit:/app/storage
User ID 32767 32767 is the default Heroku user ID used inside Dokku containers.
Set DATABASE_URL=/app/storage/db.sqlite as an env var so your app points to the mounted volume.
▶

Monorepos and subfolder

In VPS

Configure the build working subdirectory Dokku uses to build for each app.

Set Docker build working directory
dokku builder:set app_name build-dir <subfolder>

Remove app

1

List all apps

In VPS

Check the available Dokku apps before deleting one.

Command
dokku apps:list
2

Destroy app

In VPS

Remove the selected Dokku app from the VPS, then clean unused resources.

Command
dokku apps:destroy <app_name>
dokku cleanup
docker system prune -af
Warning Destroying an app removes the Dokku app configuration. Linked databases or services may need to be removed separately.

Notes

!

Important deployment notes

PORT variable Dokku already provides the $PORT environment variable. Don't add it manually.
Dockerfiles Don't use EXPORT in Dockerfiles.