We're Hiring!

Mattermost Discussion Forums

Deploy Mattermost on Docker

Deploy Mattermost on Docker

Important: This unofficial guide is maintained by the Mattermost community and this deployment configuration is not yet officially supported by Mattermost, Inc. Community testing, feedback, and improvements are welcome and greatly appreciated.

Deploy Mattermost using a multi-node configuration with Docker Compose. Experience with Docker Compose is recommended.

For a single-node preview of Mattermost (without email) see Local Machine Setup using Docker.

If you have any problems installing, see the troubleshooting guide. To submit an improvement or correction, add a comment to this post.

Docker Setup on Ubuntu

  1. Install Docker using the Ubuntu online guide or these instructions:
       sudo apt-get update
       sudo apt-get install wget
       wget -qO- https://get.docker.com/ | sh
       sudo usermod -aG docker <username>
       sudo service docker start
       newgrp docker
  1. Install Docker Compose using the online guide. You have to download the latest release from the Docker Compose GitHub page and put the binary on your /usr/local/bin folder. Usually, you can use the following command, replacing $dockerComposeVersion with the Docker Compose version to install:
     sudo curl -L "https://github.com/docker/compose/releases/download/$dockerComposeVersion/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
     sudo chmod +x /usr/local/bin/docker-compose
  1. Deploy the Mattermost Docker

Mattermost by default uses uid=2000 (user ID) and gid=2000 to access ./volumes/app/.

If you need to use another group or user IDs you can uncomment following lines in docker-compose.yml (also change chown -R 2000:2000 in set-up commands to your uid:gid)

  mattermost-app:
    build:
      context: app
      # uncomment following lines for team edition or change UID/GID
      args:
        - edition=team
        - PUID=1000
        - PGID=1000
        - MM_VERSION=5.31
    restart: unless-stopped

Set up using:

   sudo apt-get install git
   git clone https://github.com/mattermost/mattermost-docker.git
   cd mattermost-docker
   docker-compose build
   mkdir -pv ./volumes/app/mattermost/{data,logs,config,plugins,client-plugins}
   sudo chown -R 2000:2000 ./volumes/app/mattermost/
   docker-compose up -d

The docker-compose network that is created defaults to 172.18.0.0/16. If you need to change the default network this link provides guidelines on how to do that. If the network is already set up with the default, you need to run the following command to remove it. Then, run the command again to regenerate the default network to include the new network setting.

   docker network rm mattermost-server_mm-test

To verify the current Docker network use the following command to list it (you can access information about the options here):

   docker network ls [OPTIONS]
  1. Configure TLS by following the instructions.

  2. Configure Email by following the SMTP email setup guide.

  3. (Optional) To enable enterprise features, go to System Console > Edition and License and select Start trial.

  4. Configure your Server based on the configuration settings documentation.

Once you’ve saved your configurations, start an Enterprise trial via Main Menu > System Console > Edition and License > Start trial.

Additional guides

Docker Setup on Arch Linux

To install on Arch Linux, see the installation guide on the Arch Linux wiki.

Docker Setup on macOS

You can run a deployment on macOS by installing Docker Compose using the online guide then following the above instructions.

Other Options

To install Mattermost Team Edition instead of Mattermost Enterprise Edition, open docker-compose.yaml and uncomment the following lines:

   # args:
   #   - edition=team