Install Plex Media Server on Debian 11 Bullseye with Nginx Reverse Proxy

Learn the simple commands to install Plex Media Server on Debian 11 Bullseye Linux for creating your streaming server.

Plex was started as a hobby project but with time, it developed into a professional streaming server software to manage various types of media files. Users can install and use it to access their videos, music, and images remotely using the internet or locally over a local network; even you can share them with friends while on the move.

You will have the same feel as Netflix, as Plex creates matching thumbnails and loads information from film databases. However, Plex can’t keep up with major streaming providers like Netflix, Amazon Prime Video, Apple TV +, and Disney +. Nevertheless, it has not been developed to compete with them. The main goal of its developers is to provide an easy-to-use piece of software to general users or businesses who want to manage their database of films, photos, and songs either on NAS, Cloud, or any PC.

What platforms is the Plex Media Server compatible with?

Unlike other streaming software, Plex offers support to a wide range of operating systems such as Windows, macOS, Linux, FreeBSD, Docker, and various NAS.

How to stream media files from Plex Media Server on my smartphone or tablet?

To stream and enjoy your music, favorite films, and series on the go, you need the Plex app. That streams media files from your Plex server, the developers offer its client applications for almost all popular platforms such as android, iOS, Windows, and Linux including  Amazon Fire TV, Google TV, Playstation, Chromecast, and more.

Is the Plex Media Server free?

Yes, the software is free of charge but all functions are not. It offers a range of basic functions free of cost but for advance such as playing live TV programs, PlexSync, Dash Control, Hardware Transcoding, Media Download to watch offline,  advanced child protection settings, or setting up multiple user accounts for such services the user has to purchase a paid subscription.

Price and availability

If we talk about the Plex Media Server price, then as we discussed above it is free to install on our servers. However, it will have some limited functions that only can be activated after purchasing them.

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

Well, I think we already know enough about the Plex media server, let’s see how to install it on your own Debian 11 Bullseye server.

Steps to install Plex Media Server on Debian 11 Bullseye Linux

What do you need to get started?

Debian 11 Bullseye Server
A non-root sudo user at least
Active internet connection

Know more: You can also use the Use Snap command to install Plex Server on Ubuntu 20.04

 

1. Update APT cache

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

sudo apt update

Along with that install some tools we required before performing any further configuration.

sudo apt install apt-transport-https curl

 

2. Add Plex Media Server repository on Debian 11

The user can download directly the Debian binary of the Plex server to install it on Debian 11, however, the best way is to use its official repository. Here are the steps to add the repo:

Add GPG Key:

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

Next, use the given command to add the repo:

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 Debian 11 bullseye Server

Once we have everything set, it becomes very easy to install the Plex Media server just by using the APT Package Manager. Here is the command:

sudo apt install plexmediaserver

apt install Plex media server debian 11 bullseye

When it asks to update the Plex Media configuration file, then press Y and hit the Enter key.

 

4. Check Plex Service Status

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

sudo systemctl status plexmediaserver

If it is not active then use the given command to start and enable it.

sudo systemctl enable --now plexmediaserver

 

5. Access Plex Media Settings Web Page

Now, let’s access the web interface of the Plex Media Server to configure it further. For that simply open any web browser that can access the IP address of the Debian server where you have installed the Plex. The format is given below:

Plex server Port number is 32400

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

Note: Replace the server-IP address with your original server Ip-address.

Also, if you are using the Firewall, then open port 32400 in that:

sudo ufw allow 32400 

——————————————-Just for knowledge————————————-

Also, if you are setting up Plex on a remote Debian 11 Server then you can use SSH Tunnel to locally access and open Plex web setup.

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 has to register the server in the Plex account he or she owns by logging in. If you don’t have an account with Plex, then use any given method to register one. 

Register your Plex Server

You will see a glimpse of Infographics showing how the Plex Works. Well, simply click on the GOT IT! button to move forward.

Setup Plex server on Debian 11 Bullseye

7. Plex Pass

This is an optional thing, if you want some advanced feature then subscribe to Plex pass plans, otherwise close it; because we can do this later.

Plex Pass Buy

 

8. Server Setup 

To identify your Media server easily over the network and in case you have multiple Plex servers under a single account, give some user-friendly name to it. Here we are adding –h2smedia. You can give whatever you want.

Further, those of you who are planning to access the Plex outside their home network, also don’t forget to select the box given for “Allow me to access my media outside my home”, if not selected by default.

Give name to your Server

 

9. Add Media Library

To add your media files for accessing them through Plex, click on the “Add Library” button.

Add Library Musisc and Videos

Select the category of Media files that you want to add such as Music, Photos, and Videos. Here we are selecting Music.

Select Music Category Plrx on Debian server

Click on the “Browser for Media Folder” button and then navigate to the folder where you have your Audio files.  Select that and then click on the “Add Library” button.

Add folders to your Library

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 Plex dedicated user.

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

Replace /media/your-content-folder/ with the your actual folder.

 

10. Plex Media Web Client

Once you have added the media files, you will have that on the Plex Web-based client either on your browser or devices. Apart from that, we can also watch Live TV, Movies & Shows, Web shows, and other content offered by the Plex itself. 

Most Popular TV showx and movies LIVE TV Plex

 

11. Use Nginx as reverse Proxy for Plex Media Server on Debian 11

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

sudo apt install nginx

Start and enable Nginx service

To make sure the Nginx could start automatically if crashed or on system reboot, use the given command that not only start its service but also mark it enable to start with system boot.

sudo systemctl enable --now nginx

To confirm the service status:

systemctl status nginx

 

Create 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 Ip-address and the port number where the Plex is running, and what port Nginx must use to show it on the browser; so that the user can access it easily. 

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

Now, copy-paste the below-given lines. In this change the server_name value to either fully qualified domain or if you want to only access the Plex via the Ip-address then instead of giving domain name just use IP-address. 

For example:

server_name demo.how2shout.com change it whatever domain name you want to use. However, make sure A record in your DNS is already pointed towards your server-IP-address where you have installed the Plex.

In another scenario, if you want to use the reverse proxy with only IP then 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";
}
}

Save the file by pressing Ctrl+O, Hit the Enter key, and then to exit use: Ctrl +X.

To check the configuration file we have created is error-free run:

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 the default HTTP 80 port.

12 .How to update Plex Media Server on Debian 11

Well, as we have used the official repository of Plex to install it on Debian, we don’t need to do anything additional to update it. Running the simple system update and upgrade command will do its work.

sudo apt update 
sudo apt upgrade

 

13. Uninstall or Remove Plex from Debian Linux

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

sudo systemctl stop plexmediaserver
sudo apt remove plexmediaserver*

To remove its repo:

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

To remove the Nginx server:

sudo systemctl stop nginx
sudo apt remove nginx*

In this way, we can install and use Plex Media Server on Debian 11 Bullseye. To know more information about it, you can refer to the official Plex Knowledge page.

 

Other Articles:

NGINX vs. Apache: Comparision of web servers to host your website
3 Ways to Install VLC Media Player on Debian 11 Bullseye Linux

 

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.