Deploy on a VPS
This guide covers deploying a Kyushu worker on a fresh VPS. The example uses Hetzner Cloud with Ubuntu 24.04, but any VPS with a recent Ubuntu/Debian works.
Prerequisites
Section titled “Prerequisites”- A VPS with Ubuntu 24.04
- A domain pointing to the VPS IP (A record)
- SSH access as root
-
Update the system and install Caddy
Terminal window apt update && apt upgrade -yapt install -y curl caddy -
Install the Kyushu CLI
Terminal window curl -fsSL https://kyushu.dev/install | bashsource ~/.kyu/bin/envkyu --version -
Deploy your worker
Copy the worker to the VPS:
Terminal window mkdir -p /opt/myapprsync -av ./worker user@yourserver:/opt/myapp/If your worker uses a config file or static assets, copy those too:
Terminal window rsync -av kyushu.toml ./assets/ user@yourserver:/opt/myapp/rsync -av ./public user@yourserver:/opt/myapp/ -
Create a systemd service
Terminal window cat > /etc/systemd/system/myapp.service << 'EOF'[Unit]Description=My ApplicationAfter=network.target[Service]ExecStart=/root/.kyu/bin/kyu runWorkingDirectory=/opt/myappRestart=on-failureRestartSec=5[Install]WantedBy=multi-user.targetEOFsystemctl daemon-reloadsystemctl enable myappsystemctl start myappsystemctl status myappThe service starts automatically on boot and restarts on failure.
-
Configure Caddy
Start by adding the DNS records in your domain registrar’s dashboard:
Type Name Value A @Your VPS IPv4 ( curl -4 ifconfig.me)AAAA @Your VPS IPv6 ( curl -6 ifconfig.me)Once your domain’s DNS has propagated, configure Caddy as a reverse proxy. Check propagation first:
Terminal window dig yourdomain.com +short @8.8.8.8Then write the Caddyfile:
Terminal window cat > /etc/caddy/Caddyfile << 'EOF'yourdomain.com {reverse_proxy localhost:5987}EOFsystemctl restart caddyCaddy automatically provisions and renews a TLS certificate via Let’s Encrypt.
Verify
Section titled “Verify”curl https://yourdomain.comUpdating
Section titled “Updating”To manually deploy a new release, stop the service, replace the files, and restart:
systemctl stop myapp# copy your updated artifacts to /opt/myappsystemctl start myapp