OpenEMR Docker SSL HTTPS Setup Question

I’ve been managing and customizing an OpenEMR site for years and I have the opportunity to start over with a new site.

One of my main goals is to stay plugged in with current releases and actually start contributing back as well so I don’t end up diverging again if possible.

I have the site up and running on Docker now but not with ssl which is bad for production.

I understand in the docker-compose.yaml file I need to set the hostname and email but I’m not sure what to use for hostname…

The docker container is running on a linode server… I can get a name set up for the server itself no problem…but how do I determine and configure the hostname for the container so that it works with letsencrypt?

Are there instructions somewhere already that I’m missing?

hi @KyleNave, you’ll want to configure the domain name or public facing ip address of the server

I already have a dns entry for the server itself. I can access using the name - let’s call it “atlas” … so get’s me to the server.

Now I need to set the ServerName in the Docker-compose file (I think) so that the letsencrypt ssl “works” … and I put that in quotes because I think I saw this is supposed to be automated as long as ServerName and email are filled in.

Is this as simple as putting the ip address of the docker container?

Thank you for the help.

Hi @KyleNave ,

In your case, since you already have the DNS set up, then it should be just as simple as setting the DOMAIN to your public facing . fyi, here is where the magic happens in the docker:
openemr-devops/ at master · openemr/openemr-devops · GitHub

btw, do note that the docker will set up a self-signed certs if above isn’t set which can then be manually changed to signed certs:

Thanks Brady…just to make sure I understand. Since I have the site up and running already and I had not set the DOMAIN and EMAIL at the time I launched it, I have to make some changes manually that would have occurred automatically?

I did try setting those env variables and did a docker-compose down and up … it seemed to iterate several times and would fail on the communication with letsencrypt. I backed out the change and got it back up so I was not interfering with users but I will capture the error message and post later today if that’s useful.

@brady.miller I have been spinning my wheels on how to install an SSL certificate on Docker.
I am stuck at getting in the docker container.

I found these instructions for setting up certbot in a docker.

Can someone give me step-by-step instructions on how to do this with an OpenEMR container?

Also, I need to upgrade the container. Where can I find upgrade instructions?

What kind of docker, like an AWS install?

if you’re using a production docker like the one for v7 then you’ll find certbot installed

can verify after exec’ing into the docker and typing
which certbot

then you can manually install the certificate with a certbot certonly and either edit /etc/apache2/conf.d/openemr.conf or cp the lets encrypt files to where openemr.conf is looking

and restart the openemr docker

The docker is the AWS standard edition is what I was told.
They launched v6.1.0 with no patches.
I only know of one certbot. On my installs, I install certbot and then run sudo certbot --apache. Then follow the prompts.

I read the instructions at the bottom of the Docker page but it is more of a statement rather than instructions on how to upgrade. The auto upgrade has not happened for their installation. What do we do in this case?

I have looked through this thread
OpenEMR Official Docker has been released! - #39 by Nishant_Pathak.

But it is not a lot of help. I remember to go to the command prompt and type

 sudo docker ps

This gets me the docker container ID. But I don’t remember what to do after that to get into the container. I ran

 sudo docker --help

This gave me a list of commands to run. I see cp command to copy files between the local file system and the container.

I see the exec which says to run a command in a running container. Then I ended up here:

In my opinion, there should be a warning label to not launch the docker container unless there is a cluster the user is about to build. Otherwise don’t launch a docker. There is no good reason I can see for a standalone docker.

Only because I have not taken the time to learn to use it. LOL

for docker, especially if you have a specific domain name you want to use, I find that it is better to use the route 53 method with elastic load balancer. AWS will give you a free certificate to be applied to your domain/subdomain.