Edit on GitHub

  1. Install and configure Docker CE: https://docs.docker.com/desktop/install/mac-install/.

    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 – destroying any existing data – use make clean-old-docker.

  2. Download and install homebrew: https://brew.sh/.

  3. Install Go:

    brew install go
  4. Update your shell’s initialization script (e.g. .bashrc or .zshrc) and add the following:

    ulimit -n 8096
  5. Fork https://github.com/mattermost/mattermost-server

  6. Clone the Mattermost source code from your fork:

    git clone https://github.com/YOUR_GITHUB_USERNAME/mattermost-server.git
  7. Start the server:

    cd mattermost-server
    make run-server

    Note: If you see lot of nc: bad address 'elasticsearch' messages, eventually exiting with the message Service elasticsearch:9200 did not start within 300 seconds. Aborting..., increase the memory available for the Docker Engine by going to Docker's preferences -> Advanced.

    Note: If you see an error which says Failed to ping DB, it’s probably due to a conflict between the PostgreSQL service in Docker and the one which is running system-wide. You can stop the system-wide server temporarily by running brew services stop postgres in your terminal, then restart the Docker service.

  8. Test your environment:

    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 a 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.