Docs / Self-Hosted Applications / How to Self-Host Mattermost Team Chat

How to Self-Host Mattermost Team Chat

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 27 views · 1 min read

What Is Mattermost?

Mattermost is an open-source team messaging platform. It provides channels, direct messages, file sharing, and integrations — similar to Slack but fully self-hosted.

Requirements

  • A Breeze with at least 2 GB RAM
  • Docker and Docker Compose

Docker Compose Setup

mkdir -p /opt/mattermost && cd /opt/mattermost
cat > docker-compose.yml <<'EOF'
services:
  mattermost:
    image: mattermost/mattermost-team-edition:latest
    restart: unless-stopped
    ports:
      - "8065:8065"
    environment:
      - MM_SQLSETTINGS_DRIVERNAME=postgres
      - MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mmpassword@db:5432/mattermost?sslmode=disable
      - MM_SERVICESETTINGS_SITEURL=https://chat.yourdomain.com
    volumes:
      - mattermost-config:/mattermost/config
      - mattermost-data:/mattermost/data
      - mattermost-logs:/mattermost/logs
      - mattermost-plugins:/mattermost/plugins
    depends_on:
      - db

  db:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      - POSTGRES_USER=mmuser
      - POSTGRES_PASSWORD=mmpassword
      - POSTGRES_DB=mattermost
    volumes:
      - mattermost-db:/var/lib/postgresql/data

volumes:
  mattermost-config:
  mattermost-data:
  mattermost-logs:
  mattermost-plugins:
  mattermost-db:
EOF

docker compose up -d

Set Up and Access

Visit http://your-server:8065 and create your workspace. The first user becomes the System Admin.

Features

  • Public and private channels
  • Direct and group messages
  • File sharing and search
  • Webhook and bot integrations
  • Custom emoji and reactions
  • Desktop, mobile, and web clients
  • LDAP and SAML authentication

Was this article helpful?