Self-Hosting dotCMS on a VPS: A Complete Production Guide

Install Caddy (Reverse Proxy)

Caddy is a modern reverse proxy that automatically handles HTTPS certificates from Let's Encrypt. You give it a domain; it handles certificate issuance and renewal.

1. Install Caddy#


Follow the official Caddy installation docs for Ubuntu:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

Verify Caddy is running and serving on port 80:

# Open http://dotcms.info in a browser — you should see Caddy's default page

2. Enable HTTPS with One Line#


Edit the Caddyfile:

sudo nano /etc/caddy/Caddyfile

Replace the default contents with your domain:

dotcms.info {
    respond "Hello from dotCMS VPS"
}

Reload Caddy:

caddy reload --config /etc/caddy/Caddyfile

Open https://dotcms.info in a browser. Caddy will automatically obtain a Let's Encrypt certificate. You should see a padlock icon — HTTPS is live with zero certificate configuration.

For developers coming from Nginx: There is no ACME file to manage, no chmod commands, no certificate resolver config. The domain in the Caddyfile is the entire SSL setup.

Next up

Chapter 4: Install Docker and Portainer

Continue →