If you want to generate Let’s Encrypt SSL certificates for HTTPS communication for your Apache HTTP Server running as Docker container, just follow these steps.
Steps beginning with new only are only for generating new certificates, steps beginning with renew only are only necessary if you got certificates before and want to renew them.
- Go to Docker services directory (e. g.
- Stop all Docker services:
- Go to certificate directory (e. g.
- Renew only: Remove or rename old files
- Browse to gethttpsforfree.com
- Follow given instructions. Hint: just follow them and execute commands you find under “how do I generate this?” in every step on host machine. You don’t have to execute them in Docker container
- In the end you got new files
intermediate.pemwhich can be used by Apache HTTP Server
- New only: Link certificate directory as volume in Apache HTTP Server Docker container (e. g. Docker run with
--volume /etc/ssl/domain.tld/:/etc/apache2/certs/domain.tld/). Add SSL configuration to Apache HTTP Server configuration as described in step 5 on gethttpsforfree.com
- Go to Docker services directory and start your services (e. g.
cd /var/docker && docker-compose up -d)