Sign up for BitLaunch today and quickly install Plex on Ubuntu 20.04.
If you have a large local media library you’ve probably heard of Plex – the platform that lets you quickly organize, curate, and stream your content to other devices. Though its used most commonly on local networks to seamlessly transcode and deliver TV and movies to different devices in the household, it’s also possible to use Plex to stream to a device when you’re away from home, or to your home from a remote Virtual Private Server (VPS).
Streaming Plex from a remote server has its disadvantages, namely that you’ll be using your internet bandwidth to download the content like any other streaming service rather than distribute it across your home network via your router. However, many consider the 24/7 uptime that a dedicated server enables to be well worth it, with VPS solutions even working out more affordable than home servers in some cases once you consider the electricity bill. You can check roughly how much power your PC would use here.
Whatever the use-case, we’re going to show you how to install Plex on Ubuntu 20.04, then configure it to your liking. Before you begin, you may want a few things to hand:
· An Ubuntu 20.04 machine, whether a VPS or local
· Your VPS credentials if relevant, including your server’s IP, username and password
· An SSH tool like PuTTy to connect to your VPS.
Install Plex on Ubuntu 20.04
In your console, download and install the latest Plex media server Ubuntu installer from the official site via wget. The versions below are the most recent at the time of writing, but you may want to check the website for the latest Plex media server download.
For Ubuntu 16.04+ machines with 64-bit Intel/AMD processors:
wget https://downloads.plex.tv/plex-media-server-new/188.8.131.5212-b23ab3896/debian/plexmediaserver_184.108.40.20612-b23ab3896_amd64.deb && sudo dpkg -i plexmediaserver\*.deb
For Ubuntu 16.04+ machines with 32-bit Intel/AMD processors:
wget https://downloads.plex.tv/plex-media-server-new/220.127.116.1112-b23ab3896/debian/plexmediaserver_18.104.22.16812-b23ab3896_i386.deb && sudo dpkg -i plexmediaserver\*.deb
Once Plex Media Sever has downloaded and installed, you’ll probably want to set it to run when your server boots for ease of use:
sudo systemctl enable plexmediaserver.service
You can then start the service without rebooting with:
**sudo systemctl start plexmediaserver.service**
Configure Plex Media Server on a VPS
The initial Plex media server configuration is done through its web interface, which simplifies the process greatly. First, though, you need to open an SSH tunnel to your server. On your local PC, open command prompt on Windows or another CLI if you're on a different OS, and enter the following, replacing the IP address with the IP of your VPS server and
root with its username:
ssh [email protected] -L 8888:localhost:32400
When prompted, enter your VPS password.
Now, in the browser on your local machine, enter:
Once you're faced with the above screen, you should log in with your Plex account or click Continue with Email, then Sign up with email if you don't yet have an account.
You'll be met with a screen explaining how Plex works, which you can read before pressing Got it. Plex will prompt you to you buy a Plex pass, but you can just click the 'x' in the top-right corner for now.
On the next screen, make sure Allow me to access my media outside my home is ticked, give your server a nicer name, and click Next.
Create your Plex library and add files to Plex media server
Now that the basic setup is complete, Plex will prompt you to set up your library. Before you do so, switch back to your PuTTy window and set up some folders so you can add files to Plex media server later:
mkdir -p plex-media/movies && mkdir plex-media/television && mkdir plex-media/music && && mkdir plex-media/photos && mkdir plex-media/othervideos
Now, back on your local machine, click the Add Library button.
Choose your media type, in our case, Movies. Give a custom name if required and press Next.
Click Browse for media folder and navigate to the folder you made. In our case this is in
/home/plex-media/movies. Click Add, then Add library.
Repeat the process for the other categories/folders and click Next.
On the final screen, click Done. By default, Plex will show a variety of copyright free content in these areas if you don't have any local files. To add files to Plex media server, simply upload them to the the relevant folder in your VPS via SFTP by [following our guide here](link to filezilla guide).
Disable DLNA and enable automatic library sync
For security reasons, you'll want to make sure DLNA is turned off on your server unless you plan to make use of it. Otherwise, it'll be open for connection to anyone who tries.
Start by clicking the wrench and screwdriver icon in the top-right corner of your browser.
Scroll down until you see the Settings heading in the left sidebar, then click DLNA and, in the main pane, untick Enable the DLNA server.
While we're here, there's a small quality of life change you may want to make: automatic library scanning. In the sidebar, click Library.
You can then tick the Scan my library automatically option, which will force Plex to check your folders for any new media once it detects that a file has been added to them.
You may also want to head to the Quality section under Plex web and set it to either Automatically adjust quality, or an option under the Video quality dropdown that suits your preferences.
Connect to your Plex Media Server from any device
Though you can currently access your Plex Media Server on your local PC, this is because we set up the SSH tunnel earlier. If you want to access it from any other device, you have a couple of options.
The recommended route it to download the Plex Media Player app, which can be found on the official website, under the Apps & Devices category. For convivence, here are the links for Windows, Mac, Android, and iOS.
Alternatively, you can watch Plex in your browser by visiting the server IP address, followed by
:34200/web. For example:
Log in with your Plex account, select your server, and watch as you would any other streaming service.