Plex Media Server is killed due to memory spikes – how can I auto-relaunch it?


Last modified date: 2025-08-27

Applicable Products

Plex Media Server


Scenario

The Plex process is sometimes killed in the background due to a temporary memory spike. You would only discover Plex is down when trying to stream and would need to restart it manually.


Solution

With this solution, Plex Media Server will be automatically relaunched within 30 seconds, minimizing downtime and manual restarts. 

Steps:

  1. Stop Plex Media Server 

  2. Connect to your NAS command prompt via SSH.

  3. Find and change to the directory of the Plex Media Server QPKG.

    [~] # QPKG_DIR=$(getcfg -f "/etc/config/qpkg.conf" PlexMediaServer Install_path)
    [~] # cd $QPKG_DIR
  4. Edit the startup script plex.shusing vi editor.


    4.1 Locate the following line:  
    ./Plex\ Media\ Server &

    4.2 Relace it with the following line:  
    /sbin/daemon_mgr "Plex Media Serv" "start" "${QPKG_DIR}/Plex\ Media\ Server >/dev/null &"

    ⚠️ Make sure to keep the space after the backslash (\ ) in Plex\ Media\ Server. The backslash escapes the space character in the folder name.


  5. Save changes into the file and exit
  6. Start Plex Media Server.

Was this article helpful?

Thank you for your feedback.

Please tell us how this article can be improved:

If you want to provide additional feedback, please include it below.

Choose specification

      Show more Less

      Choose Your Country or Region

      open menu
      back to top