If you'd like to use your own TLS certificate instead of the default Let's Encrypt process provided by CaddyServer, follow the steps here.
Be sure to use full chain certificate provided by your vendor as it may lead to issue below
https://wiki.multiportal.io/en/service-provider/console-server#h-5-error-in-websocket-connection-unable-to-verify-the-first-certificate
/var/lib/caddy/.chown caddy:caddy /var/lib/caddy/certificate
chown caddy:caddy /var/lib/caddy/privatekey
Open the Caddyfile with your preferred text editor (e.g., nano):
sudo nano /etc/caddy/Caddyfile
Locate the section for your hostname or domain and modify it to use your custom certificate.
Example:
YOUR_FQDN {
tls /path/to/your/certificate /path/to/your/privatekey
...
}
YOUR_FQDN with your domain (e.g., example.com)./path/to/your/certificate and /path/to/your/privatekey with the actual paths to your uploaded certificate and key files.If you're using a combined file (certificate and private key in one file):
YOUR_FQDN {
tls /path/to/combined/file
...
}
CTRL+O, ENTER, and CTRL+X in nano).Run the following commands to start Caddy and enable it to start on boot:
sudo systemctl start caddy
sudo systemctl enable caddy
Check that Caddy is running without errors:
sudo systemctl status caddy
Test your website in a browser or with tools like curl to ensure your custom certificate is being used.
caddy).sudo journalctl -u caddy -f