Using Plex Media Server on a Raspberry PI 3

I am currently experimenting to create a cheap Plex Media Server running on a Raspberry Pi 3!

I am aiming to share my media to my chromecast and my smartphone. So that I can play my music everywhere or turn off my PC when watching a TV Show.

I followed this guide:

Install Raspbian

Raspbian is easily installed! Download the latest lite version: At the moment of writing, Raspbian Stretch Lite was used.

On windows, I prefer Etcher to burn the image on an SD card This may help you if you don’t know how to do it.

After loading the image, connect your usb keyboard and hdmi monitor so you can get started with your Pi 3! Now connect the power and see it boot up!

SSH not working?

Already twice I’ve experienced SSH not working with a Connection refused exception in putty.

The problems lies with the host certificate used for ssh and the solution is to remove them and generate them again:

sudo rm /etc/ssh/ssh_host_* && sudo dpkg-reconfigure openssh-server


To use ntfs usb stick I had to install ntfs-3g:

sudo apt-get install ntfs-3g

Then I could use ntfs-3g as a type:

Spin down the hard disk

I tried this guide but unfortunately my old external hard drive doesn’t really support spinning down. I am also not certain if it really ads value.

Let’s install Plex!

Best to begin with updating your Raspbian installation!

sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get update && sudo apt-get dist-upgrade

Install Plex:

sudo apt-get install apt-transport-https -y --force-yes
wget -O - | sudo apt-key add -
echo "deb stretch main" | sudo tee /etc/apt/sources.list.d/pms.list
sudo apt-get update
sudo apt-get install -t stretch plexmediaserver-installer -y

Now restart your PI:

sudo reboot

After figuring out your ip, you should be also to surf to Plex: and register your new server!


Raspbian cheat sheet

My own cheat sheet for commands I often use. It’s a work in progress.

See CPU Temperature
/opt/vc/bin/vcgencmd measure_temp
List hard disks
sudo blkid
sudo reboot -n
sudo shutdown -h now
Upgrade your installed packages
sudo apt-get update
sudo apt-get upgrade
See available disk space
df -h

Mount a usb drive or hard disk on Raspbian

What’s the best way to auto mount a usb drive or hard disk? What if the filesystem is ntfs?

To get a list of connected usb disks you can:

sudo blkid

In the screenshot above you can see there are two usb devices:

  • /dev/sda1: UUID=”E89484EA9484BC96″ TYPE=”ntfs” PARTUUID=”008ffb75-01″
  • /dev/sdb1: LABEL=”Extern station” UUID=”92FA278AFA2769A5″ TYPE=”ntfs” PARTUUID=” 0009a8db-01″

To be able to use these devices, you have to mount them in a folder. Let’s create two folders:

sudo mkdir /mnt/usb1
sudo mkdir /mnt/hd1

The usb1 folder I’ve created for my usb stick. The hd1 folder for my external hard drive.

We need to take ownership of these folders:

sudo chown -R pi:pi /mnt/usb1
sudo chown -R pi:pi /mnt/hd1

If any of the usb devices is formatted in ntfs, you best install ntfs-3g:

sudo apt-get install ntfs-3g

You best test if mounting is successful, this is the easy way:

sudo mount -o uid=pi -o gid=pi -t ntfs-3g /dev/sda1 /mnt/hd1

I once had a problem with ntfs-3g that was solved by updating everything:

apt-get update
apt-get dist-upgrade
apt-get rpi-update

Now let’s edit our file system table, so that the usb stick & external hard drive are mounted every time the system boots:

sudo nano /etc/fstab

As you can see in the screenshot above I’ve used the disk UUID as name to find it. This way, if you unplug your usb flash drive and put it in another usb port, it still works. As type, make sure to use ntfs-3g.

Now you just need to reboot and the disks are both mounted!

sudo reboot