Install and Configure Plex Media Server on Ubuntu 22.04 LTS

0

Learn the simple commands to install Plex Media Server on Ubuntu 22.04 LTS Jammy JellyFish to create your streaming server.

Plex was started as a hobby project, but over time it has evolved into a professional streaming server software to handle various types of media files. Users can install and use it to access their videos, music and pictures remotely via the Internet or locally via a local network; even you can share them with friends on the go.

The basic version of Plex Media Server can be used for free, but it only has a limited range of functions. You can get additional features by purchasing Plex Pass for $4.99/month. As usual with paid subscriptions, the price decreases as the duration increases. The annual subscription costs $39.99 per year, whereas if you are already a Plex user and want a lifetime commitment, it offers a lifetime subscription for a one-time fee of $119.99.

What do you need to start?

Ubuntu 22.04 LTS Jammy JellyFish Server
At least one non-root sudo user
Active internet connection

1. Update APT Cache

First, we need to perform the system update on the Linux system before using its package manager. This will rebuild the system cache and also install any updates, if available. Along with this, install “CURL” as well.

sudo apt update

Along with this, install some tools that we need before doing any other configuration.

sudo apt install apt-transport-https curl

2. Add Plex Media Server repository on Ubuntu 22.04

User can directly download binary from Plex server to install on Ubuntu 22.04, however, the best way is to use its official repository. Here are the steps to add the repository:

Add a GPG key:

curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -

Then use the given command to add the repository:

echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list

Run System Update

sudo apt update

3. Command to Install Plex for Ubuntu Server 22.04

Once everything is set up, it becomes very easy to install Plex Media Server just by using the APT package manager. Here is the command :

sudo apt install plexmediaserver

When it asks you to update the Plex Media configuration file, tap Yes and hit it Enter key.

4. Check Plex Service Status

To confirm that the Plex media server is running fine in the background. Run the status command.

sudo systemctl status plexmediaserver

If it is not active, use the given command to start and activate it.

sudo systemctl enable --now plexmediaserver

5. Access the Plex Media Settings Web Page

Now, let’s access the web interface of the Plex Media Server to configure it further. To do this, simply open any web browser that can access the Ubuntu 22.04 server IP where you installed the Plex. The format is given below:

Complex server port the number is 32400

http://server-ip-address:32400/web

To note: Replace the server IP address with the IP address of your origin server.

Also, if you are using the firewall, open port 32400 in this case:

sudo ufw allow 32400

——————————————————————————-

For Ubuntu 22.04 remote server

If your Ubuntu is running on a remote server, to access the Plex configuration page for further configuration, open an SSH tunnel to drop the server on your local PC to access the Plex web configuration.

ssh remote-server-ip -L 8888:localhost:32400

Then, on your local machine, you can use:

http://localhost:8888/web

—————————————————————————–

6. Register your media server

Once you have the Plex Web, the user must register the server in the Plex account they have by logging in. If you don’t have an account with Plex, use any given method to register one.

Access the Plex Media settings webpage

You’ll see preview infographics showing how the Plex works. Well, just click the GOT IT! button to move forward.

Details of Plex Works

7. Pass Plex on Ubuntu 22.04

It’s an optional thing, if you want advanced feature subscribe to Plex pass plans, otherwise close it; because we can do it later.

Plex Pass on Ubuntu 22.04

8. Server Setup

To easily identify your media server on the network and in case you have multiple Plex servers under one account, give it a friendly name. Here we add –h2smedia. You can give whatever you want. Also, those of you who plan to access the Plex outside of your home network, remember to check the box given for “Allow me to access my media outside my homee”, if not selected by default.

H2smedia Ubuntu Media Server Setup

9. Add a media library

To add your media files for access through Plex, click the “Add a library” button.

Add a media library

Select the category of media files you want to add, such as Music, Photos, and Videos. Here we select Music.

Select Music Category Plrx on Debian server

Click on the “Multimedia Folder Browser“, then navigate to the folder where you have your audio files. Select it and then click the “Add a library” button. Add folders to your library To note: In case even after adding the media files, the same is not showing on the Plex web client to play, then give the rights of the folder where you have your content to the dedicated Plex user.

sudo chown -R plex:plex /media/your-content-folder/

To replace /media/your-content-folder/ with your current folder.

10. Plex Media Web Client

Once you’ve added the media files, you’ll have them on the Plex web client, either on your browser or on your devices. Other than that, we can also watch live TV, movies and shows, webcasts, and other content offered by the Plex itself. Most Popular TV Shows and Movies Plex LIVE TV

11. Nginx as a reverse proxy for Plex Media Server

Nginx is a web server and can also act as a reverse proxy to secure and give better performance to your web applications, here it is Plex Media server. In addition, its installation is super easy because the packages we need are already available in the Ubuntu 22.04 repository. Therefore, just run the given command:

sudo apt install nginx

Start and enable the Nginx service

To ensure that Nginx can start automatically on system crash or reboot, use the given command which not only starts its service but also marks it as enabled to start with system boot.

sudo systemctl enable --now nginx

To confirm service status:

systemctl status nginx

Create an Nginx configuration file for Plex

Once the Nginx is up and running, let’s create a configuration file that will tell the Nginx what is the IP address and port number where the Plex is running, and what port Nginx should use to display it on the Navigator ; so that the user can easily access it.

sudo nano /etc/nginx/conf.d/plexmediaserver.conf

Now copy-paste the lines below. In this change the Server name value to a fully qualified domain or if you only want to access the Plex via the IP address, instead of giving the domain name just use the IP address. For example Server name demo.how2shout.com change to the domain name you want to use. However, make sure that A record in your DNS already points to the IP address of your server where you installed the Plex. In another scenario, if you want to use the reverse proxy with only an IP address, instead of a domain name, remove the # and replace server-ip with your IP address.

server {
listen 80;
server_name demo.how2shout.com;
#server_name server-ip;

location / {
proxy_pass http://127.0.0.1:32400;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

#upgrade to WebSocket protocol when requested
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}

to safeguard the file by pressing CTRL+OPress the Enter key, then to exit, use: CTRL+X. To verify that the configuration file we created runs without errors:

nginx -t

After that, reload the Nginx service.

sudo systemctl reload nginx

Now open the browser and start accessing your Plex media server via domain name or IP address on default HTTP port 80.

12. How to update Plex Media Server – Ubuntu 22.04

Well, since we used the official Plex repository to install it on Ubuntu 22.04, we don’t have to do anything extra to update it. Running the simple system update and upgrade command will do its job.

sudo apt update 
sudo apt upgrade

13. Uninstall or remove Plex

Those who are no longer interested in this free media server can then completely remove it using the given commands:

sudo systemctl stop plexmediaserver
sudo apt remove plexmediaserver*

To delete your repository:

sudo rm /etc/apt/sources.list.d/plexmediaserver.list

To remove the Nginx server:

sudo systemctl stop nginx
sudo apt remove nginx*

This way we can install and use Plex Media Server on Ubuntu 22.04 Jammy JellyFish. To learn more, you can refer to the official Plex Knowledge page.

Other Items:

NGINX vs Apache: Comparison of Web Servers to Host Your Website
3 Ways to Install VLC Media Player on Debian 11 Bullseye Linux
Use the Snap Command to Install Plex Server on Ubuntu
Install Plex Media Server on Debian 11 Bullseye

Share.

About Author

Comments are closed.