Build Your Own Netflix and Pandora With Raspberry Pi 3

2408

Do you have a huge collection of movies, TV shows, and music that you purchased over the years but it’s collecting digital dust on your hard drives? How about creating your very own Netflix- and Pandora-like setup using the free Plex Media Server software? No, you don’t have to buy an expensive, bulky PC. All you need is a Raspberry Pi 3, a hard drive, an SD card and a mobile charger. It should all cost less than $100.

What you need:

  • PC or laptop

  • Raspberry Pi 3

  • Micro SD card

  • A powered hard drive

  • 5v 2A power supply for Pi

  • Monitor, HDMI cable, keyboard and mouse (only for initial setup)

  • I also recommend a heat sink for Pi chips as multimedia consumption does make them hot

  • Ethernet cable (optional)

I will be using it in a headless manner, but we do need a monitor with an HDMI cable for initial setup.  On your PC/laptop, download the ‘NOOBS’ distribution installer from the official site. It’s a zip file, which you’ll extract using the unzip command.

Insert the Micro SD card and format it as FAT32 using Gnome Disk Utility.

gztF3kGsoByxxfjYXA_D-hfRAiwxGF1CqjNnb155

Then, change directory to the Micro SD card:

cd /path_of_USB

And unzip the NOOBS file into the Micro SD card:

unzip PATH_OF_NOOBS

In my case it was:

unzip /home/swapnil/Downloads/NOOBS_v1_9_2.zip

Just ensure that all the content of the NOOBS folder is in the root directory of the Micro SD card.

Now plug the monitor, keyboard and mouse into the Pi, insert the Micro SD card and connect the power supply. The system will boot up to NOOBS where you can choose the operating system you want to install. Choose Raspbian. Once the installation is finished, it will reboot into your brand new Raspbian OS. It will also automatically resize the file system to use all available space on the SD card.

If you can use an Ethernet cable, I would recommend that because it will give you faster speed compared to the WiFi on board. If not, then use the WiFi utility in Raspbian to connect to the wireless network. Once you are online, open the terminal and run the following command to find the IP address of your Pi:

if config

Once you have the IP address, open the terminal on your PC/laptop and ssh into your Pi:

ssh pi@IP_ADDRESS_OF_PI

The default password for the Pi is raspberry. If you want to change the password, run the following command and enter the new password after the prompt:

passwd pi

Now let’s update the system before we install Plex. This is a best practice for all fresh distro and software installations

sudo apt-get update

sudo apt-get dist-upgrade

Once updated, connect the external hard drive to your Pi using one of the USB ports. It’s best to use a hard drive that has been formatted in the ext4 file system for better compatibility with Linux. Mount it and create an entry in the ‘fstab’ so that it auto mounts between reboots.

Now it’s time to install Plex Media Server. We are using packages created by a third-party developer so let’s add their GPG key:

wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key  | sudo apt-key add - 

Now add repos to the source list file:

echo "deb https://dev2day.de/pms/ jessie main" | sudo tee /etc/apt/sources.list.d/pms.list

Now update the system:

sudo apt-get update

And then install Plex Media Server:

sudo apt-get install -t jessie plexmediaserver -y

Now run it:

service plexmediaserver star

That’s it. You have Plex Media Server running on your Raspberry Pi 3.

Set up your media server

Plex Makes it extremely easy to set up your Plex Media Center. Now you need to point your Plex Media Center towards the media files: movies, music, and TV shows. You can do it from any PC in your local network. Just type this address into a web browser, filling in your own Pi’s IP address:

IP_ADDRESS_OF_PI:32400/web/index.html#

In my case it was:

10.0.0.26:32400/web/index.html#

This will open the Plex Media Server interface. The greatest feature of Plex is metadata that it pulls from the internet and attaches to your media files. But it’s extremely important to categorize your media otherwise Plex won’t detect it. So create these folders on your hard drive and store appropriate media inside the folders: movies, tv_shows, music, home_videos, photos.

Now copy movies to the movies folder, TV shows to the tv_shows folder, any videos that you take from your phone or camera to home_video folder, and so on. If you copy TV shows or home videos to movies or vice versa, those files won’t show up on Plex and you won’t be able to play them.

Once you have taken care of your media files, open the movie tab on the Plex Media Center interface and browse to add the movies folder from your hard drive. Repeat the step for each media type. Once done, give Plex some time to scan and process those files.

eEAS8rVfeHCjfwrG6m4StFGLCsBYG9MYfUp2s4k3

Another interesting thing that you can do with your Plex is add online video channels such as CNN, PBS, and History.… Just go to the ‘Channels’ option and install channels that you like. Now all of these channels, in addition to your movies, tv shows, music and photos are accessible through your Plex server running on the Pi.

w5N1FC1GJEqk2PlUcc2VyXBX9VakE3SZ4Yal7wjR

Access your Plex Media Server

There are many ways to access your Plex Media Center:

1. If you are on the local network open this URL in the web browser:

IP_ADDRESS_OF_PI:32400/web/index.html#

In my case it was:

10.0.0.26:32400/web/index.html#

It will open the Plex Media Player interface, just log into your media server and start playing content. You can also manage your Plex Media Server from this interface.

2. You can access your Plex Media Server from mobile devices using the official Plex app that’s available for both Android and iOS.

3. Or you can set up a Plex Media Player device (such as RasPlex) and turn any HDMI-enabled TV into your very own entertainment system. (See the next tutorial on how to do this!)

If you want to be able to access Plex outside of your home network then you can purchase PlexPass which allows you to stream your content across devices over the Internet. Because Plex also remembers playback history and where you are in any content, you can also add family members, just like Netflix, so that you can maintain your own viewing history.

All of this for just under $100, and you got to build it yourself. Isn’t it fun?

Read the other articles in the series:

5 Fun Raspberry Pi Projects: Getting Started

How to Build a Minecraft Server with Raspberry Pi 3

Turn Raspberry Pi 3 Into a Powerful Media Player With RasPlex

For 5 more fun projects for the Raspberry Pi 3, including a holiday light display and Minecraft Server, download the free E-book today!