Dokku Guide

Create and remove Dokku apps

A simple deployment checklist for creating a Dokku app, adding HTTPS, pushing code from your local machine, setting environment variables, cleaning unused Docker resources, and removing an app when needed.

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

Add HTTPS

In VPS

Enable Let’s Encrypt HTTPS for all 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
3

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>
Notes You can deploy directly to the Dokku production branch. Example:
Example
git push dokku prod
Git remotes Keep origin for GitHub and dokku for deployment. If you already have a Dokku remote, remove it first with:
Optional
git remote remove dokku
4

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 prod
5

Add environment variables

In VPS

Set environment variables for your Dokku app.

Command
dokku config:set <app_name> KEY=VALUE

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.

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