Deployment guide

Deploy your applications with Dokku on a VPS

Deploy on a VPS Cloud →

Deployment7 min read

Deploy your applications with Dokku on a VPS

Dokku bills itself as “the smallest PaaS in the world.” Built around Docker and Heroku buildpacks, it offers a `git push` deployment experience on a modest VPS, without a heavy interface. Here's how to install it and get your first application online.

Why choose Dokku for your VPS

Where other PaaS solutions bundle a web interface and a full orchestrator, Dokku stays deliberately minimalist: it is a set of shell scripts that drive Docker. You push your code with git push dokku main, Dokku detects the language via Heroku buildpacks or a Dockerfile, builds the image and brings the application online. Everything is managed from the command line, which makes it extremely lightweight and predictable. It's the ideal choice for developers who want a Heroku-like workflow on a small VPS, without paying for an extra layer and without spending RAM on a dashboard. Its plugin ecosystem (PostgreSQL, Redis, Let's Encrypt) covers the essential needs.

The concrete strengths of Dokku

  • Minimal memory footprint: runs comfortably on a VPS with 1 GB of RAM.
  • Deployment via git push, just like Heroku, with automatic language detection.
  • Native support for Heroku buildpacks and Dockerfiles, your choice depending on your project.
  • Official plugins for PostgreSQL, MySQL, Redis and MongoDB, managed from the CLI.
  • Let's Encrypt plugin for automatic HTTPS and its renewal.
  • Zero-downtime deploys thanks to health checks before switching the container.

Prerequisites for Dokku

Dokku is the most resource-efficient PaaS in this series. A VPS with 1 GB of RAM and 1 vCPU is enough for lightweight applications, but plan for 2 GB of RAM as soon as your builds use buildpacks (Node, Ruby, Python compile in memory) or you host a database alongside. Count on 25 GB of SSD disk. The recommended system is a freshly installed Ubuntu LTS, with no pre-installed Docker (the Dokku script installs it itself). On the DNS side: configure either one domain per application or a wildcard domain *.mydomain.com for subdomain-based deployment. Ports 22 (SSH, essential for git push), 80 and 443 must be open. Add your public SSH key to authorize deployments.

Install Dokku and deploy an application

01

Install Dokku via the official script

On a clean Ubuntu: wget -NP . https://dokku.com/install/v0.34.0/bootstrap.sh then sudo DOKKU_TAG=v0.34.0 bash bootstrap.sh. The script installs Docker, Nginx and Dokku in a few minutes.

02

Finalize the configuration and add your SSH key

Finish the installation by visiting the VPS IP in a browser or via the CLI. Add your public key with dokku ssh-keys:add admin < ~/.ssh/id_rsa.pub and set the global domain: dokku domains:set-global mydomain.com.

03

Create an application and its Git remote

On the server: dokku apps:create mon-app. On your machine, add the remote: git remote add dokku [email protected]:mon-app. Dokku will automatically create the subdomain mon-app.mydomain.com.

04

Provision a database

Install the plugin: dokku plugin:install https://github.com/dokku/dokku-postgres.git. Create a database with dokku postgres:create ma-base then link it to the app: dokku postgres:link ma-base mon-app. The DATABASE_URL variable is injected automatically.

05

Deploy and enable HTTPS

Push your code with git push dokku main: Dokku builds and deploys. Then install the Let's Encrypt plugin and run dokku letsencrypt:enable mon-app to obtain an automatic SSL certificate and configure its renewal.

Enable automatic certificate renewal with dokku letsencrypt:cron-job --add, otherwise your certificates will expire after 90 days. For downtime-free deployments, configure a CHECKS file at the root of your project: Dokku verifies that the new version responds before switching traffic, guaranteeing a zero-downtime deploy. On a low-RAM VPS, add 2 GB of swap to prevent buildpack builds from being killed by the system (OOM killer).

Put Dokku into production on your VPS

A ServOrbit Cloud VPS running Ubuntu LTS, lightweight and affordable, is the ideal ground for Dokku and its git push deployment workflow.

Need help?

Browse our help center and FAQ, or write to our team — support in French, English and Arabic.