Mattermost
Open source Slack alternative for team messaging.
Overview
Mattermost is an open-source collaboration platform designed as a self-hosted alternative to proprietary team messaging solutions like Slack and Microsoft Teams. Originally developed by SpinPunch in 2016, Mattermost has evolved into a comprehensive workspace platform that prioritizes data sovereignty, security, and customization for organizations that need full control over their communications infrastructure. The platform offers real-time messaging, file sharing, integrations, and workflow automation while maintaining enterprise-grade security features and compliance capabilities. This stack combines Mattermost Team Edition with PostgreSQL 16, creating a robust foundation for team collaboration. PostgreSQL serves as Mattermost's primary data store, handling user accounts, channel data, message history, file metadata, and application configuration with ACID compliance and excellent performance characteristics. The integration between these components leverages PostgreSQL's advanced indexing and full-text search capabilities to provide fast message retrieval and search functionality across large message archives. Organizations choosing this combination benefit from a completely self-hosted communication platform that scales from small teams to enterprise deployments with thousands of users. This stack is particularly valuable for companies in regulated industries, development teams requiring extensive integrations, and organizations prioritizing data privacy and security. The PostgreSQL backend ensures reliable data persistence and supports advanced features like message threading, custom emoji, and plugin data storage while maintaining the performance needed for real-time messaging at scale.
Key Features
- Real-time messaging with WebSocket connections supporting unlimited message history and file attachments up to configurable size limits
- Advanced search functionality powered by PostgreSQL's full-text search capabilities with message indexing and ranking
- Extensive plugin ecosystem with over 100 integrations including GitHub, GitLab, Jira, Jenkins, and custom webhook support
- Built-in Playbooks feature for incident response and process automation with customizable workflows and checklists
- Integrated Kanban boards for project management with card-based organization and team collaboration
- Voice and video calling capabilities through the included Calls plugin with screen sharing and recording options
- Multi-team architecture allowing single Mattermost instance to host multiple isolated team workspaces
- LDAP/SAML integration support with PostgreSQL storing authentication mappings and user session management
Common Use Cases
- 1Software development teams needing integrated chat with code repositories, CI/CD pipelines, and issue tracking systems
- 2Healthcare organizations requiring HIPAA-compliant messaging with full data control and audit trails
- 3Financial institutions needing secure internal communications with compliance reporting and data retention policies
- 4Remote-first companies building comprehensive digital workspaces with persistent chat history and searchable knowledge bases
- 5DevOps teams coordinating incident response through automated playbooks and integrated monitoring alerts
- 6Educational institutions providing secure student and faculty collaboration platforms with controlled access
- 7Government agencies requiring on-premises messaging solutions with stringent security and data sovereignty requirements
Prerequisites
- Docker host with minimum 2GB RAM (4GB+ recommended for teams over 50 users) to support Mattermost and PostgreSQL memory requirements
- Available port 8065 for Mattermost web interface access and API endpoints
- Basic understanding of environment variable configuration for database connection strings and authentication settings
- SSL certificate and reverse proxy knowledge for production deployments requiring HTTPS and custom domains
- PostgreSQL administration familiarity for backup procedures, performance tuning, and database maintenance tasks
- Network configuration knowledge for firewall rules, especially if integrating with external services like LDAP or SAML providers
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 mattermost: 3 image: mattermost/mattermost-team-edition:latest4 container_name: mattermost5 restart: unless-stopped6 environment: 7 MM_SQLSETTINGS_DRIVERNAME: postgres8 MM_SQLSETTINGS_DATASOURCE: postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}?sslmode=disable9 volumes: 10 - mattermost_data:/mattermost/data11 - mattermost_logs:/mattermost/logs12 - mattermost_config:/mattermost/config13 - mattermost_plugins:/mattermost/plugins14 ports: 15 - "8065:8065"16 depends_on: 17 - postgres18 networks: 19 - mattermost2021 postgres: 22 image: postgres:16-alpine23 container_name: mattermost-postgres24 environment: 25 POSTGRES_DB: ${DB_NAME}26 POSTGRES_USER: ${DB_USER}27 POSTGRES_PASSWORD: ${DB_PASSWORD}28 volumes: 29 - postgres_data:/var/lib/postgresql/data30 networks: 31 - mattermost3233volumes: 34 mattermost_data: 35 mattermost_logs: 36 mattermost_config: 37 mattermost_plugins: 38 postgres_data: 3940networks: 41 mattermost: 42 driver: bridge.env Template
.env
1DB_NAME=mattermost2DB_USER=mattermost3DB_PASSWORD=changemeUsage Notes
- 1Docs: https://docs.mattermost.com/
- 2Access at http://localhost:8065 - create first team and admin user
- 3Desktop/mobile apps for Windows, macOS, Linux, iOS, Android
- 4Integrations: GitHub, GitLab, Jira, Jenkins, and 100+ more via plugins
- 5Playbooks for incident response and process automation
- 6Boards (Kanban) and Calls (video/voice) included in Team edition
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
mattermost
mattermost:
image: mattermost/mattermost-team-edition:latest
container_name: mattermost
restart: unless-stopped
environment:
MM_SQLSETTINGS_DRIVERNAME: postgres
MM_SQLSETTINGS_DATASOURCE: postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}?sslmode=disable
volumes:
- mattermost_data:/mattermost/data
- mattermost_logs:/mattermost/logs
- mattermost_config:/mattermost/config
- mattermost_plugins:/mattermost/plugins
ports:
- "8065:8065"
depends_on:
- postgres
networks:
- mattermost
postgres
postgres:
image: postgres:16-alpine
container_name: mattermost-postgres
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- mattermost
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 mattermost:5 image: mattermost/mattermost-team-edition:latest6 container_name: mattermost7 restart: unless-stopped8 environment:9 MM_SQLSETTINGS_DRIVERNAME: postgres10 MM_SQLSETTINGS_DATASOURCE: postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}?sslmode=disable11 volumes:12 - mattermost_data:/mattermost/data13 - mattermost_logs:/mattermost/logs14 - mattermost_config:/mattermost/config15 - mattermost_plugins:/mattermost/plugins16 ports:17 - "8065:8065"18 depends_on:19 - postgres20 networks:21 - mattermost2223 postgres:24 image: postgres:16-alpine25 container_name: mattermost-postgres26 environment:27 POSTGRES_DB: ${DB_NAME}28 POSTGRES_USER: ${DB_USER}29 POSTGRES_PASSWORD: ${DB_PASSWORD}30 volumes:31 - postgres_data:/var/lib/postgresql/data32 networks:33 - mattermost3435volumes:36 mattermost_data:37 mattermost_logs:38 mattermost_config:39 mattermost_plugins:40 postgres_data:4142networks:43 mattermost:44 driver: bridge45EOF4647# 2. Create the .env file48cat > .env << 'EOF'49DB_NAME=mattermost50DB_USER=mattermost51DB_PASSWORD=changeme52EOF5354# 3. Start the services55docker compose up -d5657# 4. View logs58docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/mattermost/run | bashTroubleshooting
- Mattermost fails to start with database connection errors: Verify PostgreSQL container is running and MM_SQLSETTINGS_DATASOURCE environment variable matches database credentials exactly
- Users cannot upload files or attachments appear broken: Check mattermost_data volume permissions and ensure sufficient disk space for file storage requirements
- Search functionality returns incomplete results: PostgreSQL may need additional memory allocation or search indexing configuration in Mattermost system console
- Plugin installations fail or plugins don't load: Verify mattermost_plugins volume is writable and enable plugin uploads in system console under Plugin Management
- Performance degrades with message history growth: Implement PostgreSQL data retention policies and consider message archiving through Mattermost's data retention features
- LDAP/SAML authentication fails after setup: Check Mattermost logs for certificate validation errors and ensure network connectivity to authentication providers
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Ad Space
Shortcuts: C CopyF FavoriteD Download