Plex not starting automatically on Ubuntu

For some reason Plex crashed this morning which has been the first time this happened. On inspection I discovered that my /var partition was full, which was strange. After a bit of research I discovered that the video thumbnails was probably the culprit, however I couldn’t get onto the server to change this setting then optimise the database. This lead to me needing to uninstall PMS then reinstall it. This completed with a few errors, however when I type in “start_pms” the server starts fine. The only issue is that I have to type that into terminal in order to get it to start as it seems the errors that occurred were that it didn’t install the services for some reason.

I just need to know if there is anyway that I can create these myself.

I would try reinstalling until you have an error-free install because this might not be the only thing that’s wrong.

In /etc/systemd/system/ create a file called plexmediaserver.service. In that file add

[Unit]
Description=Plex Media Server for Linux
After=network.target

[Service]
Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support”
Environment=PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
Environment=PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
Environment=PLEX_MEDIA_SERVER_TMPDIR=/tmp
Environment=LD_LIBRARY_PATH=/usr/lib/plexmediaserver
Environment=LC_ALL=en_US.UTF-8
Environment=LANG=en_US.UTF-8
ExecStartPre=/bin/sh -c ‘/usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}”’
ExecStart=/bin/sh -c ‘/usr/lib/plexmediaserver/Plex\ Media\ Server’
Type=simple
User=plex
Group=plex
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target
.
run sudo systemctl start plexmediaserver
check that there are no errors and it’s still running with sudo systemctl status plexmediaserver
Then make it run on restart sudo systemctl enable plexmediaserver

Cheers dude, I’ll give it a shot later. Had the parents down all weekend so had no chance to sort it.

Sorted. This wouldn’t work unfortunately, so I had to reinstall Plex again.