Video tutorial coming soon.
💬 Setup Mattermost — Self-Hosted Team Messaging
Deploy Mattermost on Ubuntu with Docker — an open-source, self-hosted team messaging platform built as a privacy-respecting alternative to Slack. Channels, direct messages, file sharing, and integrations, entirely on your own infrastructure.
📦 Resources & Setup Scripts
Grab the automated bash script from GitHub to follow along with the video.
Quick Install:
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/communication/mattermost/mattermost-ubuntu.sh
chmod +x mattermost-ubuntu.sh
sudo bash mattermost-ubuntu.sh
Tutorial Steps
1 Download & Run the Script
The script installs Docker, starts the Mattermost stack with a PostgreSQL database, and configures persistent storage for your team's data.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/communication/mattermost/mattermost-ubuntu.sh
chmod +x mattermost-ubuntu.sh
sudo bash mattermost-ubuntu.sh
2 Create Your Admin Account
Open your browser and navigate to Mattermost. On first visit, you will be taken through the setup wizard to create your admin account:
http://<your-server-ip>:8065
3 Create a Team
After login, create your first team and give it a name. A team is a shared workspace where your colleagues communicate. You can create multiple teams for different departments or projects.
4 Invite Team Members
Go to the main menu → Invite People to generate an invitation link or send email invitations. Members can also be added directly via the System Console under User Management. Install the desktop or mobile Mattermost apps for the best experience.
Ports Used
| Port | Purpose |
|---|---|
| 8065 | Mattermost Web & API |
Overview
Mattermost is an open-source, self-hosted team collaboration and messaging platform — the privacy-respecting alternative to Slack. It supports channels, direct messages, threads, file sharing, video calls, and an extensive plugin ecosystem. All messages and files are stored on your own server with no data leaving your infrastructure.
Why Use It
Mattermost is the self-hosted alternative to Slack that eliminates per-seat licensing costs while keeping all communications private on your own infrastructure. At 50 users, Slack Pro costs hundreds per month; Mattermost Community Edition costs nothing beyond server hosting. All messages, files, and call recordings stay on your server — critical for organizations with data residency requirements or that cannot trust third-party collaboration platforms with sensitive discussions.
When You Need It
Who Should Use It
Real Use Cases
Main Features
How to Use After Installation
Security Best Practices
Ports and Firewall Notes
Mattermost listens on port 8065 by default. This must be reverse-proxied to HTTPS on port 443 — never expose 8065 directly. File attachments are stored on the server filesystem or S3 — no additional ports needed. For Mattermost Calls (video/voice), additional UDP ports are required — check the Calls plugin documentation for the current port list. Push notifications connect outbound to Mattermost's hosted proxy or your own self-hosted push server.
Backup and Maintenance
Common Mistakes
Troubleshooting
Alternatives
Slack is the dominant SaaS alternative — better integrations, more polished mobile apps, broader ecosystem, at per-seat cost. Microsoft Teams is better for Microsoft 365 shops with native Office integration. Rocket.Chat is another self-hosted alternative with more features but significantly heavier resource requirements. Element/Matrix is a federated, decentralized alternative better for cross-organization communication. Zulip is a self-hostable alternative with a unique threaded conversation model. Discord is popular for communities but not designed for enterprise workflows.
When Not to Use It
Mattermost requires ongoing maintenance — database updates, plugin compatibility, and security patches need regular attention. If your team is under 10 people and you want minimal IT overhead, Slack's free tier may be simpler. Enterprise features (LDAP, SAML, compliance export) are in the paid Enterprise Edition — Community Edition lacks these. For heavily regulated environments needing certified HIPAA or FedRAMP compliance, verify Mattermost's certifications match your requirements before committing.
Need Help Setting Up Mattermost?
PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.
Frequently Asked Questions
Can Mattermost import our history from Slack?
Yes. Export your Slack workspace data from Slack's admin panel, then import via System Console > Site Configuration > Import. This migrates channels, messages, users, and files. Some Slack-specific features may not transfer perfectly. Run a test import on a non-production instance first to preview the result before migrating your real team.
Is Mattermost suitable for external customer communication?
Mattermost is primarily designed for internal team communication. For external users you can create guest accounts, but it requires them to register on your server. For customer-facing support chat, tools like Chatwoot are better suited. Mattermost works well for B2B partner communication where both parties can be set up on the same instance.
Does Mattermost have mobile apps?
Yes. Official iOS and Android apps are available in the App Store and Google Play. Connect them to your self-hosted server by entering your server URL. Push notifications work through Mattermost's hosted push proxy or a self-hosted proxy. The mobile experience covers all core messaging features.
What database does Mattermost require?
Mattermost supports PostgreSQL and MySQL for production. PostgreSQL is recommended for new deployments. SQLite is available for development only — not supported for production and will exhibit data corruption at scale. The official Docker setup uses PostgreSQL by default.
Can Mattermost integrate with Gitea or other self-hosted tools?
Yes. Mattermost has extensive incoming webhook support. Configure an incoming webhook in Mattermost, then add the webhook URL to your Gitea repository's webhook settings. Commit, PR, and issue events trigger channel notifications automatically. Custom slash commands and outgoing webhooks enable bidirectional integration.
How does Mattermost handle file storage?
By default files are stored on the local filesystem. For production, configure Amazon S3 or any S3-compatible storage (MinIO, Backblaze B2) under System Console > Environment > File Storage. S3 storage is recommended as it scales better and simplifies backups — the database backup then covers everything except the file objects.
What is the difference between Community and Enterprise Edition?
Community Edition (free, open source) includes all core messaging — channels, direct messages, webhooks, plugins, and mobile apps. Enterprise adds LDAP/AD, SAML SSO, compliance export, custom terms of service, and advanced analytics. For most self-hosted teams, Community Edition is sufficient. Enterprise is needed for large organizations with SSO and compliance requirements.
Can I use Mattermost for video calls?
Yes, via the Mattermost Calls plugin from the Plugin Marketplace. It supports voice and video calls in the app. For small teams the built-in plugin works well. For larger call volumes, deploy a dedicated rtcd calling server. This requires configuration beyond the base install — check the Calls plugin documentation for the full setup.
