Mattermost

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

38.3Kstars
8.8Kforks
Custom / Unknown
TypeScript

Mattermost is an open core, self-hosted collaboration platform built for teams that require absolute control over their communication infrastructure. Written in Go and React, it compiles to a single Linux binary backed by PostgreSQL, and can be deployed via Docker, Kubernetes, Helm, or native packages on Ubuntu, Debian, and RHEL. It is designed to replace Slack and Microsoft Teams for organizations with strict data sovereignty, compliance, or air-gap requirements.

The platform covers the full range of modern team communication: persistent channels, threaded messaging, direct and group messages, in-app voice calling and screen sharing, file sharing, emoji reactions, and rich notifications across web, desktop, and mobile. A plugin system running in isolated RPC processes extends the platform with hundreds of third-party integrations available through the Mattermost Marketplace, from Jira and GitHub to Zoom and Salesforce.

AI capabilities are delivered through a bridge API connecting the server to the mattermost-plugin-ai plugin, enabling thread summarization, message rewriting, auto-translation, and custom AI agents. Cross-organization collaboration is supported through Shared Channels — a federated sync layer that lets users in different Mattermost deployments communicate in shared channel spaces without merging instances.

The open-source core is licensed under a combination of MIT (compiled binaries), AGPL v3.0 (server source), and Apache 2.0 (templates and web assets). Enterprise features such as LDAP sync, SAML SSO, compliance exports, and high-availability clustering are available through a commercial license, with all enterprise interface boundaries defined as Go interfaces in the einterfaces package to keep the open-source build fully functional without them.

What You Get

  • Self-Hosted Messaging Server - A single Go binary deployable on Docker, Kubernetes, Ubuntu, Debian, or RHEL with PostgreSQL as the only required dependency, giving you complete data ownership.
  • AI Agent Bridge - A versioned bridge API connecting the server to the mattermost-plugin-ai plugin for thread summarization, message rewriting, auto-translation, and custom LLM-backed agents.
  • Plugin Marketplace with 700+ Integrations - Isolated RPC-based plugins for Jira, GitHub, GitLab, Zoom, Salesforce, Okta, and hundreds more, installable from the in-product marketplace without server restarts.
  • In-App Voice Calling and Screen Sharing - Native real-time audio calls and screen share powered by the Calls plugin, eliminating the need to switch to a separate conferencing tool.
  • Cross-Platform Native Apps - Official desktop apps for Windows, macOS, and Linux (Electron-based) and mobile apps for Android and iOS (React Native), with offline support and push notifications.
  • Federated Shared Channels - A Remote Cluster Service that synchronizes channels across separate Mattermost deployments, enabling cross-organization collaboration without merging instances.
  • Role-Based Access Control with SSO - Granular team and channel permissions with SAML 2.0, OAuth 2.0, LDAP, and GitLab/Google SSO support for enterprise identity management.
  • DevOps Workflow Automation - Slash commands, incoming and outgoing webhooks, and a REST API (v4/v5) for integrating CI/CD alerts, deploy notifications, and incident response directly into channels.

Common Use Cases

  • DevSecOps Incident Response - A security team routes PagerDuty alerts and Prometheus firing rules into a dedicated Mattermost channel, uses slash commands to create Jira tickets, and coordinates response with voice calls — all without leaving the platform.
  • Air-Gapped Government or Defense Deployment - A defense contractor deploys Mattermost on an isolated network with no external internet access, using LDAP for identity, SAML for authentication, and custom plugins for classified workflow automation.
  • HIPAA-Compliant Healthcare Communication - A hospital system runs Mattermost on-premises to ensure patient-related messaging never leaves their data center, leveraging compliance export features to satisfy audit requirements.
  • Open Source Community Coordination - A large open source project uses Mattermost as its community server, with public channels for contributors, direct messages for maintainers, and bot integrations that post PR and issue activity from GitHub.

Under The Hood

Architecture Mattermost uses a layered monorepo architecture that cleanly separates HTTP routing, business logic, and data access without tight coupling. The Go server routes requests through gorilla/mux into api4 handlers, which delegate to a request-scoped App struct containing all business logic. The App accesses data exclusively through a well-defined Store interface, implemented by sqlstore and automatically wrapped at compile time with generated timer, retry, search, and cache layers via //go:generate. Enterprise capabilities are abstracted through the einterfaces package — open-source builds compile against stubs while enterprise builds link closed-source modules without modifying core paths. WebSocket events are handled independently via a dedicated wsapi router and WebSocketRouter. The plugin system runs plugins in isolated RPC processes, preventing any single plugin crash from affecting server stability.

Tech Stack Go 1.26 powers the backend with gorilla/mux for HTTP routing, golang-migrate for schema versioning, and PostgreSQL as the only required database. Elasticsearch integration provides optional full-text search with fallback to database search. The React/TypeScript frontend is bundled with Webpack, uses Redux for state management, and publishes its type definitions as the @mattermost/types npm package. Desktop apps are built with Electron and mobile apps with React Native. The AI feature bridge integrates via a versioned plugin API with mattermost-plugin-ai. pgvector is supported for vector similarity workloads. Deployment targets include Docker Compose, Kubernetes via Helm charts, and native packages for Debian/Ubuntu and RHEL.

Code Quality Test coverage is comprehensive across every layer: Go unit tests exist alongside virtually every file in the app and sqlstore packages, Cypress end-to-end tests cover user flows in e2e-tests/cypress, and Playwright tests run in e2e-tests/playwright. Error handling uses the consistent *model.AppError type with embedded HTTP status codes at the API layer, and typed sentinel errors (store.ErrNotFound) at the data layer. TypeScript strict mode is enforced across the web client, ESLint is configured for both Go and TypeScript, and the store layer uses code generation to systematically apply caching, timing, and retry wrappers across all store methods. CI tooling with automated test cycles is evident from Makefile orchestration and test runner scripts.

What Makes It Unique Mattermost’s most technically distinctive contribution is its enterprise capability boundary: the einterfaces package defines Go interfaces for every enterprise feature — LDAP, compliance, metrics, clustering, content scanning — so open-source builds compile cleanly against stub implementations while commercial builds link closed-source modules. Store layer code generation automatically wraps every data access method with instrumentation, caching, and retry, eliminating boilerplate that most projects accumulate manually over years. The versioned AI bridge API decouples the AI plugin’s evolution from server releases, allowing independent iteration. Shared Channels implement a genuine cross-deployment federation layer via a Remote Cluster Service with conflict-free sync semantics, a capability absent from virtually all competing open-source platforms.

Self-Hosting

Mattermost’s licensing is layered and worth understanding precisely. Compiled binaries are released under MIT, meaning you can run them commercially without any copyleft obligation. The server source code is licensed under AGPL v3.0 with exceptions: Mattermost explicitly promises not to enforce AGPL copyleft if your application only uses the Admin Tools and Configuration Files (templates, i18n, public/, webapp/) and has not modified the core server. The web assets and templates are licensed under Apache 2.0 outright. In practice, teams that deploy and operate Mattermost without modifying the server source can do so freely and commercially under the MIT binary license or the AGPL exception. The enterprise source-available code under server/enterprise/ is governed by the Mattermost Source Available License, which permits viewing and contributing but not redistribution or commercial use without a commercial license from Mattermost, Inc.

Operationally, self-hosting Mattermost is within reach for a competent DevOps team but is not trivial at scale. A minimal deployment requires a Linux host, PostgreSQL, and optionally MinIO or S3 for file storage. High availability requires a separate database cluster, load balancing, and shared storage — none of which Mattermost provisions for you. You are responsible for backups, schema migrations (coordinated across versions), TLS termination, push notification relay configuration, and OS-level security patching. The plugin system requires network access to the Mattermost Marketplace for installations; air-gapped deployments must manually install plugin bundles. AI features depend on an external LLM API (OpenAI, Anthropic, or self-hosted) configured via the AI plugin.

Compared to Mattermost Cloud (the managed SaaS offering) or enterprise on-premises with a commercial license, self-hosting the open-source edition means giving up Mattermost-managed high availability, automated minor-version upgrades, 24/7 commercial support, SLA guarantees, and enterprise features including LDAP group sync, SAML SSO, compliance exports (for HIPAA/SOC 2 audit trails), custom data retention policies, advanced permissions, and guest accounts. The commercial license unlocks these features as binary modules loaded at startup, so the operational model is identical — you still run your own infrastructure — but with the enterprise capability set and support entitlements layered on top.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search