🚀 Host a Website on Your VPS with Free HTTPS (Caddy)

Put a static site or SPA on your VPS behind Caddy with automatic Let's Encrypt certificates. Real commands, 7 minutes.

Caddy gets and renews Let's Encrypt certificates automatically - no certbot timers, no config gymnastics. Prereq: a domain with an A record pointing to your VPS IP.

1. Install Caddy

ssh root@YOUR_SERVER_IP
apt update && apt install -y caddy
# for the latest version consider the official caddy.com repo

2. Upload your site

mkdir -p /var/www/mysite
# from your computer:
scp -r ./dist/* root@YOUR_SERVER_IP:/var/www/mysite/

3. Point Caddy at it

cat > /etc/caddy/Caddyfile <<'EOF'
mysite.com {
    root * /var/www/mysite
    encode gzip
    file_server
}
EOF
systemctl reload caddy

4. Done - check it

Open `https://mysite.com` - the padlock is already there. Caddy issued and will auto-renew the certificate itself. SPA routing? Add `try_files {path} /index.html` inside the site block.

No server yet? A [Core VPS 4 (€12/mo)] comfortably hosts several sites.

Related

View plansGuidesFAQ