Subcommands new as of 0.15.0
buildpacks:add [--index 1] <app> <buildpack> # Add new app buildpack while inserting into list of buildpacks if necessary buildpacks:clear <app> # Clear all buildpacks set on the app buildpacks:list <app> # List all buildpacks for an app buildpacks:remove <app> <buildpack> # Remove a buildpack set on the app buildpacks:report [<app>] [<flag>] # Displays a buildpack report for one or more apps buildpacks:set [--index 1] <app> <buildpack> # Set new app buildpack at a given position defaulting to the first buildpack if no index is specified
Warning: If using the
buildpacksplugin, be sure to unset any
BUILDPACK_URLand remove any such entries from a committed
.envfile. A specified
BUILDPACK_URLwill always override a
.buildpacksfile or the buildpacks plugin.
Dokku normally defaults to using Heroku buildpacks for deployment, though this may be overridden by committing a valid
Dockerfile to the root of your repository and pushing the repository to your Dokku installation. To avoid this automatic
Dockerfile deployment detection, you may do one of the following:
dokku config:setor via a committed
.envfile in the root of the repository. See the environment variable documentation for more details.
.buildpacksfile in the root of your repository.
.buildpacksfile or managed via the
This page will cover usage of the
buildpacks:list command can be used to show buildpacks that have been set for an app. This will omit any auto-detected buildpacks.
# running for an app with no buildpacks specified dokku buildpacks:list node-js-app
-----> test buildpack urls
# running for an app with two buildpacks specified dokku buildpacks:list node-js-app
-----> test buildpack urls https://github.com/heroku/heroku-buildpack-python.git https://github.com/heroku/heroku-buildpack-nodejs.git
Please check the documentation for your particular buildpack as you may need to include configuration files (such as a Procfile) in your project root.
To add a custom buildpack, use the
dokku buildpacks:add node-js-app https://github.com/heroku/heroku-buildpack-nodejs.git
When no buildpacks are currently specified, the specified buildpack will be the only one executed for detection and compilation.
Multiple buildpacks may be specified by using the
buildpacks:add command multiple times.
dokku buildpacks:add node-js-app https://github.com/heroku/heroku-buildpack-ruby.git dokku buildpacks:add node-js-app https://github.com/heroku/heroku-buildpack-nodejs.git
Buildpacks are executed in order, may be inserted at a specified index via the
--index flag. This flag is specified starting at a 1-index value.
# will add the golang buildpack at the second position, bumping all proceeding ones by 1 position dokku buildpacks:add --index 2 node-js-app https://github.com/heroku/heroku-buildpack-golang.git
In some cases, it may be necessary to swap out a given buildpack. Rather than needing to re-specify each buildpack, the
buildpacks:set command can be used to overwrite a buildpack at a given position.
dokku buildpacks:set node-js-app https://github.com/heroku/heroku-buildpack-ruby.git
By default, this will overwrite the first buildpack specified. To specify an index, the
--index flag may be used. This flag is specified starting at a 1-index value, and defaults to
# the following are equivalent commands dokku buildpacks:set node-js-app https://github.com/heroku/heroku-buildpack-ruby.git dokku buildpacks:set --index 1 node-js-app https://github.com/heroku/heroku-buildpack-ruby.git
If the index specified is larger than the number of buildpacks currently configured, the buildpack will be appended to the end of the list.
dokku buildpacks:set --index 99 node-js-app https://github.com/heroku/heroku-buildpack-ruby.git
At least one of a buildpack or index must be specified
A single buildpack can be removed by name via the
dokku buildpacks:remove node-js-app https://github.com/heroku/heroku-buildpack-ruby.git
Buildpacks can also be removed by index via the
--index flag. This flag is specified starting at a 1-index value.
dokku buildpacks:remove node-js-app --index 1
This does not affect automatically detected buildpacks, nor does it impact any specified
buildpacks:clear command can be used to clear all configured buildpacks for a specified app.
dokku buildpacks:clear node-js-app
You can get a report about the app's buildpacks status using the
=====> node-js-app buildpacks information Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git =====> python-sample buildpacks information Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git,https://github.com/heroku/heroku-buildpack-python.git =====> ruby-sample buildpacks information Buildpacks list:
You can run the command for a specific app also.
dokku buildpacks:report node-js-app
=====> node-js-app buildpacks information Buildpacks list: https://github.com/heroku/heroku-buildpack-nodejs.git
You can pass flags which will output only the value of the specific information you want. For example:
dokku buildpacks:report node-js-app --buildpacks-list
If an application was previously deployed via Dockerfile, the following commands should be run before a buildpack deploy will succeed:
dokku config:unset --no-restart node-js-app DOKKU_DOCKERFILE_CMD DOKKU_DOCKERFILE_ENTRYPOINT DOKKU_PROXY_PORT_MAP
Always remember to pin your buildpack versions when using the multi-buildpacks method, or you may find deploys changing your deployed environment.
By default, Dokku uses the gliderlabs/herokuish project, which pins all of it's vendored buildpacks. There may be occasions where the pinned version results in a broken deploy, or does not have a particular feature that is required to build your project. To use a more recent version of a given buildpack, the buildpack may be specified without a Git commit SHA like so:
# using the latest nodejs buildpack dokku buildpacks:set node-js-app https://github.com/heroku/heroku-buildpack-nodejs
This will use the latest commit on the
master branch of the specified buildpack. To pin to a newer version of a buildpack, a sha may also be specified by using the form
COMMIT_SHA is any tree-ish git object - usually a git tag.
# using v87 of the nodejs buildpack dokku buildpacks:set node-js-app https://github.com/heroku/heroku-buildpack-nodejs#v87
While many buildpacks have a default command that is run when a detected repository is pushed, it is possible to override this command via a Procfile. A Procfile can also be used to specify multiple commands, each of which is subject to process scaling. See the process scaling documentation for more details around scaling individual processes.
A Procfile is a file named
Procfile. It should be named
Procfile exactly, and not anything else. For example,
Procfile.txt is not valid. The file should be a simple text file.
The file must be placed in the root directory of your application. It will not function if placed in a subdirectory.
If the file exists, it should not be empty, as doing so may result in a failed deploy.
The syntax for declaring a
Procfile is as follows. Note that the format is one process type per line, with no duplicate process types.
<process type>: <command>
If, for example, you have multiple queue workers and wish to scale them separately, the following would be a valid way to work around the requirement of not duplicating process types:
worker: env QUEUE=* bundle exec rake resque:work importantworker: env QUEUE=important bundle exec rake resque:work
web process type holds some significance in that it is the only process type that is automatically scaled to
1 on the initial application deploy. See the process scaling documentation for more details around scaling individual processes.
Certain buildpacks may time out in retrieving dependencies via
curl. This can happen when your network connection is poor or if there is significant network congestion. You may see a message similar to
gzip: stdin: unexpected end of file after a
If you see output similar this when deploying , you may need to override the
curl timeouts to increase the length of time allotted to those tasks. You can do so via the
dokku config:set --global CURL_TIMEOUT=1200 dokku config:set --global CURL_CONNECT_TIMEOUT=180
See the repository management documentation for more information on how to clear buildpack build cache for an application.