This repository provides a fast, containerized way to deploy Mattermost Team Edition using Docker and Docker Compose. Mattermost is an open-source, self-hosted messaging platform for secure team communication and collaboration.
- CPU: 2 Cores
- RAM: 4 GB
- Storage: 20 GB free space
- Docker installed.
- Docker Compose installed.
Follow these steps to get your Mattermost server up and running:
1. Clone or set up the project directory Ensure you have the following files in your project directory:
docker-compose.yml.env.samplerun.sh
2. Configure the Environment Variables
Copy the sample environment file to create your own .env file:
cp .env.sample .envEdit the .env file using your preferred text editor (e.g., nano .env) and update the values:
DOMAIN: Your server's IP address or domain name (e.g.,chat.example.com).MM_PORT: The port you want Mattermost to listen on (default is8065).POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DB: Set secure database credentials.
3. Make the script executable Grant execution permissions to the setup script: bash chmod +x run.sh
4. Run the deployment script Execute the script to create necessary volumes, set directory permissions, and start the containers: bash ./run.sh
Once the containers are running, wait about 1-2 minutes for the database to initialize. You can then access your Mattermost instance via your web browser:
text
http://<YOUR_DOMAIN_OR_IP>:<MM_PORT>
(Example: http://127.0.0.1:8065)
The first user to register on this page will automatically be granted System Administrator privileges.
docker-compose.yml: Defines the Mattermost and PostgreSQL services..env.sample: Template for required environment variables.run.sh: Automation script to prepare volumes, fix permissions (Mattermost requires UID2000), and spin up the containers.volumes/: (Generated after running) Stores persistent data for the database and Mattermost (config, logs, files, plugins).
View Mattermost logs: bash docker-compose logs -f mattermost
Stop the server: bash docker-compose down
Restart the server: bash docker-compose restart