Autostart problem ubuntu 18.04

Hello, @kur

When you mentioned that it does not run with Ubuntu autostart, do you mean that it does not automatically start when the server gets rebooted based on sudo systemctl enable mattermost.service ? Can you share the output of running the same command as you can see from the example I have below?

ahmaddanial@mattermost:~$ sudo systemctl status mattermost.service
● mattermost.service - Mattermost
   Loaded: loaded (/lib/systemd/system/mattermost.service; disabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-05-20 00:34:30 UTC; 1min 57s ago
 Main PID: 16450 (mattermost)
    Tasks: 12
   Memory: 62.2M
      CPU: 2.365s
   CGroup: /system.slice/mattermost.service
           └─16450 /opt/mattermost/bin/mattermost

May 20 00:34:30 mattermost mattermost[16450]: 2020-05-20T00:34:30.896Z        info        app/server.g
May 20 00:34:30 mattermost mattermost[16450]: 2020-05-20T00:34:30.897Z        info        app/server.g
May 20 00:34:30 mattermost mattermost[16450]: 2020-05-20T00:34:30.897Z        info        commands/ser
May 20 00:34:30 mattermost systemd[1]: Started Mattermost.
May 20 00:35:30 mattermost mattermost[16450]: 2020-05-20T00:35:30.813Z        debug        migrations/
May 20 00:35:30 mattermost mattermost[16450]: 2020-05-20T00:35:30.814Z        debug        migrations/
May 20 00:35:30 mattermost mattermost[16450]: 2020-05-20T00:35:30.819Z        debug        jobs/schedu
May 20 00:35:38 mattermost mattermost[16450]: 2020-05-20T00:35:38.944Z        debug        migrations/
May 20 00:35:39 mattermost mattermost[16450]: 2020-05-20T00:35:39.162Z        info        migrations/w
May 20 00:35:39 mattermost mattermost[16450]: 2020-05-20T00:35:39.163Z        debug        jobs/jobs.g
ahmaddanial@mattermost:~$ sudo systemctl enable mattermost.service
Created symlink from /etc/systemd/system/mysql.service.wants/mattermost.service to /lib/systemd/system/mattermost.service.

What happens when you try to start the service again using sudo systemctl restart mattermost.service since the status is showing Active: inactive (dead)?