Dokku, the Platform-as-a-Service Framework
Dokku is an open source project that adds a layer of ops-friendly tools to virtualized environments. Development teams that want to stay productive and not have to spend significant time on configuring Web servers, SSL certificates, deployment pipelines and more, find Dokku to be a great fit for their DevOps needs.
Dokku supports several deployment modes, each having its own strengths. The default mode uses open source "buildpacks" (maintained by Heroku) to assemble an application using its existing manifest (package.json, composer.json, Gemfile, etc.) and typically provides the least path of resistance. Alternately, organizations comfortable working directly with Docker containers can use Dockerfiles to build their applications, in order to maintain consistency across dev/test/prod environments. Dokku also supports deployments that reference pre-built artifacts in external Docker registries as well as deploying branches from external, private git repositories.
Deployments can be triggered by using git from a local development machine, a dedicated build server, or a continuous deployment service like GitHub Actions or Bitbucket Pipelines.
Dokku's design is based on modern Web app deployment methodologies. Dokku manages applications within containers (powered by the Docker engine), providing the following benefits:
- Application dependencies are encapsulated in the container. Avoids the need to manage packages in the host machine's operating system and supports side-by-side deployment of different stacks.
- Zero downtime deployments. As a new build is being deployed, the previous one continues to function as your active application. Dokku also provides status checks that prevent a bad build from going live.
- Process types operate in separate containers and can be scaled independently, for example, background job workers.
- Server resources such as CPU and memory can be limited or reserved for a given app/process type combination.
Running Dokku Commands
The simplest way to interact with Dokku is to establish an SSH connection to a virtual machine pre-installed with Dokku and execute commands in the shell environment. However, customers can also interact with Dokku-enabled environments from local development machines by installing the Dokku Client, which proxies commands to the virtual machine over SSH.
To view a list of supported commands:
To view available sub-commands for a command:
Stack Specific Guides
The following guides walk you through the configuration and deployment of a Dokku application for specific programming languages/frameworks. If you need assistance with other stacks, take a look at the "Reference Applications" below or create a support ticket.
Please refer to these external repositories to see example configurations for various stacks. These samples are maintained by Heroku and are compatible with Dokku.
- Connecting to your Database
- Git deployments
- Persistent file storage
- Resource limits
- Restarting services and running one-off tasks
- Scheduling automated jobs
- Sensitive credentials and secrets
- Enhanced Security Architecture (ESA)
Frequently Asked Questions
Can I deploy more than one application to my server?
Yes. Dokku applications have unique names and use virtual host routing through an Nginx reverse proxy. You'll need to assign a unique subdomain to each application and might need to set resource limits.
Can more than one person on my team deploy an application?
Yes. Please create a support ticket, providing the name, email, and public SSH key of the additional team member.
My uploaded files are lost after each deployment. How do I preserve them?
Application containers have an "ephemeral" filesystem. Any dynamic content generated within a container will go away with the next deployment. Dokku allows you to define a permanent storage mount that lives in the virtual machine's filesystem and is accessible by the container. This way, if the container is replaced by a newer version, your application can still access previously generated files. See File Storage for details.
How do I enable a high availability configuration using Dokku?
You will need a cluster consisting of two virtual machines and a load balancer. You will then configure and deploy your application independently to each virtual machine. A git client can be configured to deploy to two endpoints, see this topic for details. Alternately, you can use a dedicated build server or external CI/CD service to deploy your application to a cluster of virtual machines. Please create a support ticket to discuss these options.
The external Dokku documentation site can be helpful if you're looking to go deeper into topics discussed in our knowledge base.