https:\/\/docs.mattermost.com\/install\/install-tar.html<\/a> and replace the link in the command below with the newest version.<\/p>\n\n\n\n# su - mattermost<\/pre>\n\n\n\n$ wget https:\/\/releases.mattermost.com\/9.0.1\/mattermost-9.0.1-linux-amd64.tar.gz -O mattermost.tar.gz<\/pre>\n\n\n\n$ tar -xzvf mattermost.tar.gz --strip-component 1<\/pre>\n\n\n\nBefore running Mattermost, we need to configure it to connect to our database.<\/p>\n\n\n\n
$ cp \/opt\/mattermost\/config\/config.json \/opt\/mattermost\/config\/config.defaults.json<\/pre>\n\n\n\nConfigure the following properties in this file:<\/p>\n\n\n\n
Set the DriverName field to \"mysql\".<\/pre>\n\n\n\nSet the DataSource field to \"dbuser:@:3306\/dbname?charset=utf8mb4,utf8\\u0026readTimeout=30s\\u0026writeTimeout=30s\",<\/pre>\n\n\n\nReplace dbuser, dbpassword with your dbuser and dbpassword you created in the previous step; in this case, it would be:<\/p>\n\n\n\n
\"DataSource\": \"mattermost:m0d1fyth15@tcp(localhost:3306)\/mattermostdb?charset=utf8mb4,utf8\\u0026readTimeout=30s\\u0026writeTimeout=30s\",<\/pre>\n\n\n\nSet your \"SiteURL\" to the domain name you want for your Mattermost application (e.g. https:\/\/mattermost.yourdomain.com).<\/pre>\n\n\n\nSave the file, then exit from nano editor<\/p>\n\n\n\n
Then, exit from user ‘mattermost’:<\/p>\n\n\n\n
$ exit<\/pre>\n\n\n\n<\/span>Step 6. Create Systemd Service File<\/span><\/h2>\n\n\n\nWe need to create a systemd service file to easily manage our Mattermost service. Let\u2019s create a systemd service file for Mattermost.<\/p>\n\n\n\n
# nano \/etc\/systemd\/system\/mattermost.service<\/pre>\n\n\n\nPaste the following into the systemd service file, then save it.<\/p>\n\n\n\n
[Unit]\nDescription=Mattermost\nAfter=network.target\n\n[Service]\nType=notify\nExecStart=\/opt\/mattermost\/bin\/mattermost\nTimeoutStartSec=3600\nKillMode=mixed\nRestart=always\nRestartSec=10\nWorkingDirectory=\/opt\/mattermost\nUser=mattermost\nGroup=mattermost\nLimitNOFILE=49152\n\n[Install]\nWantedBy=multi-user.target<\/pre>\n\n\n\nSave the file, exit from the nano editor, then reload systemd for the changes to take effect.<\/p>\n\n\n\n
# systemctl daemon-reload<\/pre>\n\n\n\nNow, let’s enable Mattermost to run on boot and run the service now.<\/p>\n\n\n\n
# systemctl enable --now mattermost<\/pre>\n\n\n\nThe command above will return an output like this:<\/p>\n\n\n\n
Created symlink \/etc\/systemd\/system\/multi-user.target.wants\/mattermost.service \u2192 \/etc\/systemd\/system\/mattermost.service.<\/pre>\n\n\n\nAt this point, Mattermost should be up and running, and it will automatically run on boot. To verify, run this command:<\/p>\n\n\n\n
# systemctl status mattermost<\/pre>\n\n\n\nYou will see an output similar to this<\/p>\n\n\n\n
\u25cf mattermost.service - Mattermost\nLoaded: loaded (\/etc\/systemd\/system\/mattermost.service; enabled; vendor preset: disabled)\nActive: active (running) since Thu 2023-09-14 21:18:02 EDT; 2min 8s ago\nMain PID: 55973 (mattermost)\nTasks: 26 (limit: 4737)\nMemory: 236.5M\nCGroup: \/system.slice\/mattermost.service\n\u251c\u250055973 \/opt\/mattermost\/bin\/mattermost\n\u251c\u250056133 plugins\/com.mattermost.nps\/server\/dist\/plugin-linux-amd64\n\u251c\u250056139 plugins\/playbooks\/server\/dist\/plugin-linux-amd64\n\u2514\u250056146 plugins\/com.mattermost.calls\/server\/dist\/plugin-linux-amd64\n\nSep 14 21:18:01 localhost.localdomain mattermost[55973]: {\"timestamp\":\"2023-09-14 21:18:01.957 -04:00\",\"level\":\"info\",\"msg\":\"got public IP address for>\nSep 14 21:18:01 localhost.localdomain mattermost[55973]: {\"timestamp\":\"2023-09-14 21:18:01.957 -04:00\",\"level\":\"info\",\"msg\":\"rtc: server is listening >\nSep 14 21:18:01 localhost.localdomain mattermost[55973]: {\"timestamp\":\"2023-09-14 21:18:01.959 -04:00\",\"level\":\"info\",\"msg\":\"rtc: server is listening >\nSep 14 21:18:01 localhost.localdomain mattermost[55973]: {\"timestamp\":\"2023-09-14 21:18:01.961 -04:00\",\"level\":\"info\",\"msg\":\"Listening TCP on 0.0.0.0:>\nSep 14 21:18:02 localhost.localdomain mattermost[55973]: {\"timestamp\":\"2023-09-14 21:18:02.660 -04:00\",\"level\":\"info\",\"msg\":\"Starting Server...\",\"call>\nSep 14 21:18:02 localhost.localdomain mattermost[55973]: {\"timestamp\":\"2023-09-14 21:18:02.664 -04:00\",\"level\":\"info\",\"msg\":\"Server is listening on [:>\nSep 14 21:18:02 localhost.localdomain mattermost[55973]: {\"timestamp\":\"2023-09-14 21:18:02.664 -04:00\",\"level\":\"info\",\"msg\":\"Sending systemd READY not>\nSep 14 21:18:02 localhost.localdomain systemd[1]: Started Mattermost.<\/pre>\n\n\n\nAt this point, you should be able to access mattermost at http:\/\/YOUR_SERVER_IP_ADDRESS:8065<\/strong><\/p>\n\n\n\n