# Installing MM on a machine where 443 is used

**URL:** <https://forum.mattermost.com/t/installing-mm-on-a-machine-where-443-is-used/8239>\
**Category:** Troubleshooting\
**Created:** [October 4, 2019, 8:34pm UTC](https://forum.mattermost.com/t/installing-mm-on-a-machine-where-443-is-used/8239 "2019-10-04T20:34:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PackElend](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/packelend/32/3261_2.png) [@PackElend](https://forum.mattermost.com/u/PackElend)\
**Post date:** [October 4, 2019, 8:34pm UTC](https://forum.mattermost.com/t/installing-mm-on-a-machine-where-443-is-used/8239/1 "2019-10-04T20:34:55Z")

</div>

I followed [https://docs.mattermost.com/install/prod-docker.html](https://docs.mattermost.com/install/prod-docker.html) to install MM on VPS running discourse alreaday but run into

```
root@Ubuntu18:~/mattermost-docker# docker-compose up -d
Creating network "mattermost-docker_default" with the default driver
Creating mattermost-docker_app_1 ...
Creating mattermost-docker_web_1 ... error
Creating mattermost-docker_db_1 ...
Creating mattermost-docker_app_1 ... done
ERROR: for mattermost-docker_web_1 Cannot start service web: driver failed programming external connectivity on endpoint mattermost-docker_web_1 (a210daeda9eb7f3df79c1d8e2be141f8a3fbc9c4cae8ffcb305d0fdab5a1f630): Bind for 0.0.0.0:443 faCreating mattermost-docker_db_1 ... done

ERROR: for web Cannot start service web: driver failed programming external connectivity on endpoint mattermost-docker_web_1 (a210daeda9eb7f3df79c1d8e2be141f8a3fbc9c4cae8ffcb305d0fdab5a1f630): Bind for 0.0.0.0:443 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

```

so I did

```
root@Ubuntu18:~/mattermost-docker# sudo lsof -i -P -n | grep LISTEN
sshd 959 root 3u IPv4 18822 0t0 TCP *:22 (LISTEN)
sshd 959 root 4u IPv6 18829 0t0 TCP *:22 (LISTEN)
docker-pr 1688 root 4u IPv6 3748819 0t0 TCP *:443 (LISTEN)
docker-pr 1699 root 4u IPv6 3748846 0t0 TCP *:80 (LISTEN)
systemd-r 8636 systemd-resolve 13u IPv4 3181490 0t0 TCP 127.0.0.53:53 (LISTEN)

```

and

```
root@Ubuntu18:~/mattermost-docker# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0148a95a2c09 mattermost-docker_db "/entrypoint.sh post…" 6 minutes ago Up 6 minutes (healthy) 5432/tcp mattermost-docker_db_1
4ec918f2efa8 mattermost-docker_app "/entrypoint.sh matt…" 6 minutes ago Up 6 minutes (healthy) 8000/tcp mattermost-docker_app_1
c447e7f705b5 local_discourse/app "/sbin/boot" 3 weeks ago Up 3 weeks 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp app

```

telling me that discourse is already using 443.

So the solution is a proxy but somewhere in the docs, it was mentioned that SSO is incompatible with running behind a proxy. Is that still true or any other side effects of running behind a proxy?  
I cannot find anything anymore.

Instead, I find good tutorials explaining how to run behind a proxy.  
[https://docs.mattermost.com/install/config-proxy-nginx.html](https://docs.mattermost.com/install/config-proxy-nginx.html)  
…/outbound-proxy.html  
I’m supposed to do this changes before doing `~/mattermost-docker# docker-compose up -d`?

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [October 7, 2019, 6:23am UTC](https://forum.mattermost.com/t/installing-mm-on-a-machine-where-443-is-used/8239/2 "2019-10-07T06:23:41Z")

</div>

Hi there, @PackElend

Before I dig deeper into this, I would like to verify the documentation stating that SSO is incompatible running behind a proxy. Can you please share it here so we can have it reviewed? I just want to know if it only applies to older versions of Mattermost or rather an ongoing issue that needs to be fixed.

Meanwhile, the article did not explicitly provide information on when the changes needs to be done but since it involves changing the information in `docker-compose.yml` file, I believe that it needs to be done before running the `docker-compose up` command.

---

<div class="post-metadata">

**Author:** ![PackElend](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/packelend/32/3261_2.png) [@PackElend](https://forum.mattermost.com/u/PackElend)\
**Post date:** [October 7, 2019, 7:11am UTC](https://forum.mattermost.com/t/installing-mm-on-a-machine-where-443-is-used/8239/3 "2019-10-07T07:11:46Z")

</div>

> [@ahmaddanial](#):
>
> Can you please share it here so we can have it reviewed?

Had been searching for an hour for this without success before I started this topic. I’ll continue and will share when I find it.

---

<div class="post-metadata">

**Author:** ![PackElend](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/packelend/32/3261_2.png) [@PackElend](https://forum.mattermost.com/u/PackElend)\
**Post date:** [October 11, 2019, 6:43pm UTC](https://forum.mattermost.com/t/installing-mm-on-a-machine-where-443-is-used/8239/4 "2019-10-11T18:43:20Z")

</div>

Hoi,  
may we able to solve it as I have found something.

I definitely read [Authentication options outside of a private network](https://docs.mattermost.com/overview/auth.html#authentication-options-outside-of-a-private-network) but that is not was concerns me. It is rather the point where I started (I reckon so).

I assume that I found something in the docs related to the combination of docker, proxy configuration, redirect and full authentication. I searched everywhere yesterday but only found:

- [MM-4576 - Mattermost generates wrong redirect uri for GitLab SSO authentication](https://mattermost.atlassian.net/browse/MM-4576)

- [Wrong Redirections with Mattermost Gitlab SSO / oauth](https://gitlab.com/gitlab-org/gitlab-mattermost/issues/109)

- [Mattermost generates wrong redirect uri for SSO authentication #3944](https://github.com/mattermost/mattermost-server/issues/3944#)

- [Use URL subdirectory instead of port](https://forum.mattermost.com/t/use-url-subdirectory-instead-of-port/4361)

So my question is.

If I use one out of following proxies

1. [http://www.haproxy.org/](http://www.haproxy.org/)
2. [https://www.envoyproxy.io/](https://www.envoyproxy.io/)
3. [https://traefik.io/](https://traefik.io/)

deployed via independent docker images. Will this have any impact on the functionality on MM?  
According to [MatterMost behind reverse proxy](https://www.reddit.com/r/linuxadmin/comments/818r6v/mattermost_behind_reverse_proxy/?sort=top) it seems to feasible.

* * *

Just thinking out loud about sockets, as I properly read to much about it. Moreover, as I use this approach on my private server.

Would be there any advantage, running WebSocket over UNIX sockets as UNIX sockets are subject to file system permissions what is easier to manage from an administrator perspective of view.

I don’t think it currently possible. It looks that you can expose UNIX Sockets in Docker ([Can docker port forward to a unix file socket on the host container?](https://stackoverflow.com/questions/24956322/can-docker-port-forward-to-a-unix-file-socket-on-the-host-container) & [Use Unix sockets with Docker](https://www.jujens.eu/posts/en/2017/Feb/15/docker-unix-socket/)). It seems supported by some solutions [WebSocket over AF\_UNIX socket](https://stackoverflow.com/questions/23733152/websocket-over-af-unix-socket) but may not by all browser although there is quite an old [Mozilla discussion](https://groups.google.com/forum/#!topic/mozilla.dev.b2g/_0PaKyrUxFg).  
Ensuring that anyone reading this has the same understanding, these things are well explained on:

- [WebSocket Vs Socket.Io](https://www.educba.com/websocket-vs-socket-io)
- [What’s the difference between Unix socket and TCP/IP socket?](https://serverfault.com/questions/124517/whats-the-difference-between-unix-socket-and-tcp-ip-socket)
- [Differences between TCP sockets and web sockets, one more time [duplicate]](https://stackoverflow.com/questions/16945345/differences-between-tcp-sockets-and-web-sockets-one-more-time)

* * *

thx

stefan

---

<div class="post-metadata">

**Author:** ![PackElend](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/packelend/32/3261_2.png) [@PackElend](https://forum.mattermost.com/u/PackElend)\
**Post date:** [January 13, 2020, 8:24am UTC](https://forum.mattermost.com/t/installing-mm-on-a-machine-where-443-is-used/8239/5 "2020-01-13T08:24:34Z")

</div>

I’m running now Mattermost behing Traefik v2.  
It is running with default settings but some questions are open, see [Alternative reverse proxy - Traefik v2](https://forum.mattermost.com/t/alternative-reverse-proxy-traefik-v2/8796)
