This guide describes how to deploy the Talos Manager application on Dokku using the official Docker Image.
- A server running Dokku (min. v0.28.0)
- Dokku Postgres plugin installed
- Dokku Letsencrypt plugin installed (if you want SSL)
- SSH access to your Dokku server
sudo dokku plugin:install https://github.com/dokku/dokku-postgres.git
sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
# Create the application
dokku apps:create talos-manager
# Create and link the Postgres database
dokku postgres:create talos-manager-db
dokku postgres:link talos-manager-db talos-manager
Talos Manager requires an SSH key for bootstrapping servers. Create and configure it:
# Generate SSH key in PEM format
ssh-keygen -m PEM -t rsa -b 4096 -P "" -f ~/.ssh/talos-manager.pem -C talos-manager
# Add the public key to the appropriate places
# 1. Hetzner Robot: https://robot.hetzner.com/key/index -> New key
# 2. Hetzner Cloud: https://console.hetzner.cloud/ -> Select Project -> Security -> Add SSH Key
# Function to generate random strings for secrets
function random_string() {
cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
}
# Set up the official Docker image
dokku docker-options:add talos-manager deploy,run "--pull=always"
dokku git:from-image talos-manager reclaimthestack/talos-manager:latest
# Configure Rails environment variables
dokku config:set talos-manager \
RAILS_ENV=production \
RAILS_MAX_THREADS=20 \
SECRET_KEY_BASE=$(random_string) \
AR_ENCRYPTION_PRIMARY_KEY=$(random_string) \
AR_ENCRYPTION_DETERMINISTIC_KEY=$(random_string) \
AR_ENCRYPTION_KEY_DERIVATION_SALT=$(random_string)
# Hetzner Cloud API token (if you're using Hetzner cloud servers)
dokku config:set talos-manager HETZNER_CLOUD_API_TOKEN=<hetzner-cloud-api-token>
# Hetzner webservice API credentials (if you're using dedicated servers)
dokku config:set talos-manager HETZNER_WEBSERVICE_USER=<username> HETZNER_WEBSERVICE_PASSWORD=<password>
# Set the application host
dokku config:set talos-manager HOST=<your-dokku-domain>
# Add the SSH private key for bootstrapping (base64 encoded, without line breaks)
dokku config:set --encoded talos-manager SSH_PRIVATE_KEY="$(base64 -w0 ~/.ssh/talos-manager.pem)"
# Set HTTP basic auth password to protect the app
dokku config:set talos-manager BASIC_AUTH_PASSWORD=$(random_string)
# Add your domain
dokku domains:add talos-manager <your-domain>
# Deploy the application
dokku ps:restart talos-manager
# Set email for Let's Encrypt notifications
dokku config:set --global DOKKU_LETSENCRYPT_EMAIL=<your-email>
# Enable SSL
dokku letsencrypt:enable talos-manager
# Set up auto-renewal
dokku letsencrypt:auto-renew talos-manager
# Set up cron job
ssh root@<your-dokku-server> "dokku letsencrypt:cron-job --add"
To upgrade the Talos Manager version:
# Upgrade to a specific version
dokku git:from-image talos-manager reclaimthestack/talos-manager:<version>
# Or always use the latest version
dokku git:from-image talos-manager reclaimthestack/talos-manager:latest
If you encounter problems with database migrations, you can reset the database:
# Stop the application
dokku ps:stop talos-manager
# Delete and recreate the database schema
dokku postgres:connect talos-manager-db -c 'DROP SCHEMA public CASCADE; CREATE SCHEMA public;'
# Load the schema
dokku run talos-manager bundle exec rails db:schema:load DISABLE_DATABASE_ENVIRONMENT_CHECK=1
# Restart the application
dokku ps:start talos-manager
# View application logs
dokku logs talos-manager
# Continuously monitor logs
dokku logs talos-manager -t
# Restart the application
dokku ps:restart talos-manager
# Stop the application
dokku ps:stop talos-manager
# Start the application
dokku ps:start talos-manager
# List environment variables
dokku config:show talos-manager