Mattermost is a popular free software Slack alternative. Slack can get really expensive really quickly for organizations of any sufficient size, so you either bare with the extremely limited free plan (which holds your data "hostage"), or you switch over to a free alternative like Mattermost. With this, instead of forking over cash for Slack, you can run your own for as cheaply as $5 a month.

Digital Ocean is my preferred hosting service. It's similar to Amazon's AWS, but has a much cleaner and simpler interface, and easy to understand pricing scheme ($5 a month). If you haven't signed up yet, you can via my affiliate link which will give us both $10 of credit.

Installation of Mattermost is pretty easy on Digital Ocean, as I found out. I in turn used these two guides using their Docker Compose setup. Let's get started!

1. Create new Docker droplet on Digital Ocean

Create a new droplet using the Docker one-click app. Be sure to add your public key.

2. Install Mattermost and bring up server

First download the Mattermost's Dockerfiles. In this example, I've pinned the version to 4.4.3).

SSH into your new droplet and run the following commands:

git clone https://github.com/mattermost/mattermost-docker.git  
cd mattermost-docker  
git checkout 4.4.3  

Then build the images. This will take a while:

docker-compose build  

Finally, start the server in daemon mode

docker-compose up -d  

There, you're done! (Almost)

3. Configuring site settings

Now visit the IP address. You should see a nice Mattermost interface. Create a team, add your domain name, configure what you want.

Email

You'll also want to setup email. That's a bit more complicated, but generally you'll need to register for a 3rd party email service and then put in credentials here.

Until then, you can just use "invitation links" to invite teammates to your channel. Email is not absolutely necessary for use, although it is very handy for notifications.

SSL

You can also set up https support here. Personally I just used Cloudflare as a proxy, and terminate my https there -- easiest to manage and most secure.


October 2018 - Update

Thanks to Kevin for pointing this out!

It looks like the latest version of Mattermost requires some extra steps. You might get a 502 error, but if you run these 2 commands:

mkdir -pv ./volumes/app/mattermost/{data,logs,config}  
chown -R 2000:2000 ./volumes/app/mattermost/  

Then everything works. Source docs: https://docs.mattermost.com/install/prod-docker.html