OpenTofu/Terraform Module to install Docker, Dokku, and Dokku plugins on a server with SSH access using the official Dokku bootstrap script.
This pairs really well with this other dokku terraform module which is focused on configuring an already-installed Dokku instance.
- ✅ Uses official Dokku bootstrap installation method
- ✅ Idempotent installation (safe to run multiple times)
- ✅ Modern Ubuntu support (20.04, 22.04, 24.04)
- ✅ Supports latest Dokku versions (0.35.x)
- ✅ Improved error handling and logging
- ✅ Declarative plugin management
- ✅ Supports both shortnames and full URLs for plugins
- OpenTofu >= 1.6 or Terraform >= 1.5
- SSH access to target server
- Ubuntu 20.04+ (recommended)
See test/main.tf
for example usage of the module.
module "dokku" {
source = "path/to/this/module"
ssh_host = "192.168.1.100"
ssh_user = "root"
ssh_private_key_path = "~/.ssh/id_rsa"
dokku_version = "0.35.20"
dokku_hostname = "dokku.example.com"
dokku_plugins = [
"postgres",
"redis",
"mysql"
]
}
Name | Description | Type | Default | Required |
---|---|---|---|---|
dokku_hostname | Dokku hostname | string | "dokku.yourhost.com" |
no |
dokku_ssh_key_name | Name for the SSH key in Dokku (used with ssh-keys:add command) | string | "admin" |
no |
dokku_ssh_public_key_path | Path to SSH public key file to add to Dokku for deployments (optional) | string | null |
no |
dokku_version | Dokku version | string | "0.35.20" |
no |
ssh_host | SSH host | string | "192.168.0.100" |
no |
ssh_private_key_path | SSH private key path | string | "~/.ssh/id_rsa" |
no |
ssh_user | SSH user | string | "root" |
no |
Name | Description |
---|---|
dokku_hostname | The hostname configured for Dokku |
dokku_version | The version of Dokku installed |
installation_id | Unique identifier for this Dokku installation |
ssh_host | The SSH host where Dokku is installed |
ssh_key_configured | Whether an SSH public key was configured for Dokku deployments |
ssh_key_name | The name of the SSH key configured in Dokku (if any) |
- https://github.com/dhinus/dokku-terraform/blob/master/scripts/install-dokku.sh
- https://github.com/brotandgames/terraform-dokku this project was my original inspiration