Installing Developer Components on CentOS 7¶

Set up your development environment for building, running, and testing Mattermost.

  1. If you are developing with the Docker container, install and configure Docker CE:
  1. Follow the Docker installation instructions at
  2. Edit your /etc/hosts file to include the following line:     dockerhost
  1. Add your username to the docker group so that you can run Docker without using sudo. Replace {username} with your username.
sudo gpasswd -a {username} docker
  1. Restart the Docker daemon.
sudo systemctl restart docker
  1. Change your current group ID to the docker group.
newgrp docker
  1. Install the development tools package, wget and libpng12 required by pngquant(a library used by Mattermost).

    1. sudo yum group install "Development Tools"
    2. sudo yum install -y wget libpng12
  2. Download and install Go 1.9 for Linux:

    1. Download the Go binary.


    2. Install the Go binary.

      sudo tar -C /usr/local -xzf go1.9.4.linux-amd64.tar.gz

  3. Set up your Go workspace:

  1. mkdir ~/go
  2. Add the following lines to your ~/.bashrc file:
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:/usr/local/go/bin
  1. Reload your bash configuration.

    source ~/.bashrc

  2. Since you cannot run ulimit -n 8096 with a regular user, we have to edit the file sudo nano /etc/security/limits.conf to include the following 2 lines at the end of it:

{username} soft nofile 8096
{username} hard nofile 10000
  1. After doing the above simple logout then log back in and it should accept the changes.
  1. Install Node.js:

    1. Add the Node.js repository to your repository list.

    curl --silent --location | sudo bash -

    1. Install Node.js

    sudo yum install -y nodejs

  2. Install NPM. Go to and follow the installation instructions.

  3. Fork Mattermost server on GitHub from

  4. Fork Mattermost webapp on GitHub from

  5. Download the Mattermost code from your forked repositories:

  1. Create the directory for the code.
mkdir -p ~/go/src/
  1. Change to the directory that you created.
cd ~/go/src/
  1. Clone your Mattermost server fork. In the following command, replace {username} with your GitHub username.
git clone{username}/mattermost-server.git
  1. Clone your Mattermost webapp fork. In the following command, replace {username} with your GitHub username.
git clone{username}/mattermost-webapp.git

Now that everything is set up, you are ready to compile and run Mattermost. See Compiling Mattermost.