Hello everyone! I was able to successfully get certificates using this guide How to handle HTTPS using Nginx, Let's encrypt and Docker - Mindsers Blog, but I want to setup auto renewal using docker containers.
However, I get an error.
My domain is: mybrandview.co.uk
I ran this command: docker renew
Through docker compose file:
nginx:
image: nginx:latest
# build: ./nginx
depends_on:
- api
- client
restart: unless-stopped
volumes:
- ./nginx/conf/:/etc/nginx/conf.d/:ro
- ./data/certbot/conf:/etc/letsencrypt:ro
- ./data/certbot/www:/var/www/certbot:ro
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
ports:
- "80:80"
- "443:443"
certbot:
image: certbot/certbot:latest
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
- ./data/certbot/conf:/etc/letsencrypt:rw
- ./data/certbot/www:/var/www/certbot:rw
command: renew
It produced this output:
online-store-certbot-1 | Saving debug log to /var/log/letsencrypt/letsencrypt.log
online-store-certbot-1 |
online-store-certbot-1 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
online-store-certbot-1 | Processing /etc/letsencrypt/renewal/mybrandview.co.uk-0001.conf
online-store-certbot-1 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
online-store-certbot-1 | Renewal configuration file /etc/letsencrypt/renewal/mybrandview.co.uk.conf is broken.
online-store-certbot-1 | The error was: expected /etc/letsencrypt/live/mybrandview.co.uk/cert.pem to be a symlink
online-store-certbot-1 | Skipping.
online-store-certbot-1 | 0 renew failure(s), 1 parse failure(s)
online-store-certbot-1 | Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
online-store-certbot-1 | Certificate not yet due for renewal
online-store-certbot-1 |
online-store-certbot-1 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
online-store-certbot-1 | Processing /etc/letsencrypt/renewal/mybrandview.co.uk.conf
online-store-certbot-1 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
online-store-certbot-1 |
online-store-certbot-1 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
online-store-certbot-1 | The following certificates are not due for renewal yet:
online-store-certbot-1 | /etc/letsencrypt/live/mybrandview.co.uk-0001/fullchain.pem expires on 2023-06-20 (skipped)
online-store-certbot-1 | No renewals were attempted.
online-store-certbot-1 |
online-store-certbot-1 | Additionally, the following renewal configurations were invalid:
online-store-certbot-1 | /etc/letsencrypt/renewal/mybrandview.co.uk.conf (parsefail)
online-store-certbot-1 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
My web server is (include version):
nginx:latest
The operating system my web server runs on is (include version):
Ubuntu 22.04.1 LTS
My hosting provider, if applicable, is:
time4vps
I can login to a root shell on my machine (yes or no, or I don't know):
yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
No
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot):
Docker container Certbot:latest
certbot --version
certbot 1.21.0
docker compose run --rm certbot --version
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/mybrandview.co.uk-0001.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Certificate not yet due for renewal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/mybrandview.co.uk.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Renewal configuration file /etc/letsencrypt/renewal/mybrandview.co.uk.conf is broken.
The error was: expected /etc/letsencrypt/live/mybrandview.co.uk/cert.pem to be a symlink
Skipping.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The following certificates are not due for renewal yet:
/etc/letsencrypt/live/mybrandview.co.uk-0001/fullchain.pem expires on 2023-06-20 (skipped)
No renewals were attempted.
Additionally, the following renewal configurations were invalid:
/etc/letsencrypt/renewal/mybrandview.co.uk.conf (parsefail)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0 renew failure(s), 1 parse failure(s)
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.```