Plex is a streaming media server that lets you organize your video, music, and photo collections and stream your media to your computer, phone, tablet, or TV at any time and from anywhere. Plex media server can be installed on all major operating systems and devices.
This article explains how to install Plex Media Serveron Ubuntu 20.04.
Installing Plex Media Server on Ubuntu #
Dec 23, 2021 Western. 200+ Free Live TV Channels Tune in anytime, on any device. Free Movies & Shows Stream 50,000+ titles on demand. Stream on Almost Any Device Download our free app to start. Pause, Save, Resume Keep your spot from screen to screen. Add Your Personal Media Organize & stream your own collection. What is Plex Media Server? Plex is one of the top media servers for streaming media content. It is a streaming and organization tool through which you stream content such as music, videos, podcast, games, and self-created content all in one place which makes plex a little different from others.
Plex is proprietary computer software, and it is not included in the Ubuntu repositories.
Installing Steam on Plex Media Server is fairly straightforward. We’ll enable the Plex official repository and install the package with
apt
. It requires no technical knowledge, and it should not take you more than 20 minutes to install and configure the media server.- Add the Plex APT repository to your system and import the repository’s GPG key:
- Once the repository is enabled, update the apt package list and install the latest server version:
- To verify that the Plex is running, check the service status:The output should look something like this:
That’s it. At this point, you have a Plex media server installed on your Ubuntu machine.
Adjusting the Firewall #
Now that Plex is installed and running on your server, you need to make sure the server firewall is configured to allow traffic on the Plex-specific ports.
If you do not have a firewall running on your system, skip this section.
If you are using
UFW
to manage your firewall, the easiest option is to create a UFW application profile:Save the file and update profiles list:
Apply the new firewall rules:
Finally, check if the new firewall rules are applied successfully with:
Configuring Plex Media Server #
Before starting the Plex setup wizard, you can first create the directories that will store the Plex media files:
The Plex Media Server runs as the user
plex
, which must have read and execute permissions to the media files and directories. To set the correct ownership, enter the following command:You can choose any location to store the media files; just make sure you set the correct permissions.
You can now proceed with the server configuration. Open your browser, type
http://YOUR_SERVER_IP:32400/web
, and you will be redirected to the plex website.For Plex to work properly, you will need to create an account.
Press the Google, Facebook, Apple, or Email button to create a free Plex account. If you want to access premium features, purchase a Plex Passplan.
Once you sign up, you will be redirected to the page with information about how Plex works, as shown below:
Click on the
Got it
button.On the next screen, enter your Plex server name, leave the
Allow me to access my media outside my home
box checked, and click Next
.The next step is to add a media library. Click on the
Add Library
button.When the popup window shows, select movies as library type and click
Next
.In the next step, click on the
Browse for media folder
and add the path to the directory that will contain the Movies media files, in our case /opt/plexmedia/movies
.Click on the
Add
button and then on the Add Library
.You can add as many Libraries as you want.
Click
Next
, then Done
, and you will be redirected to the Plex web dashboard.Now that you have completed the setup wizard, you can start exploring Plex options and all the things it can do.
Updating Plex Media Server #
When a new version is released, to update Plex, run the following commands in your terminal:
During the installation process, the official Plex repository may be disabled. To enable the repository, open the
plexmediaserver.list
file and uncomment the line starting with “deb”:Conclusion #
We have shown you how to install Plex Media Server on your Ubuntu 20.04 machine and create a Media Library.
You can now install the Plex application on your Android, iPhone, Smart TV, Xbox, Roku, or any other supported device. You can find a list of supported Apps & Devices on the Plex Downloadspage, or you can simply install the application from the device’s app store.
You should also check out the official Plex Quick-Startguide and Plex Documentationpage.
If you have any questions, please leave a comment below.
Mar 27, 2019
5 min read
Written by Tobias Hieta— March 27th 2019
We’ve been working on some big changes with regards to how we build Plex Media Server. Since we know many of you are interested in what goes on behind the scenes, we decided this was a great opportunity to lift the curtain a bit, get geeky, and talk about compilers and toolchains.
TL;DR: With the release of Plex Media Server version 1.15.0 we now build with LLVM Clang (except Windows) and manage our dependencies with Conan.
The Plex Media Server is a huge C++ codebase with many dependencies, which ships on many different devices and platforms. Here are a few stats:
- 1122: number of source files in the repository
- 292764: number of lines in those source files
- 50: number of third party dependencies needed to build the server
- 6: number of platforms we ship on (Linux, Windows, macOS, Android, iOS, FreeBSD)
- 19: number of configurations we build
- 1 hour 15 minutes: roughly how long it takes to build all configurations for a release
The C++ code base is around 11 years old. The first commit by Elan was on the September 20, 2008. Back then it was only built for macOS (well, “OS X”, back then) and did only a fraction of what the server can do today.
As the server grew, we expanded not only the functionality, but also the number of platforms we built for and ran on. Windows support was the first one that was added after macOS and it brought in support for Visual Studio. After this, Linux support was added and that opened the door for running the media server on NAS devices, which led to ARM support. Most NAS devices run on the ARM CPUs because of the lower cost and power needs, which in turn requires a ARM toolchain.
A few years back, we also expanded the server’s role to actually run inside our mobile clients as well. If you are running the Plex client on your iOS or Android device, you actually have a (very stripped down) version of PMS running inside there to help out with sync and offline features.
While all of that was great for expanding Plex to be available on more platforms, it led to a lot of complexity. Prior to our Clang conversion we built the server with 20 different toolchains and compilers. This quickly became unmaintainable:
- Different versions of the same compiler behave differently because of bug fixes and bugs.
- Upgrading to a modern C++ was almost impossible, since our oldest compilers had a lot of quirks and were a real pain to upgrade. In some cases the upstream toolchains never changed.
- Moving to other build slaves was really hard because almost all of the slaves had morphed into very delicate snowflakes, with hand-crafted configurations.
- In order to build for ARM platforms we resorted to a tool called scratchbox that ran the compiler and build system under a emulator. This made the configuration pretty straightforward but very slow and it was never updated for new targets like arm64 which hindered us from moving forward with new NAS devices based on that CPU.
- If we made a single change in any of the dependencies the system required a full rebuild of all dependencies for all platforms, making the compile process take hours.
On top of these configurations we used a python script to build all our dependencies — and even this script had morphed from its initial purpose and scope, which lead to a lot of problems when trying to adopt new platforms and technologies. We knew that replacing this script was the key to move to a more modern toolchain and unlock exciting things for the server team.
Instead of trying to rewrite our script and add to our maintenance burden we started to look around for dependency managers for C/C++. Unfortunately there isn’t a standard one around since the language was built way before the likes of NPM, PIP, and gems. After evaluating several tools we found one that could fit us.
Conan is a C/C++ package manager written in Python that can handle both source and binary dependencies. After some prototyping and concepts, we went ahead and started our conversion to use Conan for our dependencies. With Conan we are able to keep both our dependencies and toolchain in sync, in fact our whole toolchain is a Conan package that we can update the same way we update everything else.
Conan also supported cross-compiles fully, this made our build process faster and a lot more straightforward and we could get rid of CPU emulation and scratchbox.
If you would like to know more about how Plex integrates and uses Conan one of our engineers held a talk on the subject and it’s available on YouTube.
Not only did we need a framework for building our dependencies and other tools, we also needed a unified toolchain. We knew that we could never get away from all the issues we had unless we unified our C++ compiler. The choice here was actually much easier and straightforward than choosing our package manager. iOS, Android, and macOS have all selected LLVM Clang as their only compilers. So whatever we chose, we would have to use Clang on some platforms regardless.
Plex Media Server 4pda Windows 10
Luckily, Clang turns out to be a great choice for Plex. With GCC you need to build a specific toolchain per platform you target. So if we wanted to target macOS, Linux, and Android, we would need to build three different toolchains in order to get that to work. Clang on the other hand, is fully cross-compiling native, meaning you can target any platform from any platform, which drastically reduces the number of toolchains we need to work with. Clang is also very fast for building C++ code — we’ve been able to cut the time it takes to build the Server for some of the platforms by half. Clang generates very fast code as well, which can specifically be seen on lower powered devices like ARM and ARM64 devices, where the LLVM optimization pipeline is very advanced.
Starting with version 1.15.0, we now build Plex Media Server for all platforms except Windows with Clang (and our intention is to move the Windows build to Clang soon as well). In practical terms right now, this generally won’t have a huge impact at this point for you yet. The Server download is a bit smaller on some platforms, some performance will most likely be better on certain platforms, and we have support for a bunch of new ARM64 platforms.
Plex Media Server 4pda Download
For the future, it means that the server team will be able to bring you new features faster. In the near future we will upgrade our C++ standard to C++14 which brings a huge number of new features for our developers. The developers also have access to much more advanced tooling around building the server (for example Address and Memory Sanitizers). All this should lead to an even better, faster, and more stable Plex Media Server in the future.
With this release, we put months of hard work behind us and it feels fantastic to be able to bring these changes to our aging toolchain and to set the server up for another 11 years of development and customer-focused features.