Deploy on a VPS
This guide covers deploying yawa on a fresh VPS. The example uses Hetzner Cloud with Ubuntu 24.04, but any VPS with a recent Ubuntu/Debian and Docker support 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 and Docker
Terminal window apt update && apt upgrade -yapt install -y curl caddy docker.io docker-compose-plugin -
Create the deployment directory
Terminal window mkdir -p /opt/yawacd /opt/yawa -
Create a
docker-compose.ymlservices:app:image: peterpeterparker/yawa:latestports:- "3000:3000"volumes:- yawa-data:/dataenvironment:- YAWA_SESSION_SECRET=${YAWA_SESSION_SECRET}restart: unless-stoppedvolumes:yawa-data: -
Generate a secret and start the server
Terminal window echo "YAWA_SESSION_SECRET=$(openssl rand -base64 32)" > .envdocker compose up -d -
Configure Caddy
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.com/healthUpdating
Section titled “Updating”To deploy a new release, pull the latest image and recreate the container:
cd /opt/yawadocker compose pulldocker compose up -d