Why migrating away from Slack is becoming urgent
In 2024, Hack Club received a demand from Slack: $50,000 immediately, then $200,000 per year, or face deletion of eleven years of community history. This is not an isolated case — it is the logic of a vendor that knows your history is a strategic asset, and has made it the lever for its Enterprise plan. Two lock-in mechanisms stack on top of each other. The first is history: on the free and Pro plans, Slack only exposes a sliding window; accessing everything requires Business+ or Enterprise Grid. The second is SSO: connecting via your identity provider (Okta, Azure AD, Google Workspace) is reserved for the Enterprise plan, priced at around $20 per user per month. For a team of fifty, that is $12,000 per year for a feature that Mattermost and Rocket.Chat provide natively from the moment you install them. The real question is therefore not "is Slack good?" — it is — but "at what price are we willing to depend on a vendor to access our own client conversations?".
The concrete benefits of self-hosting your team messaging
- Full message history — all your messages, channels and attached files remain accessible indefinitely at no extra cost.
- Native and free SSO and LDAP — connect your company directory without unlocking an enterprise plan from the vendor.
- Data under your control — client exchanges, contracts discussed in DMs and shared files stay on your infrastructure.
- Predictable cost — a fixed monthly VPS price, not a subscription indexed to your team's growth.
- Custom integrations — webhooks, bots and APIs available without plan restrictions.
- Simplified compliance — configurable retention, on-demand export and audit log to meet legal or contractual requirements.
- Independence from vendor decisions — no surprise pricing changes, no 30-day window to adapt.
Mattermost vs Rocket.Chat vs Slack Enterprise
| Criterion | Mattermost (self-hosted) | Rocket.Chat (self-hosted) | Slack Enterprise Grid |
|---|---|---|---|
| Licence | MIT (server) / Apache 2.0 | AGPL-3.0 | Proprietary |
| Minimum RAM | 2 GB (team < 50) | 4 GB (MongoDB replica set required) | SaaS, no server to manage |
| SSO / SAML / LDAP | Free in self-hosted | Free in self-hosted | ~$20/user/month (Enterprise plan) |
| Full history | Full history, on your disk | Full history, on your disk | Gated behind a paid plan |
| Omnichannel (live chat, email, WhatsApp…) | Limited (community extensions) | Native and complete | No (internal messaging only) |
| Import from Slack | Official tool `mattermost import slack` | Slack import via admin interface | Not applicable |
Server prerequisites before you start
The choice between Mattermost and Rocket.Chat starts at the hardware level. Mattermost uses PostgreSQL and can start with 2 GB of RAM for a team of fewer than fifty — an entry-level VPS is enough for an initial migration. Rocket.Chat relies on MongoDB in replica set mode: even with a single node, the replica set is mandatory from version 6 onwards, which raises the minimum to 4 GB of RAM. On the software side, both require Docker and Docker Compose, a dedicated subdomain (e.g. chat.yourdomain.com) with a valid SSL certificate, and an SMTP server for email notifications and invitations. Open port 443 inbound and verify that WebSocket traffic is not filtered by your firewall or proxy — this is the first blocking point encountered after installation. Finally, plan disk space proportional to the volume of shared files you intend to import: Slack history can weigh several gigabytes if your team regularly shares attachments.
Export your Slack history
Access the export from Slack administration
Log in as a workspace administrator, go to Settings & administration > Workspace settings > Import/Export Data. The Export tab is available on Pro plans and above.
Choose the date range and launch the export
Select "All messages" to export the entire accessible history. Slack generates a ZIP archive containing one JSON file per public channel, user metadata and the channel list. Private channels and DMs are only included if you have a Business+ or Enterprise plan.
Download the archive and verify its contents
Once the export is ready (a few minutes to a few hours depending on volume), download the ZIP file. Unzip it locally and check for the channel folders, the users.json file and channels.json. These three files are what the Mattermost import tool expects.
Transfer the archive to the VPS
Copy the archive to your server with scp slack_export.zip user@your-vps:/opt/mattermost/imports/. Avoid unzipping it server-side before the import — the Mattermost tool works directly on the ZIP.
Deploy Mattermost on a VPS with Docker
Create the folder structure
On the VPS, create the working directory: mkdir -p /opt/mattermost/{config,data,logs,plugins,client/plugins,bleve-indexes,imports}. These folders will be mounted as Docker volumes and will contain the configuration, user data and imported files.
Write the docker-compose.yml
Define two services: postgres (image postgres:15) with a named volume for data, and mattermost (image mattermost/mattermost-team-edition:latest). Connect them via an internal Docker network and mount the five folders created in the previous step. Pass the MM_SQLSETTINGS_DATASOURCE variable pointing to the postgres service. Only expose port 8065 on loopback (127.0.0.1:8065:8065).
Configure the reverse proxy with Caddy
Create a Caddyfile with the following entry: chat.yourdomain.com { reverse_proxy localhost:8065 }. Caddy obtains and renews the Let's Encrypt certificate automatically. Restart Caddy after verifying that the subdomain points to the VPS IP.
Start the stack and create the administrator
Run docker compose up -d, wait about thirty seconds and check the logs with docker compose logs -f mattermost. Open https://chat.yourdomain.com in your browser to create the initial administrator account via the setup wizard.
Configure SMTP and notifications
In System > Notifications > Email, fill in your SMTP server details (host, port, credentials). Send a test email before proceeding: user invitations and message notifications both depend on this configuration.
Enable SSO or LDAP
In System > Authentication, enable LDAP or SAML according to your directory. Both are available free of charge in self-hosted mode, with no plan restrictions. Test the connection with a service account before inviting your users.
Import the Slack history into Mattermost
Prepare the import with the official tool
The mattermost import slack tool is built into the Mattermost binary. From the Docker container, run: docker compose exec mattermost mattermost import slack /mattermost/imports/slack_export.zip --team yourteamname. The tool converts the Slack JSON format into Mattermost Bulk Import format and reports any incompatibilities.
Run the Bulk Import
Once the conversion is done, Mattermost generates a JSONL import file. Run the actual import with docker compose exec mattermost mattermost import bulk /mattermost/imports/mattermost_import.jsonl --workers 1. The --workers 1 option avoids write conflicts on moderately sized databases.
Verify the imported channels and users
Once the import is complete, log in to the Mattermost interface and verify that public channels appear in the team, that historical messages are visible with the correct authors, and that imported users can log in (they will receive an invitation email to set their password).
Handle missing attachments
The standard Slack export does not include attached files on plans below Business+. If attachments are missing, messages appear with broken links. Document the affected channels and inform your users: critical files will need to be re-attached manually.
Alternative: Rocket.Chat for unified customer support
If your need goes beyond internal messaging and includes real-time customer support, Rocket.Chat is a consistent choice in the open-source space. Its omnichannel module allows you to centralize in a single interface conversations from a live chat widget on your site, incoming emails, WhatsApp Business messages and Telegram channels. Support agents see a unified ticket queue, with the full history of each contact. This positioning clearly distinguishes the two tools: Mattermost is a structured team messaging platform, close to Slack in its use cases; Rocket.Chat is a communication platform that also absorbs external client channels. The trade-off is increased installation complexity — the MongoDB replica set is mandatory, the minimum resource requirements are higher, and the omnichannel configuration requires careful routing and agent setup. For an agency that manages client exchanges and wants to consolidate internal messaging and support on a single platform, Rocket.Chat is the natural candidate. For a technical team simply looking to replace Slack without additional complexity, Mattermost is the most direct path.
SSO and authentication: make the most of self-hosting
When self-hosted, LDAP, SAML 2.0 and client certificate authentication are available without plan restrictions or extra cost. Configure the connection to your directory (Active Directory, FreeIPA, or your cloud identity provider) from the start so your users do not have to manage an additional account. Also enable two-factor authentication (TOTP) in the security settings — both Mattermost and Rocket.Chat include it natively. If you route through an authentication proxy such as Authelia or Authentik, verify that your reverse proxy correctly forwards the X-Forwarded-For and X-Real-IP headers before enforcing external authentication.
Troubleshooting: the most common errors
Four problems come up regularly after a successful installation. The first concerns MongoDB and Rocket.Chat: if the container starts and then stops with MongoServerError: not master, the replica set has not been initialized. Connect to the MongoDB shell with docker compose exec mongodb mongosh and run rs.initiate() — once only, on first start. The second problem affects WebSockets: if Mattermost repeatedly shows "WebSocket connection lost", check that your reverse proxy forwards the Upgrade and Connection headers. With Caddy this is automatic; with Nginx, add proxy_http_version 1.1, proxy_set_header Upgrade $http_upgrade and proxy_set_header Connection upgrade in your location block. The third concerns mobile notifications: the Mattermost iOS and Android apps connect by default to the Mattermost Inc. push notification service. If your security policy prohibits this, compile your own push server or disable mobile notifications in the system settings. The fourth is SMTP-related: a test email that works but invitations that never arrive usually indicates an SPF or DKIM problem on your sender domain. Check your DNS records and test delivery with mail-tester.com before migrating your users.