Developer Machine Setup¶
If you run into any issues getting your environment set up, please check the Troubleshooting section at the bottom for common solutions.
Mac OS X¶
- Install Docker for Mac
- Add the following line to
/etc/hosts
127.0.0.1 dockerhost
- Download Go 1.6 (Go 1.5 and earlier is not supported) and Node.js using Homebrew.
- Download Homebrew from http://brew.sh/
brew install go
brew install node
- Set up your Go workspace
mkdir ~/go
- Add the following to your
~/.bash_profile
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
ulimit -n 8096
- If you don’t increase the file handle limit you may see some weird build issues with browserify or npm.
- Reload your bash profile
source ~/.bash_profile
- Set GOROOT (optional) in your
~/.bash_profile
export GOROOT=/usr/local/go/
- Fork Mattermost on GitHub.com from https://github.com/mattermost/platform, then:
cd ~/go
mkdir -p src/github.com/mattermost
cd src/github.com/mattermost
git clone https://github.com/<username>/platform.git
cd platform
- Run
make run
to start Mattermost - Browse to
http://localhost:8065
to create an account. The first account created has System Administrator privileges. - You can stop Mattermost using
make stop
- If you want to setup for cross compilation (required for the
make package
and dependant targets) run:- Note: You can skip the platform you are on because you have that target installed by default.
env GOOS=windows GOARCH=amd64 go install std
env GOOS=darwin GOARCH=amd64 go install std
env GOOS=linux GOARCH=amd64 go install std
Any issues? Please let us know on our forums at: https://forum.mattermost.org/
Ubuntu¶
- Download Docker, follow the instructions at https://docs.docker.com/engine/installation/linux/ubuntulinux/
- Set up your dockerhost address
- Edit your
/etc/hosts
file to include the following line127.0.0.1 dockerhost
- Edit your
- Install build essentials
apt-get install build-essential
- Download Go 1.6 (Go 1.5 and earlier is not supported).
- Set up your Go workspace and add Go to the PATH
mkdir ~/go
- Add the following to your
~/.bashrc
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
ulimit -n 8096
- If you don’t increase the file handle limit you may see some weird build issues with browserify or npm.
- Reload your bashrc
source ~/.bashrc
- Set GOROOT (optional) in your
~/.bash_profile
export GOROOT=/usr/local/go/
- Install Node.js
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs
- Fork Mattermost on GitHub.com from https://github.com/mattermost/platform, then:
cd ~/go
mkdir -p src/github.com/mattermost
cd src/github.com/mattermost
git clone https://github.com/<username>/platform.git
cd platform
- Run
make run
to start Mattermost - Browse to
http://localhost:8065
to create an account. The first account created has System Administrator privileges. - You can stop Mattermost using
make stop
- If you want to setup for cross compilation (required for the
make package
and dependant targets) run:- Note: You can skip the platform you are on because you have that target installed by default.
env GOOS=windows GOARCH=amd64 go install std
env GOOS=darwin GOARCH=amd64 go install std
env GOOS=linux GOARCH=amd64 go install std
Any issues? Please let us know on our forums at: http://forum.mattermost.org
Archlinux¶
Install Docker
pacman -S docker
gpasswd -a user docker
systemctl enable docker.service
systemctl start docker.service
newgrp docker
Set up your dockerhost address
- Edit your /etc/hosts file to include the following line
127.0.0.1 dockerhost
- Edit your /etc/hosts file to include the following line
Install Go
pacman -S go
Set up your Go workspace and add Go to the PATH
mkdir ~/go
- Add the following to your ~/.bashrc
export GOPATH=$HOME/go
export GOROOT=/usr/lib/go
export PATH=$PATH:$GOROOT/bin
- Reload your bashrc
source ~/.bashrc
- Set GOROOT (optional) in your
~/.bash_profile
export GOROOT=/usr/local/go/
Edit /etc/security/limits.conf and add the following lines (replace username with your user):
username soft nofile 8096 username hard nofile 8096
You will need to reboot after changing this. If you don’t increase the file handle limit you may see some weird build issues with browserify or npm.
Install Node.js
pacman -S nodejs npm
Fork Mattermost on GitHub.com from https://github.com/mattermost/platform, then:
cd ~/go
mkdir -p src/github.com/mattermost
cd src/github.com/mattermost
git clone https://github.com/<username>/platform.git
cd platform
Run
make run
to start MattermostBrowse to
http://localhost:8065
to create an account. The first account created has System Administrator privileges.You can stop Mattermost using
make stop
If you want to setup for cross compilation (required for the
make package
and dependant targets) run:- Note: You can skip the platform you are on because you have that target installed by default.
env GOOS=windows GOARCH=amd64 go install std
env GOOS=darwin GOARCH=amd64 go install std
env GOOS=linux GOARCH=amd64 go install std
Any issues? Please let us know on our forums at: http://forum.mattermost.org
Windows¶
Install and setup Docker
- If you are using Windows 10 Pro or Enterprise, you may use Docker for Windows
- Install Docker for Windows
- Add the line
127.0.0.1 dockerhost
toC:\Windows\System32\drivers\etc\hosts
using a text editor with administrator privileges
- For other Windows versions, or if you prefer to use VirtualBox, use Docker Toolbox
- Install Docker Toolbox
- Run the
Docker Quickstart Terminal
and let it configure thedefault
machine - Run
docker-machine ip default
in the terminal to getdefault
IP - Add the line
<Docker-IP> dockerhost
toC:\Windows\System32\drivers\etc\hosts
using a text editor with administrator privileges
- If you are using Windows 10 Pro or Enterprise, you may use Docker for Windows
Download and install Node.js from https://nodejs.org/
Download and install Go from https://golang.org/dl/
Fork Mattermost on GitHub.com from https://github.com/mattermost/platform, then:
cd ~/go
mkdir -p src/github.com/mattermost
cd src/github.com/mattermost
git clone https://github.com/<username>/platform.git
cd platform
git config core.eol lf
git config core.autocrlf input
git reset --hard HEAD
Install and setup babun from http://babun.github.io/
Setup the following environment variables (change the path accordingly):
export PATH="/c/Program Files/go/bin":$PATH export PATH="/c/Program Files/nodejs":$PATH export PATH="/c/Program Files/Git/bin":$PATH export GOROOT='c:\\Program Files\\go' export GOPATH='c:\\User\\<user-name\\go' export PATH="/c/Program Files/Docker Toolbox":$PATH #change the path accordingly if you are using Docker for Windows eval $(docker-machine env default) #skip this line if you are using Docker for Windows
Run
make run
to start MattermostYou can now log in to Mattermost as the user you created in step 9
If you want to setup for cross compilation (required for the
make package
and dependant targets) run:- Note: You can skip the platform you are on because you have that target installed by default.
env GOOS=windows GOARCH=amd64 go install std
env GOOS=darwin GOARCH=amd64 go install std
env GOOS=linux GOARCH=amd64 go install std
Any issues? Please let us know on our forums at: http://forum.mattermost.org
Troubleshooting¶
Build errors¶
I get the following error when running make run
on Mac OS X: “Cannot connect ot the Docker daemon”¶
If you have Docker Tools installed (as opposed to Docker for Mac), you need make sure docker-machine
is running with the following:
docker-machine start dev
I get the following error when running make run
: “Failed to ping db err:dial tcp 192.168.99.100:3306: getsockopt: connection refused”¶
It appears that your MySQL database isn’t running. If you run docker ps
, you should see a line like
ecb17c10973d mysql:5.7 "/entrypoint.sh mysql" 2 weeks ago Up 24 hours 0.0.0.0:3306->3306/tcp mattermost-mysql
If not, running make clean-docker
will remove all existing docker containers so that they’ll be recreated next time you call make run
.
I get the following error when running make run
: “Error starting server, err:listen tcp :8065: bind: address already in use”¶
There’s likely another Mattermost instance already running. You can use make stop
to stop it before running make run
again.
If there isn’t another copy of Mattermost running and you need to change the port that Mattermost is running on, you can do so by changing the ListenAddress
setting in the ServiceSettings
section of config/config.json
.
Other errors¶
I don’t see any error messages, but I can’t access http://localhost:8065
¶
It’s possible that the server reported an error, but it was missed because of all of the output from the Javascript compiler. Try running make run-server
by itself to see its output. If you still don’t see any error messages, continue to the next section.
I don’t see anything logged to the console when Mattermost is running¶
You can enable console logging in the LogSettings
section of your config/config.json
by setting EnableConsole
to true
.
I can’t log into Mattermost because I don’t have an account¶
You can create an account using the following command:
go run mattermost.go -create_user -email="user@example.com" -password="mypassword"
Optionally, you can make that account a System Admin with the following command:
go run mattermost.go -assign_role -email="user@example.com" -role="system_admin system_user"