Remote streaming with Plex by using sshfs

What is Plex?

image

Plex is an amazing piece of software that pretty much gives you your own personal Netflix. You can take your own video files and have Plex stream them to their many clients on different platforms (Roku, Android, iOS, Web).

The common setup for Plex is to have one computer on your local network running Plex and have your Plex clients connect to that. My problem was that my files were not local and on a remote server.

How the library is populated

For Plex to actually work, you have to tell it where your media files are on the server. Plex has a nice web interface making easy to configure:

image

So using this interface you can point Plex to any directory on your machine and tell it search there for media files.

The remote file problem

I have a remote server that has a couple media files that I would like Plex to stream. The manual way is to just copy over the files from the remote server to the local machine then have Plex stream it from there.

This is annoying and time consuming depending on the bandwidth between the local and remote machine.

Lets just use sshfs

Network mounted directories to the rescue! For the simplicity sake, I just used sshfs to mount my remote directory so that Plex thinks that its a local directory.

First install sshfs and fuse

$ sudo pacman -S sshfs fuse

Create a local directory that you will mount the remote location to:

$ mkdir /mnt/remote

Then update your /etc/fstab

/etc/fstab

#
# /etc/fstab: static file system information
#
/dev/sda1 / ext4 rw,relatime,data=ordered0 1
<USERNAME>@<HOST>: /mnt/remote  fuse.sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/<PATH>/<TO>/<YOUR>/<PRIVATE_KEY>,allow_other,reconnect 0 0

See here for more detailed documentation.

Done

And there you go no more needing to copy over the files locally, you have instant access to your files on your remote server. Barring your have enough bandwidth to your remote server