Installing Plex Media Server on Daphile (Gentoo/OpenRC)

Amir YuristaAmir Yurista
3 min read

TL;DR – On Daphile beta you get SSH, so you can shell in, grab the latest .deb from Plex’s site, unpack it with ar, drop it into /opt, add an OpenRC init script (escape those spaces), and stream away. Future upgrades are the same dance in fast-forward.


Prerequisites – SSH into Daphile

StepNote
1. Upgrade to a Daphile beta buildStable releases have SSH disabled. Grab the latest beta ISO/IMG from https://www.daphile.com/firmware/ and update (Settings → System → Install/Upgrade).
2. Log inssh root@<daphile-ip> (default password: zaq).

1 . Prepare your toolbox

emerge --sync          # refresh Portage
emerge --ask binutils  # provides `ar` for .deb extraction

Already have ar? Check with which ar; skip the emerge if it’s present.


2. Fetch the current Plex package

  1. Browse to https://www.plex.tv/media-server-downloads.

  2. Choose Plex Media Server → Linux → Ubuntu (16.04+) / Debian.

  3. Copy the direct download link (it ends in .deb).

  4. wget "<paste-url>" on your Daphile box – or:

PLEX_DEB_URL="https://downloads.plex.tv/plex-media-server-new/<version>/debian/plexmediaserver_<version>_amd64.deb"
wget "$PLEX_DEB_URL"

(Replace <version> with whatever Plex lists today.)


3. Crack open the .deb

ar x plexmediaserver_*.deb    # → control.tar.xz  data.tar.xz  debian-binary
tar -xvf data.tar.xz          # unpacks usr/lib/plexmediaserver/

4. Relocate Plex to /opt

mv usr/lib/plexmediaserver /opt/

Why /opt? Vendor code stays out of /usr and won’t clash with Gentoo packages.


5. Create an OpenRC service

nano /etc/init.d/plexmediaserver
#!/sbin/openrc-run

description="Plex Media Server"
command="/opt/plexmediaserver/Plex\ Media\ Server"   # escape spaces!
pidfile="/var/run/plexmediaserver.pid"
command_background="yes"

depend() {
    need net
}
chmod +x /etc/init.d/plexmediaserver

6. Enable & start Plex

rc-update add plexmediaserver default   # autostart on boot
rc-service plexmediaserver start        # launch now

Verify:

rc-service plexmediaserver status

7. First-run wizard

Open:

http://<daphile-ip>:32400/web
  1. Sign in (or create) your Plex account.

  2. Name your server.

  3. Add libraries, wait for indexing, stream!


Upgrading Plex later

  1. Stop the service

     rc-service plexmediaserver stop
    
  2. Back up (optional but smart)

     tar -czf /root/plex_backup_$(date +%F).tar.gz /opt/plexmediaserver
    
  3. Download the new .deb
    Repeat the “Fetch” step with the new URL.

  4. Extract & overwrite

     ar x plexmediaserver_<new>.deb
     tar -xvf data.tar.xz
     rsync -a usr/lib/plexmediaserver/ /opt/plexmediaserver/
    
  5. Start Plex

     rc-service plexmediaserver start
    

Troubleshooting

ProblemFix
start-stop-daemon: /opt/plexmediaserver/Plex does not existCheck the path and ensure spaces are escaped in the init script.
ar: command not foundemerge --ask binutils (or ensure /usr/bin/ar exists).
No UI on port 32400Confirm the service is running (rc-service plexmediaserver status -v); check firewall settings.

0
Subscribe to my newsletter

Read articles from Amir Yurista directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Amir Yurista
Amir Yurista