Updated Summary: Installing SSL Certificates on Proxmox Using acme.sh
and DigitalOcean DNS Challenge
- Ensure
acme.sh
is installed. - Obtain a DigitalOcean API token with DNS write permissions.
Before issuing any certificates, register your email address (for notifications and key recovery):
acme.sh --register-account -m [email protected]
Request an ECC certificate for your Proxmox domain using the DNS challenge with DigitalOcean:
export DO_API_TOKEN="your_digitalocean_api_token"
acme.sh --issue --dns dns_dgon -d proxmox.example.com --keylength ec-256
Install the certificate to a user-accessible directory:
acme.sh --install-cert -d proxmox.example.com \
--key-file /home/altanc/.acme.sh/proxmox.example.com_ecc/proxmox.example.com.key \
--fullchain-file /home/altanc/.acme.sh/proxmox.example.com_ecc/fullchain.cer \
--reloadcmd "/home/altanc/acme-proxmox-hook.sh"
Create a script (/home/altanc/acme-proxmox-hook.sh
) to copy the certificates to Proxmox’s SSL folder:
#!/bin/bash
# Copy the key and certificate to Proxmox's SSL folder
sudo cp /home/altanc/.acme.sh/proxmox.example.com_ecc/proxmox.example.com.key /etc/pve/local/pve-ssl.key
sudo cp /home/altanc/.acme.sh/proxmox.example.com_ecc/fullchain.cer /etc/pve/local/pve-ssl.pem
# Set correct permissions
sudo chmod 640 /etc/pve/local/pve-ssl.key
sudo chmod 640 /etc/pve/local/pve-ssl.pem
# Restart the Proxmox proxy service to apply the new certificates
sudo systemctl restart pveproxy
Make the script executable:
chmod +x /home/altanc/acme-proxmox-hook.sh
Edit the sudoers
file using visudo
and add:
altanc ALL=(root) NOPASSWD: /bin/cp, /bin/chmod, /bin/systemctl
Execute the hook script to copy the certificates and restart Proxmox:
/home/altanc/acme-proxmox-hook.sh
Visit your Proxmox web interface (https://proxmox.example.com
) to ensure the new SSL certificate is applied correctly.
- Registered an account with
acme.sh
using your email. - Used
acme.sh
as a non-root user. - Leveraged a hook script with
sudo
for secure file copying. - Automated the reload of the Proxmox proxy service to apply changes.
This process is secure, streamlined, and includes account registration for better certificate management.