Public | Automated Build

Last pushed: 8 months ago
Short Description
LetsEncrypt Certbot with Alpine Linux
Full Description

#LetsEncrypt Certbot with Alpine Linux

1. Add aliases to your web server for all domains you need cert:


location /.well-known/ { alias /usr/share/nginx/html/.well-known/; }


Alias /.well-known/ /usr/share/nginx/html/.well-known/

2. Fetch certs

docker run -it --rm -v /etc/ssl/letsencrypt:/etc/letsencrypt/ \
-v /usr/share/nginx/html/:/var/www/ fserver/certbot \
certbot certonly --agree-tos -t -m \
--webroot -w /var/www/ -d -d
  • /etc/ssl/letsencrypt - dir with letsencrypt data, certs you will find at /etc/ssl/letsencrypt/live/
  • /usr/share/nginx/html/ - dir shared via web server for domain check
  • add all domains you need with -d

3. Update certs manualy with

docker run -it --rm -v /etc/ssl/letsencrypt:/etc/letsencrypt/ \
-v /usr/share/nginx/html/:/var/www/ \
fserver/certbot certbot renew

or add to crontab:

echo "1 1 * * sat root docker run -it --rm -v /etc/ssl/letsencrypt:/etc/letsencrypt/ -v /usr/share/nginx/html/:/var/www/ fserver/certbot certbot renew" >> /etc/crontab

will try to update certs every week

Docker: fserver/certbot

Docker Pull Command
Source Repository