Edit on GitHub

  1. Install and configure Docker CE:

    curl -fsSL https://get.docker.com -o get-docker.sh
    sudo sh get-docker.sh
    sudo usermod -aG docker $(whoami)
    docker login

    If you prefer to perform these steps manually:

    Note: MM-7971 introduced using docker-compose to manage containers. To preserve your data on upgrade, execute the following steps.

    First, backup from any existing containers:

    mysqldump -h --column-statistics=0 -u mmuser -p mattermost_test > mm_mysql_backup.sql
    pg_dump -U mmuser -W -d mattermost_test -h > mm_postgres_backup.bak

    Then after upgrading and starting the new docker-compose managed containers, restore the data:

    mysql -u mmuser -p -h mattermost_test < mm_mysql_backup.sql
    psql -U mmuser -W -h -f mm_postgres_backup.bak mattermost_test

    If you don’t migrate your data, the new, docker-compose-managed containers will start out empty. To remove the old containers and destroy any existing data use make clean-old-docker.

  2. Install docker-compose

    sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
  3. Install Go (modify installation to latest Go version from here):

    sudo yum group install "Development Tools"
    sudo yum install -y wget libpng12
    sudo rm -rf /usr/local/go
    wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz
    sudo tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
  4. Update your shell’s initialization script (e.g. .bashrc or .zshrc) and add the following:

    export PATH=$PATH:/usr/local/go/bin
  5. Edit /etc/security/limits.conf as an administrator (e.g. sudo) and add the following lines, replacing {username} with your username:

    {username}  soft  nofile  8096
    {username}  hard  nofile  8096
  6. Log out and log back in to effect the changes above.

  7. Fork https://github.com/mattermost/mattermost-server.

  8. Clone the Mattermost source code from your fork:

    git clone https://github.com/YOUR_GITHUB_USERNAME/mattermost-server.git
  9. Start the server and test your environment:

    cd mattermost-server
    make run-server
    curl http://localhost:8065/api/v4/system/ping
    make stop-server

    If successful, the curl step will return a JSON object:


    Note: Browsing directly to http://localhost:8065/ will display 404 Not Found until the web app is configured. See Web App Developer Setup and Mobile App Developer Setup for additional setup.

    The stop-server make target does not stop all the Docker containers started by run-server. To stop the running Docker containers:

    make stop-docker

Did you find what you were looking for?

Thank you! We appreciate your feedback.

Tell us more

Your feedback helps us improve the Mattermost developer documentation.

Have a feature request? Share it here.

Having issues? Join our Community server.