TLS 证书自动申请
2025年9月5日小于 1 分钟
提示
Certbot automatically connects to Let’s Encrypt to obtain the certificate
Certbot will only download the certificate and private key.
The files are saved in:
/example.com/fullchain.pem (certificate)
/etc/letsencrypt/live/example.com/privkey.pem (private key)
certbot
sudo apt update
sudo apt install python3 python3-dev python3-venv libaugeas-dev gcc
- set up a virtual environment
sudo python3 -m venv /opt/certbot/
sudo /opt/certbot/bin/pip install --upgrade pip
- Install Certbot
sudo /opt/certbot/bin/pip install certbot certbot-nginx
- Prepare the Certbot command
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
- run
自动配置nginx
sudo certbot --nginx -d example.com
certbot certonly --standalone
只申请证书