Skip to content

OpenTofu/Terraform Module to install Docker, Dokku, and Dokku plugins on a server with SSH access using the official Dokku bootstrap script

License

Notifications You must be signed in to change notification settings

iloveitaly/terraform-dokku-install

Repository files navigation

Install Dokku with Terraform

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.

Features

  • ✅ 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

Requirements

  • OpenTofu >= 1.6 or Terraform >= 1.5
  • SSH access to target server
  • Ubuntu 20.04+ (recommended)

Usage

See test/main.tf for example usage of the module.

Example

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"
  ]
}

Inputs

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

Outputs

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)

Related Projects

About

OpenTofu/Terraform Module to install Docker, Dokku, and Dokku plugins on a server with SSH access using the official Dokku bootstrap script

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published