Buy Me a Coffee

[Dokku] Command Cheatsheet

A quick reference guide for commonly used Dokku commands.

1. Create and list app

# Create app
dokku apps:create <app_name>
# List app
dokku apps:list

2. Set domains

# Set app's domain
dokku domains:set <app_name> app.example.com
# Set global domain
dokku domains:set-global example.com

3. Join app to a specific network

# List all networks
dokku network:list
# Add an app to a specific network
dokku network:set <app_name> initial-network <target_network>

4. Show the app’s configuration

dokku config:show <app_name>

5. Manully restart an app

dokku ps:rebuild <app_name>

6. Bind app container to all interface

bind to all interfaces (0.0.0.0), so the container can be accessed by external request. However, the host port will be randomly assigned.

dokku network:set <app_name> bind-all-interfaces true

7. Set config

dokku config:set <app_name> DOKKU_PROXY_PORT="8080"

8. Check nginx config

dokku nginx:show-config <app_name>

9. Set port mapping

dokku proxy:ports-set <app_name> http:<host_port>:<container_port>
# Show port mapping  
dokku proxy:report <app_name>
# Rebuild proxy
dokku proxy:build-config <app_name>

10. Manually enable proxy

dokku proxy:enable <app_name>

11. Set app ipv4 address

dokku nginx:set app bind-address-ipv4 127.0.0.1
# Remove the ipv4 setting 
dokku nginx:set app bind-address-ipv4

Enjoyed this article? Support my work with a coffee ☕ on Ko-fi.
Buy Me a Coffee at ko-fi.com
DigitalOcean Referral Badge
Sign up to get $200, 60-day account credit !