/mattermost-nginx-letsencrypt-auto-renew-ssl

Mattermost using the Docker setup together with nginx-proxy, using the LetsEncrypt companion container for nginx-proxy for automatic renew Let’s Encrypt certs.

Getting Started

First, create a Docker network. This enables container DNS, which allows containers to communicate with one another by name.

docker network create mattermostnw

Customize the nginx-proxy settings

  • Read the official Mattermost docker here
  • Read the Nginx-proxy documentation here

Start the Nginx proxy

docker run --name nginx-proxy --net mattermostnw -p 80:80 -p 443:443 -v /path/to/custom.conf:/etc/nginx/conf.d/my_proxy.conf:ro -v ~/certs:/etc/nginx/certs -v /etc/nginx/vhost.d -v /usr/share/nginx/html -v /var/run/docker.sock:/tmp/docker.sock:ro --label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy -d --restart always jwilder/nginx-proxy

Note: Remember change the mounted paths to your own

Start the Let’s Encrypt Nginx Proxy Companion.

docker run --name letsencrypt-nginx-proxy-companion --net mattermostnw -v ~/certs:/etc/nginx/certs:rw -v /var/run/docker.sock:/var/run/docker.sock:ro --volumes-from nginx-proxy -d --restart always jrcs/letsencrypt-nginx-proxy-companion

Start Mattermost

  • Pulling the latest Mattermost docker
  • Copy override docker-compose.yml to mattermost-docker folder
  • Run docker-compose build && docker-compose up -d

Credits