Installing Developer Components on Ubuntu 16.04ΒΆ

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/ubuntu/#install-using-the-repository.
  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 service docker restart
  1. Change your current group ID to the docker group.
newgrp docker
  1. Install the build-essential package.
sudo apt-get install build-essential
  1. Download and install Go 1.8 for Linux:

    1. Download the Go binary.

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

    2. Install the Go binary.

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

  2. 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
ulimit -n 8096
  1. Reload your bash configuration.
source ~/.bashrc
  1. Install Node.js:

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

    curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

    1. Install Node.js

    sudo apt-get install -y nodejs

  2. Install Yarn. Go to https://yarnpkg.com/en/docs/install and follow the installation instructions.

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

  4. Download the Mattermost code from your forked repository:

  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 fork. In the following command, replace {username} with your GitHub username.
git clone https://github.com/{username}/platform.git

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