
Mattermost is an enterprise grade, instant messaging platform, an open-source self-hosted Slack alternative. It is written in Golang and React and can use MySQL or PostgreSQL as a database backend. Mattermost brings all your team communication into one place and provides various features including file sharing, one-on-one and group messaging, custom emojis, video calls and more.
This “Job for Mattermost service failed” error occurred because the SQL settings, specifically the username and password, were not configured correctly for the PostgreSQL database. See how to install Mattermost on Ubuntu 20.04, 18.04 and Debian 10. As we can see, using both the “systemctl status mattermost.service” and “journalctl -xe” coud not provide me enough information. I had to dig deep.


Solution: Ensure that you enter the right Postgres parameters (username and password) here or else, the services will never start.
"DataSource": "postgres://tester:What@Mattermost@localhost:5432/mattermost?sslmode=disable&connect_timeout=10",

Now let us try to start the service again, this should start correctly.

That’s how to fix “Job for Mattermost service failed”. I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.