I deployed the Marketplace version of Mattermost, but I can't get it working with https.

August 25, 2019 237 views
DigitalOcean Let's Encrypt Nginx Ubuntu 18.04

I’ve gone through the setup steps a number of times, trying recommended settings for a proxy pass-through using nginx.

I’ve got my domain set up, and the droplet has a LetsEncrypt certificate (via certbot), which produces an A rating from www.ssllabs.com/ssltest/. But the only configuration I can get to work for the app itself is to use http and the mattermost default port of :8065.

I seem to be caught in a catch-22 between Mattermost SSL configs and the droplet’s nginx configs, and perhaps how certbot alters the nginx configs.

I’m happy to do more legwork if you could point me at any other guidance about using https with the Marketplace implementation of Mattermost (which I very much appreciate).

1 Answer

I just tested and got it working. Here are the exact steps I took:

  1. Deploy mattermost one-click
  2. Point a domain at your Mattermost droplet. In my case I pointed a subdomain at it by adding an A-Record to my domain. mattermost a record
  3. Go through initialization steps (create a user and a team)
  4. SSH into droplet and run sudo setcap cap_net_bind_service=+ep /opt/mattermost/bin/mattermost to give mattermost access to lower range ports ref
  5. Go to http://YOUR.DROPLET.IP:8065/admin_console/general/configuration
    • Set site URL to https://your.domain (the same domain you configured in step 2)
    • Set Listen Address to :443
    • Forward port 80 to 443 to true
    • Connection Security: TLS
    • Use Lets Encrypt true mattermost-config
  6. Finally run sudo systemctl restart mattermost on the server.

Now (after about a minute) you should be able to go to https://your.domain and see the mattermost login

  • Thank you so much for running through the setup, and passing along your steps.

    I had done all of your steps above except for the setcap.
    However, after calling setcap, the mattermost, restart failed, and this error was logged:
    "commands/server.go:77","msg":"listen tcp :443: bind: address already in use"}

    I suspect this is an artifact of all the configuring I was trying to get SSL to work, so I need to comb through my nginx settings, which I can’t do at the moment. If all else fails I’ll start over and follow your steps from scratch.

    Thanks again!

Have another answer? Share your knowledge.