Set up and rotate certificates using ACME
Set up and automatically rotate third-party SSL/TLS certificates using the ACME protocol (such as Let’s Encrypt) on containerized installations.
1. Use case
Configure ACME certificate rotation to:
-
Secure the containerized server with valid public CA-signed certificates.
-
Automate certificate renewal and rotation to prevent downtime.
-
Use the same CA and certificate chain for both server and database containers.
2. Outcome
The containerized server uses valid public certificates that automatically rotate on renewal, updating Podman secrets and restarting services without manual intervention.
3. Preparation
Ensure you have:
-
Root access to the server container host.
-
The
acme.shtool installed on the host. -
An active DNS challenge provider configured in
acme.shfor the server FQDN. -
The fully qualified domain name (FQDN) of your server.
4. Step-by-step workflow instructions
|
If using an intermediate CA, the certificate file must contain the server certificate first, followed by all intermediate CAs in order. |
Open a terminal on the server container host as
root.Create the certificate directory:
mkdir -p /root/ssl-buildExport the DNS challenge credentials. For example, for Cloudflare:
export CF_Token="your_cloudflare_api_token" export CF_Account_ID="your_cloudflare_account_id"
Replace with credentials for your specific DNS provider.
Issue the certificate and define
--reloadcmdto rotate the certificates usingmgradm ssl rotateon renewal:./acme.sh \ --issue \ --force \ --dns dns_cf \ --keylength 4096 \ --domain <SERVER_FQDN> \ --cert-file /root/ssl-build/server.crt \ --key-file /root/ssl-build/server.key \ --ca-file /root/ssl-build/ca.pem \ --fullchain-file /root/ssl-build/fullchain.pem \ --reloadcmd "mgradm ssl rotate --ssl-ca-root /root/ssl-build/ca.pem --ssl-server-cert /root/ssl-build/fullchain.pem --ssl-server-key /root/ssl-build/server.key"Verify the initial run completes successfully, updating the server and database certificates and restarting the services.
|
The |
5. Troubleshooting: CA password prompt during upgrades
If upgrading a legacy server to a split database release (such as 2025.05), mgradm prompts for the CA password to sign database certificates.
-
Self-signed certificates: Retrieve the password from
/var/lib/containers/storage/volumes/root/_data/spacewalk-answers(ssl-passwordvalue). -
Third-party/ACME certificates: No password is required. Pass
--ssl-db-*flags to the upgrade command, or let the upgrade complete using self-signed placeholders and then update secrets using this guide.
6. Related topics
-
For details on importing custom certificates, see Import SSL Certificates.
-
For CA migration information, see Migrate SSL Certificate Authorities.