Mattermost
Mattermost is an open-source, self-hosted messaging and collaboration platform for teams. It provides channels, direct messages, file sharing, search, and integrations as a private alternative to hosted chat services, with your data staying on your own infrastructure. The server listens on port 8065.
Software included
Section titled “Software included”| Component | Version |
|---|---|
| Mattermost Team Edition | 11.8.3 |
| PostgreSQL | 18 Alpine |
| Ubuntu | 24.04 LTS |
Environment variables
Section titled “Environment variables”Set these optionally when you deploy from the marketplace. Leave a field blank to have a secure value generated.
| Variable | Description |
|---|---|
DOMAIN | Public domain for Mattermost |
POSTGRES_PASSWORD | PostgreSQL password |
MM_SERVICESETTINGS_SITEURL | Public site URL for Mattermost |
Getting started
Section titled “Getting started”1. Connect to your VM
Section titled “1. Connect to your VM”ssh ubuntu@<your-vm-ip>2. Wait for first-boot configuration
Section titled “2. Wait for first-boot configuration”On first boot, Mattermost generates a database password and starts PostgreSQL, Mattermost, and Nginx as a Docker Compose stack. Track progress with:
sudo journalctl -u mattermost-first-boot.service -fThen verify the stack:
cd /opt/mattermost && docker compose ps3. Access the Mattermost UI
Section titled “3. Access the Mattermost UI”If you set DOMAIN or MM_SERVICESETTINGS_SITEURL at deploy time, point a DNS record for that
hostname at the VM and open it over HTTPS through a reverse proxy that terminates TLS:
https://<your-domain>If you left those unset, reach the VM directly by IP:
http://<your-vm-ip>Complete the setup wizard to create your administrator account. The first account you create becomes the System Administrator. The image does not create shared default login credentials.
Managing Mattermost
Section titled “Managing Mattermost”Mattermost runs as a Docker Compose stack in /opt/mattermost.
# Check statuscd /opt/mattermost && docker compose ps
# Restartcd /opt/mattermost && docker compose restart
# View logscd /opt/mattermost && docker compose logs -f| Path | Purpose |
|---|---|
/opt/mattermost/docker-compose.yml | Compose stack |
/opt/mattermost/.env | Database and Mattermost environment |
/opt/mattermost/volumes/db/ | PostgreSQL data |
/opt/mattermost/volumes/app/mattermost/ | Mattermost config, files, logs, and data |
Security
Section titled “Security”Mattermost is exposed through Nginx on port 80. The application port 8065 stays inside the Docker network. UFW is enabled and allows HTTP (port 80) and SSH (port 22).
To restrict the UI to a specific IP:
sudo ufw delete allow 80/tcpsudo ufw allow from <trusted-ip> to any port 80To access the UI without leaving port 80 open, use an SSH tunnel:
First close the public port on the VM, since it is open by default:
sudo ufw delete allow 80/tcp# Run this on your local machinessh -L 8080:localhost:80 ubuntu@<your-vm-ip>
# Then open in a browserhttp://localhost:8080For production use, place Mattermost behind a reverse proxy with a trusted TLS certificate and set its site URL to your public HTTPS domain.