Docker Community Forums

Share and learn in the Docker community.

How to set up ssl for container website

The following image displays my website set up so far:

I just want to know how to set up SSL to change the HTTP to HTTPS in my situation. I have tried to follow a few guidance but still failed… (driving me crazyyyyy)

Is there any detailed instruction/steps to guide me to set up SSL in such env?

Any help will be appreciated…

Try to keep your container as stateless as possible, so don’t use certbot inside the container. Instead use certbot for Apache or whatever web server you have outside of your application container.

It’s okay to have Apache talk to your application container in plain HTTP since your container is not exposed to the public web (make sure it only accepts localhost connections). Many people take an even easier route and use Cloudflare for SSL, this means the switch from http to https happens even closer to the end user.

Note: This method of having a reverse proxy handle SSL instead of your application is called “SSL Termination”.