To answer you first question: Plex can be installed without the OS RasPlex installed (RasPlex is actually a client, not a server).
All that is needed is Raspbian (I did it on Jessie 8), and a few instructions to be followed, which are included below. I have down this 4 times, and has worked every time. A note for those who may be oblivious: This will not support transcoding, as it is not a powerful server, so make sure all of your media is encoded in the appropriate codec for multi-device playback [usually an MP4 or similar].
Note: ensure you have formatted the external hard drive in one of the following ways: NTFS, exFAT, or Extended Linux.
When you are done, you may want to run sudo shutdown -r
for a reboot.
Requirements
1 x Raspberry Pi - Min requirements: ARM7 processor or better
1 x WiFi Network connection, or Ethernet Connection (if wifi is embedded [like 0W or 3] don't worry about it)
1 x External Hard Drive or NAS formatted in a UNIX friendly FileSystem
Remote or local access to the server.
Automounting the Drive
To mount the drive on boot, it is recommended that you use fdisk. This allows the system to perform the action before anything else is active. Before going forward, you must understand that this is not permanent, but could cause problems if there are programs dependant on this drive.
sudo apt-get install exfat-fuse exfat-utils
Before you go forward, also create a mount point. Mine is located at /mnt/PlexPi, but yours may be different. To create this point, type sudo mkdir /mnt/PlexPi
. For automount, see below.
The output from the first command should be something like shown below. Enter sudo blkid
via ssh or terminal, and be sure to not the UUID of the drive you are trying to mount.
sudo blkid
/dev/mmcblk0: PTUUID="00001911" PTTYPE="dos"
/dev/mmcblk0p1: LABEL="RECOVERY" UUID="F5FB-98A4" TYPE="vfat" PARTUUID="00001911-01"
/dev/mmcblk0p5: LABEL="SETTINGS" UUID="39bcd392-8eb8-4530-8da7-37d508c8a059" TYPE="ext4" PARTUUID="00001911-05"
/dev/mmcblk0p6: LABEL="boot" UUID="AE51-DDD6" TYPE="vfat" PARTUUID="00001911-06"
/dev/mmcblk0p7: LABEL="root0" UUID="b7c4cfb7-eaa7-43ff-9ee2-e5536b471cf1" TYPE="ext4" PARTUUID="00001911-07"
/dev/mmcblk0p8: SEC_TYPE="msdos" UUID="E03C-0DFA" TYPE="vfat" PARTUUID="00001911-08"
/dev/mmcblk0p9: UUID="32e5cf65-1035-4301-9665-7da79a7647e8" TYPE="ext4" PARTUUID="00001911-09"
/dev/sda1: LABEL="PlexPi" UUID="5979-4B91" TYPE="exfat"
Note the UUID of the last drive, which will be mounted at /dev/sda1 if it is the only one, then enter sudo nano /etc/fstab
to edit the file for automounting. The file should look something like this:
proc /proc proc defaults 0 0
/dev/mmcblk0p6 /boot vfat defaults 0 2
/dev/mmcblk0p7 / ext4 defaults,noatime 0 1
UUID=5979-4B91 /mnt/PlexPi exfat defaults,auto,umask=000,users,rw 0 0
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
Note that the UUID of my drive has been copied to the /etc/fstab
file above the commented # a swapfile is not a swap partition, no line here
, beside it, use the tab key to add the mount point (mine is /mnt/PlexPi, but yours can be different). Press control x to exit, then Y to save the nano document. Based on the format of the drive, (mine is exfat, yours may be different), add that beside the mount point after a tab, then add the rest defaults,auto,umask=000,users,rw 0 0
SMB Mounts
# install samba
sudo apt-get install samba samba-common-bin
# to use hfs+ file-system
sudo apt-get install hfsprogs
Create folder in the /mnt/ folder so that you can mount your network share in that folder:
$sudo mkdir mountfoldername
Two Ways to access
2.1 Guest Share
sudo mount -t cifs -o guest //WindowsPC/share1 /mnt/mountfoldername
Tip: If your share has space then run the following command, notice the quotes
sudo mount -t cifs -o guest "//WindowsPC/Share 1" /mnt/mountfoldername
2.2 Password Protected Share
sudo mount -t cifs -o username=yourusername,password=yourpassword //WindowsPC/share1 /mnt/mountfoldername
Now to check that its mounted , run the following command
$ df -h
Returns something like
Filesystem Size Used Avail Use% Mounted on
rootfs 7.3G 2.0G 5.0G 29% /
/dev/root 7.3G 2.0G 5.0G 29% /
tmpfs 19M 228K 19M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 37M 0 37M 0% /tmp
tmpfs 10M 0 10M 0% /dev
tmpfs 37M 0 37M 0% /run/shm
/dev/mmcblk0p1 56M 36M 21M 64% /boot
//WindowsPC/share1 1.9T 1.5T 390G 80% /mnt/mountfoldername
Notice the last line
Now you can access the contents by traversing the following path
$ cd /mnt/mountfoldername
Now if we reboot we need to again mount this network share.
To Automount the network shares everytime on boot follow on
We need to edit the /etc/fstab file, Run the following command to edit the /etc/fstab file
$sudo nano /etc/fstab
Append the following to the /etc/fstab file
For Guest Login
//WindowsPC/Share1 /mnt/mountfoldername cifs guest 0 0
For Password Protected Login
//WindowsPC/Share1 /mnt/mountfoldername cifs username=yourusername,password=yourpassword 0 0
- Save the File and run the more command to check if the file is updates
$more /etc/fstab
Returns something like
proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot vfat defaults 0 0
/dev/mmcblk0p2 / ext4 defaults,noatime 0 0
# a swapfile is not a swap partition, so no using swapon|off from here on, use dphys-swapfile swap[on|off] for that //WindowsPC/Share1
/mnt/mountfoldername cifs guest 0 0
Now Reboot and check that your network share is auto mounted with the following command
$ df -h
Returns
Filesystem Size Used Avail Use% Mounted on
rootfs 7.3G 2.0G 5.0G 29% /
/dev/root 7.3G 2.0G 5.0G 29% /
tmpfs 19M 228K 19M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 37M 0 37M 0% /tmp
tmpfs 10M 0 10M 0% /dev
tmpfs 37M 0 37M 0% /run/shm
/dev/mmcblk0p1 56M 36M 21M 64% /boot
//WindowsPC/Share1 1.9T 1.5T 390G 80% /mnt/mountfoldername
Notice the last line here
To UnMount
$sudo umount //WindowsPC/Share1
Installing Plex
Enter the following commands, one after the other until you have completed the list.
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get install apt-transport-https -y --force-yes
wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add -
echo "deb https://dev2day.de/pms/ jessie main" | sudo tee /etc/apt/sources.list.d/pms.list
sudo apt-get update
sudo apt-get install -t jessie plexmediaserver -y
sudo shutdown -r
The Pi will now reboot, and will be available in around 45 seconds.
Setting Up Plex
Navigate a web browser to http://localhost:32400/web/ if you are on the pi, or to http://raspberrypi.local:32400/web/ if it is in your home network. The web interface will guide you from here.
All Plex updates can be done by running plexmediaserver-installer
in the command line.
A Simple Redirector
If you are wanting it so people can just go to http://raspberrypi.local to access the site, you could whip together an html document that auto redirects to the Plex address. I have included how to do this below
Install Apache 2
sudo apt-get update && sudo apt-get install apache2 -y
If you are running Jessie, there is a bit of a difference of where your webserver will hold its data. In Wheezy it is located at /var/www
, Jessie locates it at /var/www/html
Go to whichever directory by typing cd path/to/directory
then type sudo rm -rf index.html
.
While in this directory, create a new file called "index.html". You may do this by typing sudo nano index.html
, then adding the content located in code below. All links may be edited.
index.html
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1; url=http://raspberrypi.local:32400/web/">
<script type="text/javascript">
window.location.href = "http://raspberrypi.local:32400/web/"
</script>
<title>Page Redirection</title>
</head>
<body>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow this <a href='http://raspberrypi.local:32400/web/'>Plex</a>
</body>
</html>
Now run sudo service apache2 restart
Closing Notes:
For any reason, should you want to shut down Plex, you can either just stop it, or remove it by running sudo service plexmediaserver stop
or sudo apt-get autoremove --purge plexmediaserver
for complete removal.
If you want to stop the redirector, you may type sudo service apache2 stop
, or you can just remove it by running sudo apt-get autoremove --purge apache2
after running the stop command. Both of these will start on boot.
If you are going to use this as a low power server for while on the go, do not login.
Sources:
Personal Experience, Samba instructions Raspbain Jessie 8