Mattermost
Secure collaboration platform for mission-critical work
Mattermost is a collaboration platform for mission-critical work that accelerates workflow by integrating people, processes, tools and AI infrastructure on a resilient and adaptable platform. The official Docker deployment solution provides enterprise-ready team messaging with extensive customization options.
References
- Home: Mattermost | Collaboration Platform for Mission Critical Work
- Source: GitHub - mattermost/docker: Install Mattermost server via Docker
- Docs: Deploy Mattermost using Containers | Mattermost Documentation
Additional resources
- Official Documentation: Mattermost Documentation
- Docker Deployment Guide: Deploy Mattermost using Containers | Mattermost Documentation
- GitHub Repository: GitHub - mattermost/docker: Install Mattermost server via Docker
- Community Forum: Mattermost Discussion Forums - Discussion forums for Mattermost and our open source community
TODO
TODO: Configure S3-compatible storage (MinIO) for file uploads TODO: Set up GitLab SSO integration (requires mounting PKI chain) TODO: Configure SMTP settings for email notifications TODO: Set up Prometheus metrics endpoint for monitoring TODO: Review and configure Mattermost Calls settings for audio/video
Deployment Guide
Mattermost is a secure collaboration platform for mission-critical work that provides enterprise-ready team messaging with extensive customization options.
Prerequisites
Before deploying Mattermost, ensure the following services are running:
- PostgreSQL - Database backend (deployed via
docker/database/postgresql/postgresql.yaml) - Traefik - Reverse proxy for HTTPS access
Database Setup
Mattermost requires its own database within the PostgreSQL instance. Create the database and user before starting Mattermost:
Step 1: Access PostgreSQL Container
Step 2: Create Mattermost Database and User
Environment Configuration
Add the following variables to your
config/docker/<hostname>/.env.mattermost file:
Important: Use the same password you set when creating the PostgreSQL user.
Deployment
Deploy Mattermost using the standard workflow:
Initial Setup
- Access Mattermost at:
https://mattermost.${MYDOMAIN}/ - Create the first admin account during initial setup
- Configure team settings and channels as needed
Configuration
File Permissions
Mattermost container runs as UID/GID 2000. If you encounter permission issues:
Site URL
The site URL is automatically configured via the MM_SERVICESETTINGS_SITEURL environment variable to match your domain.
SMTP Configuration
To enable email notifications, add the following environment variables to the compose file:
S3 Storage (MinIO Integration)
To use MinIO for file uploads instead of local storage:
GitLab SSO
To enable GitLab SSO integration, mount the PKI chain and configure OAuth settings:
Then configure GitLab OAuth in Mattermost System Console.
Monitoring
Health Check
Check if Mattermost is running:
View Logs
Prometheus Metrics
Mattermost exposes metrics at /metrics endpoint. Add to your Prometheus configuration:
Troubleshooting
Connection Refused to PostgreSQL
- Ensure PostgreSQL service is running:
docker ps | grep postgresql - Check if database exists:
docker exec -it postgresql psql -U postgres -l - Verify environment variables in
.envfile
Permission Denied Errors
Cannot Access via Browser
- Check Traefik logs:
docker logs traefik - Verify DNS resolution:
nslookup mattermost.${MYDOMAIN} - Check if service is in proxy network:
docker network inspect proxy
Upgrading
To upgrade Mattermost:
- Check release notes: https://docs.mattermost.com/about/mattermost-release-notes.html
- Update image tag in
docker/communication/mattermost/mattermost.yaml - Pull new image and recreate container:
Backup
Mattermost’s shared PostgreSQL database is covered by the host-side
docker/database/postgresql/backup.yaml export. Restore it with this service’s
/config, /data, plugins and index data from the paired B2 application-volume
snapshot. Preserve original config/secrets and database ownership. See the
backup guide for commands, retention and snapshot selection.
Recovery
- Stop the destination Mattermost. Follow
shared PostgreSQL recovery for
its
database-mattermost.dump, required roles and original DB ownership. - Restore
${DOCKER_VOLUMES}/mattermost/{config,data,plugins,client-plugins,bleve-indexes}from the paired application snapshot and recover original config/secrets, database credentials and expected directory ownership. - Start PostgreSQL before the matching Mattermost image; check
/api/v4/system/pingbefore switching clients. Keep outbound notifications and production integrations disconnected on an isolated recovery.
DB and uploaded files are not an atomic capture; verify attachment references and plugin state as part of recovery.
Post-restore check
Check the local system ping, sign in, open a known channel/message and download one existing attachment. Restore the original config/secrets and paired uploads with the database before evaluating missing data.