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.
The requirements here are pretty simple as most of this will be using the Plex web GUI. You do need a few things to get started:
- 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
Before we get to Plex setup, we need to make sure the server and media is set up in a way that Plex understands. This means making sure the media is named appropriately and organized in the right folder structure.
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!
Before we get Plex installed, we first need to set up an account with Plex. As mentioned, Plex is free so you don’t have to worry about paying for anything. If you would like to support Plex, however, you can sign up for a ‘Plex Pass’ and get access to updates a little sooner and some extra features. The core functions and everything included in this guide does not require a Plex Pass however.
To set up your account, go to Plex.tv and click ‘Sign Up’. Enter your email, username, and password, then just click ‘Create Account’ and you will be immediately logged into the app. We’ll return to this later,b ut for now, you can close out of it and go to your server instead.
Before we can install Plex we need to get the package to install it. All we need to do for this is head to the Plex website and download the installation package.
In short, to get Plex, simply head here
, click the download button, and choose the appropriate download for your server. For this guide, we will be using Ubuntu Server version 16.04 so we choose Download -> Linux -> Download -> Ubuntu 64 bit.
Once the package is downloaded, get it onto your server. You can use scp, sftp, or any other transfer method to get it onto your server. You can also copy the download link and then use wget to download it directly to your server. After you’ve got the package on your server, simply use the appropriate command to install it based on your operating system or distribution. For our Ubuntu server, the command is simply
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
Now that we’ve got Plex installed, we need to claim the server. If your server has a GUI, open up a web browser and navigate to http://localhost:32400/web. Skip to the next section if you are setting it up this way!
If, like me, you installed Plex on a server without a GUI you can configure an SSH tunnel to configure it from a different computer. Run this command from a terminal on a Mac or Linux computer to configure the Plex server from it:
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
When you first connect to the Plex Web interface, you will be prompted to log in. Enter your Plex account credentials and click ‘Sign In’.
After signing in, Plex walks you through some initial configuration and asks if you want to join their Plex Pass program. We’re going to skip this for now, but be sure to take a look and see if the extra features are something you’d be interested in.
The first step you’re prompted with is naming your server. You can leave this as something generic if it’s going to be your only server and only you will be using it. I suggest being a little more descriptive if you plan on having multiple servers or if you plan to share your media library with any friends/family. I’m going to name my server Sean-Lab for now. There is also a checkbox on this page to have Plex attempt to automatically configure your network to allow remote access. I suggest leaving this checked although we will cover the manual setup later.
The next step is adding your first Media Library. As discussed in Preparing Your Media above, each Library needs to be a disticnt type of media. For this guide, I’m just going to create two Libraries, one for Movies and one for TV Shows. To create one, simply Click ‘Add Library’, select the type of Media, Enter a Name (or leave the default ‘Movies’ or ‘TV Shows’ if you only want one of each), click Next, then Click Browse for Media Folder and select the location of your media, then click Add Library. We won’t worry about any of the advanced settings in this guide. After you’ve set up your Libraries, click Next, then click Done.
Plex Remote Access
Now that you’ve set up your Libraries, you technically have a working Plex server. If the automatic setup for remote access from earlier worked properly, you’re done! You have a working Plex server that can be accessed remotely. To check this, click on the Settings
button in the top right (looks like a Wrench crossed over a Screwdriver). From here go to the Server tab and click on Remote Access from the side menu. If the automatic setup worked, you should see this at the top of the page:
You can then test this by logging in to Plex.tv
from any computer or device not on your servers network and click ‘Launch’ to have it launch the web app where you can browse your Libraries and play your media. If it connects to the server properly, then you’ve got remote access working!
If it does not, you may need to manually set up port forwarding to enable remote access. The exact process for this will vary based on your router. You can find instructions for most variations from here
. You want to enable a port for Plex (default 32400) to go direct to your Plex Server. Depending on your server you may also need to open this port in the firewall. Once you’ve done those steps, check the box to Manually specify public port (be sure to also specify the port if you used anything other than the default 32400) and click Apply.
After this, you’ll have full access to your Plex server from anywhere with an internet connection! Simply login to Plex.tv and click Launch or use the app on any of the many supported devices.
That’s it! You’ve got your Plex server setup and it is accessible from the internet. You can now start adding and watching your media with your own Netflix-like service! Keep an eye out for followup guides where I’ll cover advanced usage, such as channels, sharing, and custom Agents. I’ll also have a guide on converting your media, scripted backups, and more!
Sources / Resources
Plex has great documentation at their Support Site. See their Quick Start for more information. Much of this guide is based on the information there.