A comprehensive guide to installing and configuring SSL certificates on Caddy web servers.
Before installing an SSL certificate on Caddy, ensure you have:
With Caddy, you have several options for SSL certificates:
If using your own certificates, follow these steps:
sudo mkdir -p /etc/caddy/certs/example.com
sudo cp example.com.crt /etc/caddy/certs/example.com/
sudo cp example.com.key /etc/caddy/certs/example.com/
sudo chown -R caddy:caddy /etc/caddy/certs/
sudo chmod 600 /etc/caddy/certs/example.com/*
Use our configuration generator to create your Caddy SSL configuration:
example.com {
root * /var/www/html
file_server
tls /etc/caddy/certs/example.com/example.com.crt /etc/caddy/certs/example.com/example.com.key
}
Verify your SSL configuration:
caddy validate
caddy reload
Caddy's automatic HTTPS features:
# Minimal Caddyfile for automatic HTTPS
example.com {
respond "Hello, HTTPS!"
}
Certellix is an independent service. We are not affiliated with any commercial certificate authority.