Log inSign up

Deploy apps with git push using Dokku

Dokku turns a server into a small Heroku style host that builds and runs your app whenever you git push to it. Download the bootstrap script for the current release tag and run it with sudo, add your public key with dokku ssh-keys:add, create an app, and push your repository to dokku@example.net:appname; plugins add databases and Let's Encrypt certificates.

Topic: Containers and PaaS · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

What makes Dokku different from other panels?

Dokku has no web dashboard; everything happens through a command line over SSH and through git push. That keeps it small and scriptable. Under the hood each app runs in Docker containers, nginx routes domains to them, and builds use Heroku style buildpacks, Cloud Native Buildpacks or your own Dockerfile. If you like working in a terminal and want each deploy tied to a commit, Dokku fits well. If you prefer clicking through a browser, look at Dokploy or CapRover instead.

Which server and system should you use?

Use a fresh Ubuntu 24.04, Ubuntu 22.04 or Debian 12 server with at least 1 GB of memory; buildpack builds are hungry, so 2 GB is a safer floor. Dokku installs its own Docker packages and nginx, so do not start from an image that already runs a web server. Log in with your sudo user as described in the first SSH session tutorial and set a proper hostname and DNS record first. If you want each app on its own subdomain, add a wildcard A record such as *.example.net pointing at 198.51.100.24 (see DNS records).

How do you install Dokku?

Ask the project for its newest release tag, then download and run the bootstrap script for that exact tag, so you always know which version went on the server:

DOKKU_TAG=$(curl -fsSL https://api.github.com/repos/dokku/dokku/releases/latest | grep -oP '"tag_name": "\K[^"]+')
echo "$DOKKU_TAG"    # for example v0.36.x; stop if this is empty
wget -NP . https://dokku.com/install/$DOKKU_TAG/bootstrap.sh
less bootstrap.sh
sudo DOKKU_TAG=$DOKKU_TAG bash bootstrap.sh

The script adds the Dokku apt repository, installs Docker if needed, nginx and the dokku package. Then confirm it:

dokku version
sudo systemctl is-active docker nginx

How do you add keys and set the global domain?

Pushes authenticate with SSH keys registered in Dokku, which are separate from your normal login keys. Add your own public key and set the base domain for apps:

cat ~/.ssh/authorized_keys | sudo dokku ssh-keys:add admin
sudo dokku ssh-keys:list
sudo dokku domains:set-global example.net

With the global domain set, an app named notes is served at notes.example.net by default. If your login uses a different key from your laptop, add that public key instead. Creating and protecting the key pair itself is covered in SSH keys and hardening.

How do you create and push your first app?

Create the app on the server, then add a Git remote on your computer and push. Dokku detects the language from the files in the repository:

# on the server
sudo dokku apps:create notes
sudo dokku config:set notes NODE_ENV=production SECRET_KEY=change-me

# on your computer
cd ~/code/notes
git remote add dokku dokku@example.net:notes
git push dokku main

The push prints the build output, runs the app and reports the URL. Later pushes repeat the same steps, and healthchecks declared in app.json let Dokku confirm the new release is answering before traffic moves to it. If your branch is not called main, push with git push dokku mybranch:main or set sudo dokku git:set notes deploy-branch mybranch. To build from a Dockerfile instead of buildpacks, keep a Dockerfile in the repository root and Dokku will use it.

How do you add a PostgreSQL database?

Install the official Postgres plugin, create a service and link it to the app. Linking sets a DATABASE_URL variable and restarts the app:

sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
sudo dokku postgres:create notesdb
sudo dokku postgres:link notesdb notes
sudo dokku config:show notes

Take a dump with sudo dokku postgres:export notesdb > notesdb.dump and restore with postgres:import. Similar plugins exist for MySQL, Redis and other services, all installed the same way.

How do you enable HTTPS with Let's Encrypt?

Install the letsencrypt plugin, set a contact email, enable it per app and add the renewal job:

sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
sudo dokku letsencrypt:set --global email admin@example.net
sudo dokku letsencrypt:enable notes
sudo dokku letsencrypt:cron-job --add

The app domain must resolve to the server and port 80 must be reachable. Open only the needed ports in ufw:

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable

How do you scale, read logs and upgrade?

Scale process types defined in your Procfile and watch logs live:

sudo dokku ps:scale notes web=2 worker=1
sudo dokku ps:report notes
sudo dokku logs notes -t

Dokku upgrades through apt like any package. Read the release notes for migration steps, then run sudo apt update && sudo apt install --only-upgrade dokku and rebuild apps with sudo dokku ps:rebuild --all if the notes ask for it. Plugins update with sudo dokku plugin:update postgres.

What goes wrong most often?

A push rejected with a permission error means the key on your computer is not registered with dokku ssh-keys:add. A build killed midway usually ran out of memory; add swap or use a bigger plan. If the app starts but the URL returns 502, the process is not listening on the port Dokku passes in the PORT variable. Certificate requests fail when DNS still points elsewhere, so check with dig +short notes.example.net.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-2one or two small buildpack apps1 vCPU, 2 GB RAM, 50 GB NVMe$7.20/mo$43.20 for 6 months
A2-4several apps with a Postgres database2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months

Questions about Dokku git push deploys

Does Dokku have a web interface?

No. It is managed from the command line. Community dashboards exist, but the core tool is SSH and git.

Can Dokku run Dockerfile projects?

Yes. If the repository has a Dockerfile, Dokku builds with it instead of buildpacks, and you can also deploy a prebuilt image with git:from-image.

Can several apps share one server?

Yes. Each app gets its own containers and domain, and nginx routes requests by host name.

Which port does git push use?

The normal SSH port 22, as the dokku user. Keep SSH open in the firewall.

How do I move Dokku to a bigger server?

Install Dokku on the new server, recreate apps and plugins, import database dumps and push again. The migration tutorial covers the server side.