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 https://docs.docker.com/engine/installation/linux/docker-ce/centos/.
  2. Edit your /etc/hosts file to include the following line:
127.0.0.1     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.

      wget https://storage.googleapis.com/golang/go1.9.4.linux-amd64.tar.gz

    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 https://rpm.nodesource.com/setup_8.x | sudo bash -

    1. Install Node.js

    sudo yum install -y nodejs

  2. Install NPM. Go to https://www.npmjs.com/get-npm and follow the installation instructions.

  3. Fork Mattermost server on GitHub from https://github.com/mattermost/mattermost-server.

  4. Fork Mattermost webapp on GitHub from https://github.com/mattermost/mattermost-webapp.

  5. Download the Mattermost code from your forked repositories:

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

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