Installing with the `dokku/nginx_enable` debconf option set to `false` left the nginx-vhosts plugin disabled with no way to turn it back on, as `dokku plugin:enable nginx-vhosts` reported that the plugin does not exist. The plugin can now be enabled after installation, and the debconf documentation explains the option's effect and how to reverse it.
3.0 KiB
Debian Package Installation Notes
As of 0.3.18, Dokku defaults to being installed via Debian package. While certain hosts may require extra work to get running, you may optionally wish to automate the installation of Dokku without the use of our bootstrap.sh Bash script. The following are the steps run by said script:
# install docker
wget -nv -O - https://get.docker.com/ | sh
# install dokku
wget -qO- https://packagecloud.io/dokku/dokku/gpgkey | sudo tee /etc/apt/trusted.gpg.d/dokku.asc
# programmatically determine distro and codename
DISTRO="$(awk -F= '$1=="ID" { print tolower($2) ;}' /etc/os-release)"
OS_ID="$(awk -F= '$1=="VERSION_CODENAME" { print tolower($2) ;}' /etc/os-release)"
echo "deb https://packagecloud.io/dokku/dokku/${DISTRO}/ ${OS_ID} main" | sudo tee /etc/apt/sources.list.d/dokku.list
sudo apt-get update -qq >/dev/null
sudo apt-get -qq -y install dokku
sudo dokku plugin:install-dependencies --core
Unattended installation
In case you want to perform an unattended installation of Dokku, this is made possible through debconf, which allows you to configure a package before installing it.
You can set any of the below options through the debconf-set-selections command, for example to enable vhost-based deployments:
echo "dokku dokku/vhost_enable boolean true" | sudo debconf-set-selections
After setting the desired options, proceed with the installation as described above.
debconf options
| Name | Type | Default | Description |
|---|---|---|---|
| dokku/vhost_enable | boolean | false | Use vhost-based deployments (e.g. [yourapp].dokku.me) |
| dokku/hostname | string | dokku.me | Hostname, used as vhost domain and for showing app URL after deploy |
| dokku/skip_key_file | boolean | false | Don't check for the existence of the dokku/key_file. Warning: Setting this to true, will require you to manually add an SSH key later on. |
| dokku/key_file | string | /root/.ssh/id_rsa.pub | Path on disk to an SSH key to add to the Dokku user (Will be ignored on dpkg-reconfigure) |
| dokku/nginx_enable | boolean | true | Enable nginx-vhosts plugin. When false, the plugin is installed but left disabled, and the nginx:* commands are unavailable. |
| dokku/install_default_site | boolean | true | Install a catch-all nginx default site on fresh install |
Enabling the nginx-vhosts plugin after installation
If Dokku was installed with dokku/nginx_enable set to false, the nginx-vhosts plugin can be enabled later. The plugin:install --core call runs the plugin's install trigger, which sets up the nginx configuration required by Dokku.
sudo dokku plugin:enable nginx-vhosts
sudo dokku plugin:install --core