I remember back in 2014 and earlier, at various work places we used various group instant chat platforms, which were fine; but then a little startup called Slack came along. It absolutely nailed the group instant chat user experience - everything about it was just nicer to use than the rest. Almost every company ended up adopting it, not because it was better at providing explicit value, but because all employees were asking, begging, pleading for it.
Over a decade later, the tide has turned. Enshittification started, as Sack pivoted to focusing on enterprise requirements; but then it wasn't until Salesforce acquired it where things really started to go downhill. Chuck in the fact of how willing Salesforce is to give the Trump administration whatever they want, you bet your ass they're collecting what people are saying on there with any anti-Trump admin.
Enter Mattermost, which is pretty much an open source clone of Slack. They run hosted offerings and have an Enterprise license for more of the things that big Enterprises want... but their open source Team Edition has very few limits the biggest being lack of SSO (though they recently did just reduce the user limit for it from 1000 users to 250). For my uses with a few small groups of friends. But be aware that you want the Team Edition here, NOT the default Entry Edition they push, which is a free and heavily limited version of their Enterprise Edition.
Like most things I'm hosting, I'm utilising Dokku for simplicity, referencing the following two guides as references:
The difference here is I'm not pushing up a repo with a custom Dockerfile, rather I'm assigning the docker image container to dokku directly.
Create the dokku app
dokku apps:create chatConfigure lets encrypt for the domain
By default dokku will use your host name with the app name as the subdomain, ie chat.host.name. You can use dokku domains commands to change this.
dokku letsencrypt:set chat email <your email>
dokku letsencrypt:enable chatCreate a local postgres instance and link it to the app
Mattermost uses a Postgres Database, you can use any but Dokku has an easy postgres plugin.
dokku postgres:create chat-db
dokku postgres:link chat-db chat
Set the required env vars and settings:
This tells Mattermost where the database is, and also sets the timezone for inside the container.
# Get the Postgres URL
PG_URL="$(dokku config:get chat DATABASE_URL)"
# Configure the app database config
dokku config:set --no-restart chat MM_SQLSETTINGS_DRIVERNAME=postgres MM_SQLSETTINGS_DATASOURCE="$PG_URL?sslmode=disable&connect_timeout=10"
# set applicable timezone for the server
dokku config:set --no-restart chat TZ=Melbourne/Australia
Define persistent storage folders:
I keep my folders in the host /root/chat folder - this script below maps config, data, logs, plugins, client/plugins and bleve-indexes in there for the container:
for d in config data logs plugins client/plugins bleve-indexes; do
volume="/root/chat/$d"
sudo mkdir -p "/root/chat"
sudo mkdir -p "$volume"
sudo chown -R 2000:2000 "$volume"
dokku storage:mount chat "$volume:/mattermost/$d"
doneConfigure the base docker image
This tells dokku to use the latest docker image:
dokku git:from-image chat mattermost/mattermost-team-edition:latestSet the port mapping
This tells dokku to send http and https traffic to the port Mattermost is listening on inside the container.
dokku ports:set chat http:80:8065 https:443:8065
And then your server should be listening on chat.hostname domain!
Mattermost Config
Inside the Mattermost System Console I simply configure the following for a minimal setup.
- I enable Push Notifications, utilising MatterMost's Push Notification Server, to enable pushes for mobile.
- I enabled MFA as an option for my users
- I configure SMTP using my mailgun account for email notifications and password recovery etc.
- I enabled Custom Plugin uploads (this needs to be done manually in the config file)
Upgrade Procedure
To update Mattermost we just update the image and rebuild it
- ssh into the server
- update the latest docker image:
docker pull mattermost/mattermost-team-edition:latest - rebuild and restart the server:
dokku ps:rebuild chat
Plugins!
Mattermost has replicated some of Slack's APIs and has a modest free marketplace of plugins and extensions. But crucially it's not too hard to make your own, especially in 2026 with the ability to vibe code them without too much effort. In my next posts I'll introduce two such plugins I've created that add some nice quality of life changes.
Top Photo by Stephen Phillips - Hostreviews.co.uk / Unsplash