Team Communication⭐ 32k+ GitHubLicense: Apache 2.0

How to Self-Host Mattermost with Docker Compose

Open-Source Alternative to: Slack ($8.75/seat/mo)

Mattermost provides an open-source Slack alternative that keeps enterprise conversations, incident response alerts, and internal customer chats behind your company firewall.

MINIMUM HARDWARE
2 GB RAM, 2 vCPU, 50 GB Disk
ESTIMATED SAVINGS
$1,050/year
OFFICIAL REPOSITORY
github.com/mattermost/mattermost ↗

Production Docker Compose File

Copy this tested configuration directly into your server's directory:

🐳 docker-compose.yml
version: '3.8'
services:
  mattermost:
    image: mattermost/mattermost-team-edition:latest
    restart: always
    ports:
      - '8065:8065'
    environment:
      - MM_SQLSETTINGS_DRIVERNAME=postgres
      - MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mostest@db:5432/mattermost?sslmode=disable
  db:
    image: postgres:15-alpine
    environment:
      - POSTGRES_USER=mmuser
      - POSTGRES_PASSWORD=mostest
      - POSTGRES_DB=mattermost
    volumes:
      - mm_db:/var/lib/postgresql/data
volumes:
  mm_db:

Quick Deployment Steps

1. docker compose up -d 2. Navigate to http://localhost:8065 3. Register your primary admin account and invite team members.

Key Advantages & Trade-Offs

✓ Why Self-Host Mattermost?

  • Slack-identical keyboard shortcuts and markdown formatting
  • Unlimited searchable message history without 90-day archive walls
  • End-to-end encrypted audio calls and screen sharing

⚠ What to Keep in Mind

  • Mobile push notifications require either Mattermost HPNS proxy or compiled APNS keys
  • Initial email SMTP setup requires admin config

More Self-Hosted Alternatives

Knowledge & Workspace
AppFlowy
Replaces Notion ($10/seat/mo)
Project Management
Plane
Replaces Jira ($8.50/seat/mo) & Linear
No-Code Database
NocoDB
Replaces Airtable ($20/seat/mo)