Overview
This template provides a production‑ready Mattermost stack as a Monk runnable. You can:- Run it directly to get a managed Mattermost deployment with PostgreSQL
- Inherit it in your own runnable to seamlessly add team collaboration and messaging to your infrastructure
What this template manages
- Mattermost server (Enterprise or Preview edition)
- PostgreSQL database (enterprise stack)
- NGINX reverse proxy
- Persistent volumes for data, config, logs, and plugins
- Network configuration and service discovery
Quick start (run directly)
- Load templates
- Run Mattermost enterprise stack
- Run Mattermost preview stack (for testing)
- Customize credentials (recommended via inheritance)
variables. Secrets added with monk secrets add will not affect this runnable unless you inherit it and reference those secrets.
- Preferred: inherit and replace variables with
secret("...")as shown below. - Alternative: fork/clone and edit the
variablesin the stack files, thenmonk load MANIFESTand run.
http://localhost:80 (or the configured nginx-listen-port).
Configuration
Enterprise Stack Variables
Key variables you can customize in the enterprise stack:Preview Stack Variables
The preview stack uses a simpler all-in-one configuration:${monk-volume-path}/mattermost/ on the host with subdirectories for:
config/- Mattermost configuration filesdata/- User data and file uploadslogs/- Application logsplugins/- Installed pluginsclient/plugins/- Client-side pluginsbleve-indexes/- Search indexes
${monk-volume-path}/postgresql/.
Use by inheritance (recommended for apps)
Inherit the Mattermost stack in your application to add team collaboration. Example:Ports and connectivity
- Service:
nginxon TCP port80(default, configurable vianginx-listen-port) - Internal:
mattermostservice on TCP port8065 - Internal:
postgresservice on TCP port5432(enterprise only) - From other runnables in the same process group, use
connection-hostname("\<connection-name>")to resolve service hosts.
Persistence and configuration
Mattermost Data Paths
- Config:
${monk-volume-path}/mattermost/config:/var/lib/mattermost/config - Data:
${monk-volume-path}/mattermost/data:/var/lib/mattermost/data - Logs:
${monk-volume-path}/mattermost/logs:/var/lib/mattermost/logs - Plugins:
${monk-volume-path}/mattermost/plugins:/var/lib/mattermost/plugins - Client Plugins:
${monk-volume-path}/mattermost/client/plugins:/var/lib/mattermost/client/plugins - Search Indexes:
${monk-volume-path}/mattermost/bleve-indexes:/var/lib/mattermost/bleve-indexes
Database Persistence (Enterprise)
- PostgreSQL data:
${monk-volume-path}/postgresql:/var/lib/postgresql/data
Configuration Files
You can customize Mattermost by placing configuration files in the config directory. The application reads from/var/lib/mattermost/config which is mounted from your host.
Features
- Team messaging and collaboration - Real-time chat, threads, and direct messages
- File sharing and search - Share files, images, and search message history
- Voice calls and screen sharing - Built-in audio/video conferencing
- Integrations and webhooks - Connect with Jira, GitHub, Trello, and more
- Mobile and desktop apps - Native applications for all platforms
- Custom emoji and GIFs - Personalize your team’s communication
- Flexible deployment - Self-hosted with full control over data and security
- Enterprise features - Advanced compliance, authentication, and management tools
Related templates
- High-availability setup: Deploy multiple Mattermost instances behind a load balancer for production scale
- Database alternatives: The enterprise stack can be adapted to use other PostgreSQL-compatible databases
- Monitoring: Combine with monitoring tools (
prometheus-grafana/) for observability - Integrate with your application stack as needed
Troubleshooting
- Database connection issues: Ensure PostgreSQL is running and credentials match between the database and Mattermost server variables.
- Permission issues: Ensure host volumes are writable by the container user (UID 2000 for Mattermost).
- Changed passwords: If you change database credentials after initial setup, update both the database and the Mattermost server configuration.
- Port conflicts: If port 80 is already in use, change
nginx-listen-portto an available port.