What is plex?
Plex is a free media server and player software that you can use to organize, stream, and share your videos, photos, and music. Think of it as your own personal Netflix service for your media. You set up a Plex server and can then use the Plex client apps on your web browser, phone, TV, and more to access your media. See the official Plex video here for more details.
This guide will walk you through installing Plex, setting up remote access…I will be using an Ubuntu 16 server-minimal installation for this guide, but Plex is available for a very wide variety of devices and systems. The installation steps may vary some, but the management and access will be very similar across all options.
- A server to install Plex on
- (If your server does not have a GUI) A computer to configure Plex from the Web interface
- A basic knowledge of the command line.
Preparing Your Media
Plex organizes media into different ‘Libraries’. Each one is categorized as Movies, TV Shows, Music, Photos, or Other Videos. You cannot have a mixed media Library so the first step in organizing your media is to separate it out into different folders. You can also separate them out by Genre, Decade, or any other sorting you want. Just make sure that each one is entirely composed of one of the established media types.
Now, the reason Plex does not allow mixed media Libraries is because it uses what it calls ‘Agents’ to automatically identify and label your media. This lets it pull in metadata like Movie covers, release dates, etc. The way it does this is by matching the filenames of your media to the names of media in the Agent specified for each Library. It has a different Agent for each type of Library. If you have a mixed Library, say movies and tv shows, it would try to match them against the wrong Agent and either not find them or think they are something other than they are!
To ensure the best and most accurate matching, it is important to make sure your media is named appropriately as well. Movies should be named” [Movie Title] (release year)”. Example: “Avatar (2009).mp4”. This ensures it matches the correct version of the Movie, especially important when a Movie is rebooted!
TV shows are very similiar, they should be named “[Show Name] s[season number]e[episode number]”. Example: “Dexter s01e04.mp4”. TV Shows should also be organized with a top folder for the Show name and each season containing all the episodes for it’s respective season in their own folders. So You would have a TV shows Library with a Folder for Dexter, a folder for Weeds, etc. And each of those folders would then have a folder for Season 1, Season 2, etc. And finally each of those folders would contain the episodes for the season. This ensures they are matched properly and Plex recognizes the organization.
Music should be organized by album and named the same as the album.
Photos and Other Videos are not matched against an Agent.
Once you’ve organized your media, you’re ready to begin with Plex!
sudo dpkg -i plexmediaserver.deb
NOTE: Your package name will vary depending on the current version of Plex. Be sure to use the name of the package you downloaded or rename it to plexmediaserver.deb before using this command.
Once you’ve done that, Plex will be installed and running on your server! As part of the install process, Plex also enables its service so it will automatically start on server reboot.
Connect to the WEb Interface
ssh firstname.lastname@example.org -L 8888:localhost:32400
This will establish an ssh tunnel to the server. Essentially what it does is allow your local computer to connect to port 32400 on the Plex server from local port 8888. This appears to the server as if you’re connecting locally so you can still manage and configure it. If you’re on a Windows computer, you can use instructions like these to set up an SSH tunnel with Putty. Once you have the SSH tunnel set up, leave the terminal open and simply open a web browser to http://localhost:8888/web
Initial Plex Setup