How to change http to https url in docker


#1

Hi,

I have installed mattermost through docker. Now its running on port 8065. and insecure http connection.
I want to switch that url from http to https in docker running mattermost.

So please guide me, how to fullfil this requirement. This app is very new for me.

Thanks
Hitesh


#2

Hi @hitesh
There is a place to put your certificates, if you are using the multi-container version. If you are using the preview, I don’t think you can do it. The volume is /cert for the web container.
Once you put your certificates (for the domain you will use) then you need to publish the port (in the docker-compose.yml file). You need to enable the environment variable for MATTERMOST_ENABLE_SSL to true. Rebuild the containers (delete previous ones if you already ran it before by doing docker-compose rm and start new ones with docker-compose up -d
That should handle it.
For more details see here: https://github.com/mattermost/mattermost-docker
I personally used nginx reverse proxy docker image. But that’s because I needed to handle multiple sites in the same server.


#3

Thanks buddy,

I am using preview version, Is there any scope to change ?

Regards
Hitesh


#4

Now i have installed this on VM. and when i do following configuration. It stops working.

Go to the General > Configuration section of the System Console.
Change the Listen Address setting to :443
Change the Connection Security setting to TLS
Change the Forward port 80 to 443 setting to true if you wish to redirect users that try to connect insecurely to a secure connection. If you’re using a proxy such as NGINX in front of Mattermost this setting is unnecessary and should be set to false
Run sudo setcap cap_net_bind_service=+ep ./bin/platform in your Mattermost directory to allow Mattermost to bind to low ports. You will need to re-run this command every time you upgrade Mattermost or it will fail to bind to the port.

After this i got this error


#5

Was this with the 3 docker containers? As per this https://github.com/mattermost/mattermost-docker
It seems like this is something outside docker containers?