Mattermost Operations Runbook
Operational reference for the Mattermost Team Edition deployment that powers Equa team messaging.Infrastructure Overview
Services
Domains
Volumes
Credentials Inventory
Mattermost Admin Account
Admin Bot Account
PostgreSQL
Environment Variables on equa-server
DNS Configuration
DNS is managed in Google Cloud DNS, projectequa-production, zone equa-cc-zone.
Modifying DNS
Monitoring
Health Check
Admin Token Verification
Despite the env var name
MATTERMOST_ADMIN_BOT_TOKEN, this is a personal access token belonging to the equa-admin regular user, not the bot account.Check Teams
Common Operations
Restart Mattermost
Via Railway CLI:View Deployment Logs
Update Mattermost Version
Update the Docker image tag in Railway:Rotate Admin Token
Standard rotation (zero downtime):- Log into Mattermost as
equa-admin(shawn@owenent.com) - Go to Profile > Security > Personal Access Tokens
- Click Create Token, give it a description (e.g.,
Equa session 2026-03) - Copy the new token value
- In Railway (
equa-server-soproject), updateMATTERMOST_ADMIN_BOT_TOKENto the new token - Wait for equa-server to redeploy
- Verify:
POST /api/v1/mattermost/sessionsucceeds - Revoke the old token in Mattermost (Profile > Security > Personal Access Tokens)
- Enable the TCP proxy (see TCP Proxy Management below)
- Connect to the Mattermost database:
- Reset the admin password:
- Log in with the new password, create a new PAT
- Update
MATTERMOST_ADMIN_BOT_TOKENin Railway - Disable the TCP proxy
Full Member Sync
If member state is out of sync between Equa and Mattermost:Mattermost Environment Variables
Key configuration on the Mattermost Railway service:Nginx Reverse Proxy
Mattermost returnsX-Frame-Options: SAMEORIGIN by default, which blocks cross-origin iframe embedding. Since equa-web embeds Mattermost in an iframe, an nginx reverse proxy sits in front of the Mattermost service to strip this header and add permissive Content-Security-Policy: frame-ancestors rules.
Architecture
Configuration
Source:equa-server/infra/mattermost-proxy/
Environment Variables
Deployment
- In the equa-mattermost Railway project, create a new service from
equa-server/infra/mattermost-proxy/ - Set
MATTERMOST_UPSTREAMto the internal Mattermost URL - Move the
chat.equa.cccustom domain from the Mattermost service to the proxy service - The proxy listens on port 8080 (auto-detected from the Dockerfile
EXPOSE)
Verification
TCP Proxy Management
The Mattermost PostgreSQL database has a TCP proxy for emergency direct access.When to Enable
- Password resets for locked-out admin accounts
- Direct role modifications not possible via the API
- Database migration troubleshooting
- One-time data corrections
When to Disable
Disable the TCP proxy whenever it is not actively needed for admin operations.How to Toggle
- Open the equa-mattermost Railway project
- Navigate to the PostgreSQL service
- Go to Settings > Networking > Public Networking
- Toggle the TCP proxy off (disable) or on (enable)
Risk Assessment
Recommendation: Keep disabled by default. Enable only for specific admin tasks, then disable immediately after.
Scaling Considerations
Mattermost Team Edition on Railway Hobby plan:
For production scale (50+ concurrent users), consider:
- Upgrading to Railway Pro plan
- Adding Redis for session caching (
MM_CACHEETTINGS_CACHETYPE=redis) - Configuring S3 for file storage (
MM_FILESETTINGS_DRIVERNAME=amazons3) - Setting up log aggregation