- installed Entware
- SWAP enabled (2GB or more recommended)
* steps are optional.
this can significantly improved the performance of the Plex Media Server
# check current value of swappiness
cat /proc/sys/vm/swappiness
# change swappiness on runtime and persists it after reboot
echo 10 > /proc/sys/vm/swappiness
echo 'echo 10 > /proc/sys/vm/swappiness' >> /jffs/scripts/post-mount
opkg install coreutils-sha256sum debootstrap binutils perlbase-autodie
mount -i -o remount,exec,dev /opt/..
debootstrap --variant=minbase --arch=arm64 bookworm /opt/debian/ http://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/S99debian
by default, all subdirs of
/tmp/mnt/
(except the Entware partition) will be bind-mounted on chrooted Debian's/mnt/
(making them visible to Plex Media Server)
skipping this step, newly attached USB drives will be accessible from Debian (and thus Plex Media Server) only after rebooting the router or manually executing
debian restart
/debian enter
via SSH
prerequisite:
JFFS custom scripts and configs
enabled (router WebUI -> Administration -> System
)
wget -O /jffs/scripts/mount-debian.sh https://raw.githubusercontent.com/bbeny123/Plex_Asuswrt-Merlin/main/mount-debian.sh
chmod 755 /jffs/scripts/mount-debian.sh
echo './jffs/scripts/mount-debian.sh' >> /jffs/scripts/post-mount
touch /opt/etc/chroot-services.list
chmod 755 /opt/etc/chroot-services.list
ln -s /opt/etc/init.d/S99debian /opt/bin/debian
cp /etc/hosts /opt/debian/etc/
debian enter
apt update && apt upgrade -y
apt install -y apt-transport-https curl gnupg procps
dpkg-reconfigure tzdata
[ -f /usr/sbin/init ] && ls -l /usr/sbin/init | grep -q systemd && mv -f /usr/sbin/init /usr/sbin/init.bak
curl -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 plexmediaserver
After installation, the server will start automatically.
During initialization (which will take about 5-15min) CPU/RAM usage will be close to 100%.
The server will be almost unusable during this time so I recommend just waiting it out.
exit
echo 'plexmediaserver' >> /opt/etc/chroot-services.list
debian restart
After about 30 seconds, the server should be reachable at: <router-ip-address>:32400/web like:
When configuring libraries, CPU/RAM consumption will also be close to 100%.
Web-panel and Debian will be unresponsive during this time.
After configuring the libraries and downloading the metadata, the Plex Media Server should start working well.
- https://hqt.ro/how-to-install-debian-stretch-arm/ (accessed by The Wayback Machine)
- https://www.hqt.ro/plex-media-server-on-asuswrt-armhf-routers/ (accessed by The Wayback Machine)
- https://www.snbforums.com/threads/asus-rt-ac86u-and-debian-bullseye-nextcloud.79428/
This step may overwrite
/opt/etc/init.d/S99debian
file.
In such a case, step 5) of the installation procedure will need to be performed again.
debian enter
[ -f /usr/sbin/init ] && ls -l /usr/sbin/init | grep -q systemd && mv -f /usr/sbin/init /usr/sbin/init.bak
apt update && apt upgrade -y
exit
debian restart