A chat server for a dozen people is a weekend of code: channels, direct messages, threads, file uploads, search and a WebSocket layer, and an agent can write it on SQLite in a single binary. But Mattermost's own free Team Edition and Entry mode already give a small team that, so building your own only makes sense if you want something much smaller. The paid part is what a one-prompt build doesn't reproduce: SSO through SAML, OpenID Connect or LDAP, advanced permissions, native phone apps with push, a support contract, and a vendor patching security holes. Phone notifications are the biggest gap.
Before you buildMattermost Team Edition and the free Entry mode run the real product for nothing. Unless you need something smaller, install one of those before building.
Build me a small self-hosted team chat to replace Mattermost Professional for up to 15 people. Requirements:
- Go 1.23: one binary using net/http, `github.com/coder/websocket` and `modernc.org/sqlite`
(no CGO), with the web UI embedded through `embed`. `./chat` serves http://localhost:8065;
PUBLIC_URL, SESSION_SECRET and SMTP_* go in .env.
- Storage: ./data/chat.db with users, channels (public, private, direct), memberships, messages
with a thread_id, reactions, read markers and an FTS5 table over message text. Uploads go to
./data/files/ with a 25 MB cap per file.
- Chat: channels, direct messages, threaded replies, @mentions, emoji reactions, editing and
deleting your own messages, unread badges, and live updates over one WebSocket per tab that
reconnects and catches up from the last seen message ID.
- Search: a box backed by FTS5 with filters such as `from:ann in:ops after:2026-01-01`.
- Sign-in: email invitations with a one-time link, Argon2id passwords (`golang.org/x/crypto/argon2`),
and optional OpenID Connect (`coreos/go-oidc`) when OIDC_ISSUER is set. The first user is the
admin and can deactivate users and archive channels.
- ChatOps: one incoming webhook per channel (POST /hooks/<token> with JSON {"text": "..."}) and
a /poll slash command; the README shows how to post from a CI job with curl.
- Notifications: browser Web Push (`github.com/SherClockHolmes/webpush-go`) for mentions and DMs.
- `./chat backup out.db` writes a consistent SQLite backup. No telemetry, local-first; outbound
calls go only to SMTP, your OIDC provider and push services.
- Out of scope: phone apps, voice and video calls, LDAP and SAML, compliance exports, boards, playbooks.
- README: running behind Caddy or nginx with HTTPS, and a warning that Web Push needs HTTPS and
reaches iPhones only after the site is added to the home screen.Opens your agent with the prompt filled in, you press enter. Or copy it and paste it into an empty folder.
The first prompt builds the core. Run these one at a time in the same folder to grow it into your own Mattermost Professional.
Extend the team chat in this folder. Requirements: - A per-channel retention setting (keep forever, 90 days, 1 year) enforced by a nightly job that deletes expired messages and their uploads. - An admin-only `./chat export --channel ops out.jsonl` command that writes one JSON object per message with author, timestamp, thread_id, reactions and file names. - Log every purge to ./data/purge.log. - Update the README.
Extend the incoming webhooks of the team chat in this folder. Requirements:
- Recognize GitHub push, pull_request and workflow_run payloads (verify X-Hub-Signature-256 with
a secret per webhook) and render each as one compact message with links.
- Fall back to the plain {"text": "..."} format for everything else.
- Show the last 20 deliveries and their status in the admin page.
- Update the README with a GitHub setup walkthrough.Add announcement channels to the team chat in this folder. Requirements: - A channel flag `read_only`: only admins and listed posters can post, everyone else can read and react. - Show a banner at the top of the app with the latest announcement until each person dismisses it. - Enforce the rule on the server, including for webhooks and the WebSocket path. - Add tests for every posting path. - Update the README.
Add a /handoff slash command to the team chat in this folder. Requirements: - `/handoff` opens a small form with three fields (open incidents, watch items, notes) and posts the result as a formatted message in the current channel. - Pin the latest handoff in each channel and show it at the top. - Keep handoffs searchable through the existing FTS5 index. - Update the README.
Teams that must keep chat on their own servers pay for the parts around the chat window: sign-in through the company directory, permissions that match the org chart, phone apps that just work, and a vendor to call when an upgrade breaks. Once ten or more people depend on it, running a home-built chat server becomes someone's job.
Estimate · A $5 to $12 VPS plus free-tier SMTP. The build is token usage on your agent plan. For comparison, 11 Professional seats at the third-party $10 figure come to $110 a month.
Checked 2026-10-19 against Mattermost Professional's docs: 1, 2, 3, 4, 5, 6
| Plan | Monthly | Annual, per month | What you get |
|---|---|---|---|
| Entry | $0 | $0 | Self-hosted, all Enterprise Advanced features within caps: 10,000 messages of history across all channels, 1,000 board cards, 5 playbook runs a month, 250 agent queries a month, 40-minute calls. Community support only. |
| Professional | — | $10 | Unlimited search history, LDAP, SAML, OpenID Connect and Entra ID sign-in, MFA enforcement, guest access, advanced team permissions, read-only announcement channels, Teams and Jira integrations, bring-your-own-LLM bot, next-business-day ticket support. |
| Enterprise | custom | — | Everything in Professional plus high availability and clustering, compliance exports and retention policies, AD/LDAP group sync, enterprise search, advanced playbooks, 24x7 support with a 4-hour response target. |
| Enterprise Advanced | custom | — | Everything in Enterprise plus air-gapped deployment workflows, zero-trust attribute-based access, classified-information controls, and scaling to 200,000 concurrent users. |
Not answered here? Tell us and we'll add it.
Ask a question ›Entry is the free mode of Mattermost Enterprise Edition: self-hosted, with a cap of 10,000 visible channel messages across all channels.
Kinda. The core is a weekend build with the prompt on this page, but real gaps remain: Native iOS and Android apps with a push proxy, and desktop apps, SAML, OpenID Connect and LDAP single sign-on with user sync.
About $10 a month on the Professional plan per seat, $120 a year (checked 2026-10-19).
Native iOS and Android apps with a push proxy, and desktop apps; SAML, OpenID Connect and LDAP single sign-on with user sync; Advanced team permissions, guest access and read-only announcement channels; Boards, playbooks and the Jira, GitHub, GitLab and Teams integrations; Vendor security patches and next-business-day support. If any of those matter to you, keep paying.
Yes: Mattermost Team Edition (open source), Zulip (open source), Rocket.Chat (open source).