Step 1
Create DNS records
Create an A record for the hostname pointing to the VPS IPv4. Remove stale A/AAAA records that route somewhere else.
dig +short A app.example.com
# The answer must equal <server-ip>Step 2
Allow web traffic
Open HTTP and HTTPS while keeping SSH allowed.
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw statusStep 3
Install and configure Caddy
Install Caddy from its supported package source, then proxy the hostname to the local application.
app.example.com {
reverse_proxy 127.0.0.1:3000
}Step 4
Verify HTTPS and logs
Check the certificate, response, and service logs before changing application settings.
caddy validate --config /etc/caddy/Caddyfile
systemctl reload caddy
curl -I https://app.example.com
journalctl -u caddy -n 100 --no-pager