For a smooth Dokku experience, choose a VPS with the right configuration. For most side projects, a VPS with 1 vCPU, 2 GB RAM, and 25–40 GB SSD is a good starting point. This setup provides enough resources for Dokku itself, one database or managed add-on later, and a small web app with room for logs and build cache. A basic Node or Python app often uses between 150–400 MB RAM per process, while small Ruby apps might require around 300–600 MB once warmed up. Remember that Dokku, Docker containers, and the OS also use memory, so treat app memory as only a part of the total requirement.
| App type | Typical process RAM | Expected app containers | Recommended starting VPS |
|---|---|---|---|
| Small Node.js API or Next.js app | 150–350 MB | 1 | 1 vCPU / 2 GB RAM / 25 GB SSD |
| Python Flask or FastAPI app | 150–300 MB | 1 | 1 vCPU / 2 GB RAM / 25 GB SSD |
| Python Django app | 250–500 MB | 1–2 | 2 vCPU / 4 GB RAM / 50 GB SSD |
| Ruby on Rails app | 300–600 MB | 1 | 2 vCPU / 4 GB RAM / 50 GB SSD |
| Any app with 2 web containers | 300–900 MB total | 2 | 2 vCPU / 4 GB RAM / 50 GB SSD |
The takeaway: 2 GB works for one small app, but 4 GB is the safer floor when running multiple containers, heavier frameworks, or background jobs.
Location is as important as size. Users notice improvements in responsiveness when latency drops. Choose the VPS region closest to your primary users. For instance, if your audience is on the US East Coast, opt for a nearby location instead of a distant one. A nearby region can keep network latency under 50 ms, whereas cross-ocean routes may reach 80–150 ms before your app starts processing. For more details on hosting options, read our article on VPS vs cloud hosting.
Provisioning a VPS is straightforward in most cloud panels:
- Create a new VPS instance.
- Choose a region nearest your users.
- Select Ubuntu 22.04 LTS.
- Pick the size from the table above.
- If supported, add your SSH key during setup.
- Name the server something descriptive, for example, `dokku-prod-1`.
- Create the instance and note the public IPv4 address.
For an optimal experience, consider using VPSus VPS hosting. VPSus offers plans that align with the recommended configurations above, ensuring excellent performance and reliability for your Dokku deployment.
Selecting Your OS Image

Use Ubuntu 22.04 LTS unless you have a compelling reason otherwise. This release provides a stable package base, long-term security updates, and broad compatibility with Dokku’s setup path.
To confirm the OS after the VPS boots, connect via the provider console and run:
cat /etc/os-release
You should see output similar to:
PRETTY_NAME="Ubuntu 22.04.4 LTS" NAME="Ubuntu" VERSION_
This confirms that you’re on a supported Ubuntu release and ready to proceed with SSH hardening.
Step 2: Secure SSH Access and Basic Hardening
Before installing Dokku, secure your VPS by enabling key-only SSH access, setting a non-default SSH port, and configuring a firewall to expose only necessary ports. This process takes about 3–5 minutes and prevents common security oversights.
If your VPS panel supports SSH key uploads, use it rather than adding keys manually later. Look for options like SSH Keys, Security, or Access, and paste the contents of your public key (usually obtained with the command below):
cat ~/.ssh/id_ed25519.pub
The output should be a single line beginning with `ssh-ed25519`, followed by a long key string and your email or hostname comment. Attach this key to your server, then test the login:
ssh root@your_server_ip
You should log in without being prompted for a password.
Once key login is confirmed, harden SSH by modifying the configuration. This not only reduces automated attacks on port 22 but also minimizes brute-force vulnerabilities. Open the SSH configuration file for editing:
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak sudo nano /etc/ssh/sshd_config
In the file, set or change the following lines:
Port 2222 PasswordAuthentication no PermitRootLogin prohibit-password PubkeyAuthentication yes
After saving the changes, restart SSH:
sudo systemctl restart ssh
Before ending your current session, verify the changes by opening a new terminal and connecting with the new port:
ssh -p 2222 root@your_server_ip
You should log in using your key without a password prompt.
Configuring UFW Firewall
Configure UFW (Uncomplicated Firewall) to limit inbound traffic to essential services only (SSH, HTTP, and HTTPS). Run the following commands:
sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow 2222/tcp sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw enable sudo ufw status numbered
The output should list rules for ports 2222, 80, and 443, with all other incoming traffic blocked.
| Hardening Task | Purpose | Done |
|---|---|---|
| Upload SSH public key in panel | Prevents password-based initial login | ☐ |
| Confirm key-based SSH login | Avoids lockout during hardening | ☐ |
| Change SSH port from 22 to 2222 | Reduces exposure to automated scans | ☐ |
| Disable password authentication | Blocks brute-force password attacks | ☐ |
| Configure UFW to allow only 2222/80/443 | Limits incoming connections to essentials | ☐ |
With these steps complete, your VPS is secure and ready for Dokku installation.
Step 3: Install Dokku with the Bootstrap Script

Dokku’s bootstrap script transforms a plain Ubuntu server into a functional, mini Heroku-like platform in a single command. On Ubuntu 22.04, download and run the official script with your hostname and SSH key settings provided via environment variables. This pre-seeds Dokku’s setup prompts and speeds up installation.
wget -NP . https://dokku.com/install/v0.35.19/bootstrap.sh sudo DOKKU_TAG=v0.35.19 \ bash bootstrap.sh
For more on container management, check out our Docker VPS hosting guide.
Verify Dokku installation with:
dokku version
Expected output:
dokku version 0.35.19
The bootstrap script installs Docker, nginx, and Dokku, and it might launch a web-based setup step if configuration variables are not preseeded. For a quicker installation, use environment variables:
export DOKKU_HOSTNAME=apps.example.com export DOKKU_KEY_FILE=/root/.ssh/authorized_keys export DOKKU_SKIP_KEY_FILE=0 wget -NP . https://dokku.com/install/v0.35.19/bootstrap.sh sudo -E DOKKU_TAG=v0.35.19 bash bootstrap.sh
Then, verify the setup:
echo "$DOKKU_HOSTNAME" && test -f "$DOKKU_KEY_FILE" && echo "key file found"
Expected output:
apps.example.com key file found
Step 4: Configure Your Domain and Enable SSL
Proper DNS configuration is vital for Dokku. The goal is to point your domain at your VPS, reserve a wildcard for future apps, and secure all connections with TLS certificates.
For example, if your Dokku hostname is `apps.example.com`, configure these DNS records:
| Type | Name | Value | Purpose |
|---|---|---|---|
| A | `apps` | `your_vps_ipv4` | Routes the main Dokku host to your server |
| A | `` or `.apps` | `your_vps_ipv4` | Allows new apps to resolve automatically |
| A | `@` | `your_vps_ipv4` | (Optional) Points the root domain to your server |
The wildcard record ensures you don’t have to update DNS for every new Dokku app.
Before initiating SSL, confirm that DNS resolves correctly:
dig +short apps.example.com dig +short test.apps.example.com
Both commands should return your VPS public IP. Once confirmed, install Dokku’s Let’s Encrypt plugin:
sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git dokku letsencrypt:set --global email you@example.com dokku letsencrypt:enable myapp
Verify SSL setup with:
dokku letsencrypt:list
Expected output should show the app (e.g., `myapp`) with Let’s Encrypt enabled.
Testing Your HTTPS Endpoint
After SSL is issued, verify both TLS and app routing:
curl -I https://myapp.apps.example.com
Expected output should include a status code of 200 and indicate nginx is handling requests, for example:
HTTP/2 200 server: nginx
You can inspect the certificate with:
echo | openssl s_client -connect myapp.apps.example.com:443 -servername myapp.apps.example.com 2>/dev/null | openssl x509 -noout -issuer -subject -dates
This should display certificate details with a valid issuer, your domain as the subject, and an expiry date in the future.
Step 5: Deploy Your First App via Git Push

The deployment phase is where everything comes together. Create a Dokku app, set up your Git repository remote, and deploy with a single push.
First, create the app on the server to initialize configuration and routing:
dokku apps:create myapp dokku apps:list dokku domains:report myapp
The output from `dokku apps:list` should include `myapp`, and the domains report should detail its assigned domain (e.g., `myapp.apps.example.com`).
Next, add Dokku as a remote in your local Git repository:
git remote add dokku dokku@your-server-hostname:myapp git remote -v
You should see output similar to:
dokku dokku@your-server-hostname:myapp (fetch) dokku dokku@your-server-hostname:myapp (push)
Deploy your app by pushing the desired branch:
git push dokku main
A successful deployment log typically includes messages such as receiving source, detecting buildpack, building image, and deploying web process. An example log:
-----> Cleaning up...
-----> Building myapp from herokuish
-----> Adding BUILD_ENV to build environment...
-----> Node.js app detected
-----> Installing dependencies
-----> Building runtime image
-----> Releasing myapp...
-----> Checking for predeploy task
-----> Checking for release task
=====> Application deployed:
http://myapp.apps.example.comConfirm functionality with:
curl -I https://myapp.apps.example.com
A status code of 200 or the appropriate redirect indicates success.
Common Buildpack Issues
Missing Startup Command
If you encounter errors about a startup command, your app may need a `Procfile` to define the process to run. For example:
procfile
web: npm start
Add and commit the `Procfile` then deploy again:
git add Procfile git commit -m "Add Procfile" git push dokku main
The deployment log should show a successful release without process-type errors.
No Supported Buildpack Detected
If Dokku reports that no supported buildpack was detected, verify that your repository contains the required files:
• For Node.js: a `package.json`
• For Python: a `requirements.txt` or `pyproject.toml`
• For PHP: a `composer.json`
Ensuring these files are present will help Dokku detect and use the correct buildpack, leading to a successful build.
Step 6: Manage and Scale Your Application
Post-deployment, monitor your app to ensure it operates smoothly. Check logs to spot any runtime issues:
dokku logs myapp --tail
This command should display a live feed of log messages, including startup notifications and any errors. If you encounter repeated restarts or memory issues, address these before further scaling.
Set environment variables to avoid hardcoding sensitive data:
dokku config:set myapp NODE_ENV=production API_BASE_URL=https://api.example.com
Verify the configuration with:
dokku config myapp
You should see the variables, such as `NODE_ENV: production` and `API_BASE_URL: https://api.example.com`.
If your app requires a specific startup command, define it in your `Procfile`. For example:
procfile
web: gunicorn app:app –bind 0.0.0.0:$PORT –workers 2
After modifying the `Procfile`, commit and push the changes, then check the process report:
git add Procfile && git commit -m "Set web process" && git push dokku main dokku ps:report myapp
Scale your web process when necessary:
dokku ps:scale myapp web=2
Verify scaling with:
dokku ps:report myapp
The report should show two running web containers. Keep in mind that a small Node or Python container may use 150–400 MB RAM, so ensure your VPS has sufficient resources. On a 1 vCore system, running two busy containers might lead to latency spikes. Scale only after confirming that both CPU and RAM can accommodate the additional load.
Rolling Back a Bad Deploy
If a new release introduces issues, try rebuilding the app first to resolve environment or dependency problems:
dokku ps:rebuild myapp
After rebuilding, inspect the logs:
dokku logs myapp --tail
If the issue persists, rollback by deploying a previous commit. For example:
git log --oneline -n 5 git checkout <good-commit> git push dokku HEAD:main
Finally, verify the rollback:
curl -I https://myapp.apps.example.com
A `200` status or proper redirect confirms a successful rollback.
Post-Deploy Checklist
| Task | Command | Done |
|---|---|---|
| Check live logs during initial load | `dokku logs myapp –tail` | ☐ |
| Set required environment variables | `dokku config:set myapp KEY=value` | ☐ |
| Confirm process status | `dokku ps:report myapp` | ☐ |
| Scale with sufficient resources | `dokku ps:scale myapp web=2` | ☐ |
Logs reveal issues, and environment variables ensure your app is portable. Scale only when your server resources permit.
Step 7: Clean Up, Backups, and Next Steps
After a successful deploy, remove any unnecessary components and set up backups. For example, if you created a test app during setup, remove it to free up resources:
dokku apps:destroy test-app --force dokku apps:list
Ensure that `test-app` no longer appears. If disk usage becomes a concern, inspect Docker’s footprint:
docker system df
This command displays space used by images, containers, and the build cache. If deploys consume several gigabytes, consider periodic cleanups.
Set Up Database Backups
Backup is crucial when dealing with user data. Dokku offers database plugins to facilitate backups. For example, to set up PostgreSQL:
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres dokku postgres:create myapp-db dokku postgres:link myapp-db myapp
Check the database information with:
dokku postgres:info myapp-db dokku config myapp | grep DATABASE_URL
You should see relevant database details and an active `DATABASE_URL` configuration. Configure the backup process using the plugin’s commands, ensuring that backups are stored off-VPS.
Plugin Catalog and Next Steps
Dokku’s rich plugin ecosystem enables your VPS to offer more than just web hosting. Explore additional plugins for PostgreSQL, MySQL, or Redis. To compare web servers or explore other deployment options, read our article on Apache vs NGINX.
Cleanup and Next-Steps Checklist
| Task | Command or Link | Done |
|---|---|---|
| Delete throwaway app | `dokku apps:destroy test-app –force` | ☐ |
| Verify active apps remain | `dokku apps:list` | ☐ |
| Check Docker disk usage | `docker system df` | ☐ |
| Install required database plugin | `dokku plugin:install …` | ☐ |
| Confirm app database credentials | `dokku config | ☐ |
| Explore additional plugins | Dokku plugin catalog | ☐ |
Clean up unused components, back up critical data, and add new components only as necessary. Your next step is to choose a VPS location that best meets your network latency requirements—VPSus, for instance, offers competitive VPS plans in regions that optimize performance for your target audience.
Your journey to a reliable and secure Dokku deployment begins here.
Frequently Asked Questions
What is Dokku and why use it?
How do I choose the right VPS size for Dokku?
How can I secure my Dokku VPS installation?
What common issues should I watch for during deployment?
Why is DNS configuration important for Dokku?