HTTPS Setup
Option 1: Caddy (Recommended)
Section titled “Option 1: Caddy (Recommended)”Caddy automatically provisions and renews TLS certificates from Let’s Encrypt. Zero configuration needed beyond your domain name.
Install Caddy
Section titled “Install Caddy”sudo apt install -y debian-keyring debian-archive-keyring apt-transport-httpscurl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpgcurl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.listsudo apt updatesudo apt install caddyConfigure
Section titled “Configure”Create /etc/caddy/Caddyfile:
deploy.example.com { reverse_proxy 127.0.0.1:3000}Start Caddy
Section titled “Start Caddy”sudo systemctl enable --now caddyCaddy will automatically:
- Obtain a TLS certificate from Let’s Encrypt
- Redirect HTTP to HTTPS
- Renew certificates before they expire
Option 2: Nginx + Certbot
Section titled “Option 2: Nginx + Certbot”Install Nginx and Certbot
Section titled “Install Nginx and Certbot”sudo apt install nginx certbot python3-certbot-nginxConfigure Nginx
Section titled “Configure Nginx”Create /etc/nginx/sites-available/vps-deployer:
server { listen 80; server_name deploy.example.com;
location / { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; }}Enable the site:
sudo ln -s /etc/nginx/sites-available/vps-deployer /etc/nginx/sites-enabled/sudo nginx -t && sudo systemctl reload nginxGet TLS Certificate
Section titled “Get TLS Certificate”sudo certbot --nginx -d deploy.example.comCertbot will:
- Verify domain ownership
- Obtain a certificate from Let’s Encrypt
- Update your Nginx config with SSL settings
- Set up automatic renewal
Option 3: Cloudflare Tunnel
Section titled “Option 3: Cloudflare Tunnel”If you don’t want to open ports on your VPS:
- Install
cloudflaredon your VPS - Create a tunnel in the Cloudflare dashboard
- Route
deploy.example.comtohttp://localhost:3000
Cloudflare handles TLS termination and DDoS protection.
DNS Requirements
Section titled “DNS Requirements”For Let’s Encrypt to work, your domain must:
- Point to your VPS IP address (A record)
- Be publicly accessible on port 80 (for HTTP-01 challenge)
Updating Your Webhook URL
Section titled “Updating Your Webhook URL”After setting up HTTPS, update your GitHub webhook URL to use https://:
https://deploy.example.com/webhook/<project-id>