This post is long overdue. We made the switch from Slack to Mattermost early last year, in our effort to have more control over the systems that we rely on, and also to try and remove the dependency on the US given the current (geo)political climate there.
I’d been wanting to try out Nexaa for a while now. Some of my friends work there, and their serverless containers solution seemed quite easy. I had not realized how incredibly easy it would be, but I’d find out soon enough. In this post I want to document what I did, lessons I learned and give you some tips if you’d want to host your own Mattermost on Nexaa.
The plan
Our initial plan was to do a full user-and-data migration from our Slack. We’d read that this could be done and since our history felt important (even if we only rarely searched through our history) we wanted to try and do a full migration.
Did I reach all the goals set in this plan? Nope. Let’s dissect what happened.
First of all: we need a database
Before we can even set up Mattermost we need a database. Mattermost supports both Postgres and MySQL, but since I plan on deploying more apps on Nexaa and most of those are MySQL, I set up a managed database in the Nexaa portal. It’s literally completing a form, and the database server is set up for you. I decided on a 1 node setup. Well, that was easy.
Setting up Mattermost
This is probably the second easiest step of this whole setup (after the database). Nexaa makes it super easy to deploy containers, so all you need to do is configure the registry or, in this case, use a publicly available image. Since we’re going to deploy Mattermost, it’s as simple as using the Mattermost image. Right now we’re on mattermost/mattermost-team-edition:release-10.12. We still need to upgrade to Mattermost 11, it’s on our TODO. But when we started, we were on an even lower version. Upgrading is as simple as editting the container and changing the tag (unless there are other, manual, steps to be done as part of the upgrade).
The rest of the form for creating a new container is relatively straightforward, although some things require some research. I found the minimum requirements for the system Mattermost ran on and decided to run our server on a 1CPU 2GB RAM container.
It took me a bit to figure out which environment variables I should set. The most important one is the MM_SQLSETTINGS_DATASOURCE. That contains the DSN for your database. The DOMAIN is also important, it’s the URL that your Mattermost instance will be available on. Other settings I configured: MM_LOGSETTINGS_CONSOLEJSON, MM_SQLSETTINGS_DRIVERNAME (which is mysql in our case) and MM_LOGSETTINGS_CONSOLELEVEL. Although the latter was mostly useful to set during initial debugging (set to debug) so you can figure out what goes wrong if anything goes wrong.

By default, your container is not publicly reachable, so you need to configure that it is. You also add a port mapping: In this case public port 80 maps to port 8065 of the Mattermost container.
Under step 8, you can also configure the ingress to use TLS. It will do the SSL termination for you, so your containers only need to listen to port 80. You also configure the URL on which your container is available.

Next thing is volumes. Some things need to be kept even if the container restarts. In the above screenshot you can see how we configured this. As you can see, we configured waaaaay too big volumes. Smaller volumes are also possible. Better yet: You can better start out small and then make them bigger if needed. Why? Because you can not shrink volumes, but you can always make them bigger. The above usage is after a year of using Mattermost with about 10 users. That might give you an idea of what kind of volume size you may need.

The last step is to configure the scaling. Nexaa has autoscaling and manual scaling. Since our Mattermost is only used by a few people, manual scaling will do the trick, and a single replica is fine for us.
Once I saved this, the container was set up and booted. And indeed, things worked. Well… I of course needed to configure some things.
Configuring Mattermost
On the system console of Mattermost, I can now start configuring things. Most of the settings are fine by default, but some things you might want to change.

You can click all the options to customize stuff as needed, but some things should be configured:
- Environment -> SMTP: You need to configure this to allow Mattermost to send email. We use our Mailgun for this
- Site configuration -> Customization: I guess this is not required, but fun: Give your server a name, a description, a custom logo and configure some other things.
- Authentication -> Signup: Unless you want your server to be open to everyone, make sure that
Enable open serveris set toFalse. - Integrations -> GIF: Very important: Make sure the Gif picker is enabled
- User management -> Teams: Make sure to create your first team!
Teams
Now this perhaps warrants an explanation. Within a Mattermost server, you can have multiple teams. Consider a team similar to a workspace in Slack: Every team has its own set of channels and it’s own environment. Teams in Mattermost can be public (anyone on the server can join the team) or private (if you have an account on the server you still need an invite to be part of the team). In our case, we only needed a single team: Ingewikkeld.
Importing from Slack
Now this is where things failed. Slack allows you to easily export all your data (if you have a paid plan). Mattermost has great documentation on how to migrate. So we downloaded all the users, the channels and the messages and used the mmetl tool to convert it to the Mattermost format. You do that on your local machine.
For me, that was when the trouble started. We’ve used Slack for over 10 years within Ingewikkeld, so the archive was huge. And it seems the Nexaa ingress has a maximum request size/upload size that you can not configure. The result for us was that we would get errors when trying to import into Mattermost.
I spend way too long on trying to solve this and eventually gave up. The import had succeeded for users and channels, and that was the most important part for me. The message archive… we’ve backed it up somewhere so we can always search in it, but have not imported it into our Mattermost. A fresh start is nice as well, right?
Using Mattermost
Now you can use Mattermost on the web (through the configured URL, assuming you did change the DNS) or using the Mattermost app on your computer or smartphone. And so far, it works really well for us. The only downtime so far was when I updated the configuration and made a mistake, but that was easily fixed.
Fun fact
Fun fact: I did most of the setup of our Mattermost on the train from SymfonyCon Vienna to Klosters, Switzerland (where I would be visiting my sister and her family). If I can do this on an international train in the alps, you can do it in your (home) office as well 😉

Leave a Reply