Web Servers

Host Caddy on VeloxaHost

Caddy is a web server and reverse proxy that obtains and renews TLS certificates by itself and is configured with a short, readable Caddyfile. Developers self-host it to serve static sites and put HTTPS in front of their apps without writing certificate scripts.

The one-click install puts Ubuntu 24.04's own caddy package on the server and starts the caddy systemd service, configured by /etc/caddy/Caddyfile. Ubuntu's package is Caddy 2.6.2, from 2022, with Ubuntu's security patches; Caddy's own releases are on the 2.11 line. The steps below install the current release if you want newer features.

When automatic HTTPS works

Caddy's headline feature is automatic HTTPS: give it a domain name in the Caddyfile and it gets a certificate from Let's Encrypt or ZeroSSL and renews it. The ACME challenges it uses need ports 80 or 443 on a public address. Every VeloxaHost server gets a block of ports (10 by default) on the region's shared IPv4 address, and those ports cannot be 80 or 443, so automatic HTTPS needs a dedicated IPv4 address, a paid add-on with limited availability. IPv6 is not available in US East yet.

On the shared address, Caddy still works over plain HTTP on any port, or with tls internal, which uses Caddy's own local certificate authority (browsers warn unless they trust it).

Caddyfiles that fit

Static files on a forwarded shared IPv4 port:

:8080 {
    root * /srv/site
    file_server
}

With a dedicated IPv4 address and DNS names pointing at it, HTTPS in front of two apps:

app.example.com {
    reverse_proxy 127.0.0.1:3000
}
docs.example.com {
    reverse_proxy 127.0.0.1:8081
}

Apply changes with systemctl reload caddy, which reloads without downtime and keeps the old configuration if the new one has an error.

Sizing

Caddy is a single Go binary with no runtime dependencies, so it needs nothing else installed on the server. Serving static files and proxying a few apps takes tens of megabytes; TLS handshakes for many new connections are what use CPU. One vCPU and 512 MB suit most small sites.

Install it yourself

Caddy publishes signed .deb packages with each GitHub release, which include the systemd service and a caddy user.

  1. On Ubuntu 24.04, download the current package (check the releases page for the latest version).
    curl -fsSLO https://github.com/caddyserver/caddy/releases/download/v2.11.7/caddy_2.11.7_linux_amd64.deb
    
  2. Install it.
    apt install -y ./caddy_2.11.7_linux_amd64.deb
    
  3. Write your site into /etc/caddy/Caddyfile.
  4. Check and apply it.
    caddy validate --config /etc/caddy/Caddyfile && systemctl reload caddy
    
  5. Forward a port from your block to Caddy's port, or point DNS at your dedicated IPv4 address.

FAQ

Where does Caddy keep certificates?

In its data directory, which for the packaged service is /var/lib/caddy/.local/share/caddy. Back it up with /etc/caddy, or schedule VeloxaHost snapshots (hourly to weekly, kept 1 to 30 days), so a restore does not have to request every certificate again.

Can I use the DNS challenge on a shared IPv4 port?

Yes, but DNS providers are plugins, and neither Ubuntu's package nor the standard release includes them. Build Caddy with your provider's module using xcaddy, or download a custom build from Caddy's download page, then set tls { dns <provider> <token> }.

Is there a Docker version?

Yes, the catalogue also has Caddy (Docker), which runs the official image as an application container.

What license is Caddy under?

The Apache License 2.0.

Which VeloxaHost size fits Caddy?

A Veloxa Nano covers the recommended size: 1 vCPU, 1 GB RAM and 25 GB of disk for $4 a month, billed at $0.01 an hour and capped at the monthly price.