Deploy Mattermost
Open-source team chat with channels, threads and file sharing
Mattermost
Just deployed
/mattermost/data
Just deployed
/var/lib/postgresql/data
Deploy and Host Mattermost on Railway
Mattermost is an open-source team chat platform, an alternative to Slack and Microsoft Teams. It offers public and private channels, threads, direct messages, file sharing, search, and integrations through webhooks, bots and plugins. Teams self-host it to keep their conversations and files on infrastructure they control.
About Hosting Mattermost
Hosting Mattermost needs the Mattermost server, a PostgreSQL database and persistent storage for uploaded files and plugins. This template deploys Mattermost Team Edition 12.0.2, built from a public GitHub repository that pins the official image by digest, next to Railway PostgreSQL. A volume at /mattermost/data keeps files, plugins, logs and search indexes, and Mattermost stores its own settings in Postgres, so System Console changes survive redeploys. The Site URL comes from the Railway domain. Open the URL right after deploying and create your account: the first account becomes the system admin, and later users join by invitation.
Common Use Cases
- Private team chat for companies that want their messages on their own infrastructure
- Engineering and DevOps channels with webhooks and bots for alerts, CI and incident response
- Community or project workspaces with public channels, threads and file sharing
Dependencies for Mattermost Hosting
- PostgreSQL (Railway Postgres, included)
- A persistent volume for uploaded files and plugins (included)
Deployment Dependencies
Implementation Details
The official image has no shell, so the repository adds a pinned static busybox to run a short start script. It converts Railway's DATABASE_URL into the form Mattermost expects, listens on PORT (8065), fixes the volume's ownership once and then runs Mattermost as its own user, not root. The health check is /api/v4/system/ping.
Email is not configured. To send notifications and password-reset emails, set SMTP in System Console → Environment → SMTP. When you add a custom domain, change MM_SERVICESETTINGS_SITEURL to https://YOUR-DOMAIN. Any other setting can be set as an MM_SECTION_SETTING variable. Version updates arrive through the repository: read its CHANGELOG and back up Postgres before applying one.
Why Deploy Mattermost on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Mattermost on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
