Mattermost
Mattermost is an open-source, self-hosted alternative to Slack designed for team collaboration with a focus on security and privacy. It provides persistent chat organized into teams and channels, direct messaging, file sharing, search, and integrations with developer tools. This stack deploys the Mattermost Team Edition application server backed by PostgreSQL 16 for reliable data persistence. Mattermost supports webhooks, slash commands, bots, and a plugin marketplace for extending functionality with integrations like Jira, GitLab, GitHub, and more. Data including uploaded files, plugins, and configuration is persisted across named volumes. After deployment, access the web UI on port 8065 to create your first team and invite members.
Included Services
mattermost
mattermost/mattermost-team-edition:latest
Environment Variables:
postgres
postgres:16-alpine
Environment Variables:
Generated YAML
# Generated by ComposeHub (composehub.dev)
name: mattermost
services:
mattermost:
image: mattermost/mattermost-team-edition:latest
restart: always
ports:
- 8065:8065
volumes:
- mattermost_config:/mattermost/config
- mattermost_data:/mattermost/data
- mattermost_logs:/mattermost/logs
- mattermost_plugins:/mattermost/plugins
- mattermost_client_plugins:/mattermost/client/plugins
- mattermost_bleve:/mattermost/bleve-indexes
environment:
TZ: ${TZ:-UTC}
MM_SQLSETTINGS_DRIVERNAME: postgres
MM_SQLSETTINGS_DATASOURCE: >-
postgres://${POSTGRES_USER:-mattermost}:${POSTGRES_PASSWORD:-changeme}@postgres:5432/${POSTGRES_DB:-mattermost}?sslmode=disable&connect_timeout=10
MM_BLEVESETTINGS_INDEXDIR: /mattermost/bleve-indexes
MM_SERVICESETTINGS_SITEURL: ${MM_SITEURL:-http://localhost:8065}
MM_SERVICESETTINGS_ENABLELOCALMODE: ${MM_ENABLE_LOCAL_MODE:-false}
networks:
- mattermost
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
- CMD-SHELL
- curl -f http://localhost:8065/api/v4/system/ping || exit 1
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
deploy:
resources:
limits:
cpus: "2.00"
memory: 1024M
reservations:
cpus: "0.50"
memory: 256M
labels:
com.composehub.description: Mattermost Team Edition application server
postgres:
image: postgres:16-alpine
restart: always
volumes:
- mattermost_db:/var/lib/postgresql/data
environment:
POSTGRES_DB: ${POSTGRES_DB:-mattermost}
POSTGRES_USER: ${POSTGRES_USER:-mattermost}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
networks:
- mattermost
healthcheck:
test:
- CMD-SHELL
- pg_isready -U ${POSTGRES_USER:-mattermost} -d ${POSTGRES_DB:-mattermost}
interval: 5s
timeout: 5s
retries: 10
start_period: 30s
deploy:
resources:
limits:
cpus: "1.00"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M
labels:
com.composehub.description: PostgreSQL 16 database for Mattermost
networks:
mattermost:
driver: bridge
volumes:
mattermost_db:
driver: local
mattermost_config:
driver: local
mattermost_data:
driver: local
mattermost_logs:
driver: local
mattermost_plugins:
driver: local
mattermost_client_plugins:
driver: local
mattermost_bleve:
driver: local
Quick Info
- Services
- 2
- Networks
- 1
- Volumes
- 7
When to Use
This template is ideal for setting up a mattermost environment. All services are pre-configured with healthchecks, resource limits, and sensible defaults. Customize environment variables before deploying to production.
Tips
- Change all default passwords before deploying
- Review resource limits for your hardware
- Add a reverse proxy for production HTTPS
- Configure backup strategies for data volumes