Network ports and outbound proxy
Open the ports Mattermost needs before you install, and note the outbound destinations your deployment will reach. If your environment blocks direct outbound access, configure an outbound proxy at the same time.
Network ports
The following table outlines the network ports and protocols required for Mattermost server:
| Service Name | Config Setting | Port (default) | Protocol | Direction | Info |
|---|---|---|---|---|---|
| HTTP/Websocket | ServiceSettings.ListenAddress | 8065/80/443 (TLS) | TCP | Inbound | External (no proxy) / Internal (with proxy) Usually this requires port 80 and 443 when running HTTPS. |
| Cluster | ClusterSettings.GossipPort | 8074 | TCP/UDP | Inbound | Internal |
| Metrics | MetricsSettings.ListenAddress | 8067 | TCP | Inbound | External (no proxy) / Internal (with proxy) |
| Database | SqlSettings.DataSource | 5432 (PostgreSQL) / 3306 (MySQL) | TCP | Outbound | Usually internal (recommended) |
| LDAP | LdapSettings.LdapPort | 389 | TCP/UDP | Outbound | |
| S3 Storage | FileSettings.AmazonS3Endpoint | 443 (TLS) | TCP | Outbound | |
| SMTP | EmailSettings.SMTPPort | 10025 | TCP/UDP | Outbound | |
| Push Notifications | EmailSettings.PushNotificationServer | 443 (TLS) | TCP | Outbound |
Only the inbound ports your readers actually reach need to be exposed externally. When Mattermost runs behind an NGINX reverse proxy, expose 80 and 443 at the proxy and keep 8065, 8067, and 8074 internal.
Outbound proxy configuration
If your deployment requires using an outbound proxy, you can configure Mattermost using environment variables:
-
Configure the proxy settings in your service configuration:
Environment=HTTP_PROXY=http://proxy.example.com:3128Environment=HTTPS_PROXY=https://proxy.example.com:3128Environment=NO_PROXY=localhost,127.0.0.1,.internal.example.comThese lines go in the
[Service]section of themattermost.servicesystemd unit. See your install method's page for the complete unit file: Ubuntu/Debian, RHEL, or manual tarball. -
For authenticated proxies, include credentials in the URL:
Environment=HTTP_PROXY=http://username:password@proxy.example.com:3128Environment=HTTPS_PROXY=https://username:password@proxy.example.com:3128Anyone who can read the unit file can read these credentials. Restrict the file's permissions, or supply the values through a separate
EnvironmentFilethat only root can read. -
The
NO_PROXYvariable can include:- IP addresses (e.g.,
1.2.3.4) - CIDR ranges (e.g.,
1.2.3.4/8) - Domain names (e.g.,
example.com) - Subdomains (e.g.,
.example.com)
- IP addresses (e.g.,
Next steps
- Set up an NGINX proxy and set up TLS so users connect over HTTPS.
- Return to the preparation checklist.