I have installed mattermost, but I can't access my droplet ip.

October 11, 2016 70 views
Docker Applications Ubuntu 16.04

After updating and installing docker, I installed Mattermost software through these lines:

$ docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform

Checking through ssh, the application runs just fine, but I can't access it through the droplets ip adress.

What am I doing wrong?

1 Answer

The mattermost documentation gives this one-liner which does work properly.

docker run --name mattermost-preview -d --publish 8065:8065 mattermost/mattermost-preview

After running this command a mattermost server is listening on port 8065. Attempting to translate to port 80 on the host however failed and the service was not accessible. Instead to get the preview build up on port 80 I simply installed nginx (either locally or via a second docker container that maps port 80 to port 80 on the host and the following configuration file at /etc/nginx/sites-enabled/default

server {
     listen 80 default_server;
     listen [::]:80 default_server;

     location / {
             proxy_pass http://localhost:8065;
             proxy_set_header Host $host;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_set_header X-Forwarded-Proto $scheme;

For a production installation of mattermost using docker, the project recommends following these instructions rather than using the one-liner.

Have another answer? Share your knowledge.