Steps marked with an asterisk (*) are optional
- Entware installed
- SWAP enabled (2GB or more recommended)
Increasing swappiness can significantly improve Plex performance
# check current swappiness value
cat /proc/sys/vm/swappiness
# change swappiness at runtime and make it persistent across reboots
echo 10 > /proc/sys/vm/swappiness
echo 'echo 10 > /proc/sys/vm/swappiness' >> /jffs/scripts/post-mountopkg install coreutils-sha256sum debootstrap binutils perlbase-autodiemount -i -o remount,exec,dev /opt/..debootstrap --variant=minbase --arch=arm64 bookworm /opt/debian/ https://ftp.debian.org/debian/rm /opt/etc/init.d/S99debian
wget -O /opt/etc/init.d/S99debian https://raw.githubusercontent.com/bbeny123/Plex_Asuswrt-Merlin/main/init-debian.sh
chmod 755 /opt/etc/init.d/S99debianBy default, all subdirs of
/tmp/mnt/(excluding the Entware partition) are bind-mounted to the Debian/mnt/, making them visible to Plex
Skipping this step, hot-plugged USB drives will only become available to Debian (and thus accessible by Plex) after a router reboot or a manual
debian restart/debian enter
Prerequisite:
JFFS custom scripts and configsenabled (router WebUI -> Administration -> System)
echo 'debian postmount "$1"' >> /jffs/scripts/post-mountThis step ensures a graceful shutdown of Debian (and thus Plex) when the Entware partition is unmounted.
This also prevents mostDevice or resource busyerrors, making the unmount process significantly faster.
Prerequisite:
JFFS custom scripts and configsenabled (router WebUI -> Administration -> System)
echo 'debian unmount "$1"' >> /jffs/scripts/unmounttouch /opt/etc/chroot-services.list
chmod 755 /opt/etc/chroot-services.list
ln -s /opt/etc/init.d/S99debian /opt/bin/debiancp /etc/hosts /opt/debian/etc/debian enterapt update && apt upgrade -y
apt install -y apt-transport-https curl gnupg procpsdpkg-reconfigure tzdata
[ -f /usr/sbin/init ] && ls -l /usr/sbin/init | grep -q systemd && mv -f /usr/sbin/init /usr/sbin/init.bakcurl -sS https://downloads.plex.tv/plex-keys/PlexSign.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/plexmediaserver.gpg
echo 'deb https://downloads.plex.tv/repo/deb public main' | tee /etc/apt/sources.list.d/plexmediaserver.list
apt update
apt install plexmediaserverPlex Media Server will start automatically after installation.
During initial setup, which can take 5–15 minutes, CPU and RAM usage may spike to nearly 100%.
The router may become unresponsive during this time — just let it finish.
exitecho 'plexmediaserver' >> /opt/etc/chroot-services.listdebian restartAfter about 30 seconds, the Plex should be reachable at
<router-ip>:32400/web. For example:
Note: Plex library configuration may cause very high CPU and RAM usage.
During this process, the router's web interfaces and SSH may become unresponsive.
Once library configuration is complete, overall performance should return to normal.
Warning: This step may overwrite
/opt/etc/init.d/S99debian.
If this happens, repeat step 5 of the installation procedure to restore it.
debian enterPlex should be upgraded separately to prevent other packages from creating a problematic
systemdsymlink.
Alternatively – upgrade everything at once, then fix the symlink and reinstall Plex.
apt-mark hold plexmediaserver
apt update && apt upgrade -y[ -f /usr/sbin/init ] && ls -l /usr/sbin/init | grep -q systemd && mv -f /usr/sbin/init /usr/sbin/init.bakapt-mark unhold plexmediaserver
apt update && apt upgrade -yexit
debian restart