Install Plex Media Server on Debian 11 Bullseye with Nginx reverse proxy

0

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

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

You will have the same feel as Netflix, as Plex creates corresponding thumbnails and loads the information from the movie databases. However, Plex cannot keep up with major streaming providers like Netflix, Amazon Prime Video, Apple TV +, and Disney +. Nevertheless, it was not developed to compete with them. The main goal of its developers is to provide easy to use software for general users or businesses who want to manage their movie, photos and song database on NAS, Cloud or any PC.

What platforms is the Plex Media Server compatible with?

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

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

To stream and enjoy your favorite music, movies, and shows on the go, you need the Plex app. Who streams media files from your Plex server, the developers offer their client apps for almost all popular platforms like Android, iOS, Windows, Linux including Amazon Fire TV, Google TV, Playstation, Chromecast, etc. .

Is Plex media server free?

Yes, the software is free, but not all functions. It offers a range of free but advanced basic functions such as live TV program playback, PlexSync, Dash Control, hardware transcoding, media download to watch offline, advanced child protection settings or configuration of multiple user accounts for these services. must purchase a paid subscription.

Pricing and availability

If we talk about the price of Plex Media Server, as we saw above, its installation on our servers is free. However, it will have limited functions that can only be activated after purchasing them.

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, while if you’re already a Plex user and want a lifetime commitment, it offers a lifetime subscription for a one-time fee of $ 119.99.

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

What do you need to get started?

Debian 11 Bullseye server
At least one non-root sudo user
Internet connection active

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

1. Update the APT cache

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

sudo apt update

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

sudo apt install apt-transport-https curl

2. Add the Plex Media Server repository on Debian 11

The user can directly download the Debian binary from the Plex server to install it on Debian 11, however, the best way will be 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

Perform system update

sudo apt update

3. Command to install Plex for Debian 11 bullseye Server

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

sudo apt update plexmediaserver

When prompted to update the Plex Media configuration file, press Yes and hit the Enter key.

4. Check the status of the Plex service

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

sudo systemctl status plexmediaserver

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

sudo systemctl enable --now plexmediaserver

5. Go to the Plex media settings web page

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

Plex 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 original server.

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

sudo ufw allow 32400 

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

Additionally, if you are setting up Plex on a remote Debian 11 server, you can use the SSH tunnel to access locally and open 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 Plex Web, the user needs to register the server in the Plex account they have when logging in. If you don’t have an account with Plex, use a given method to register one.

Register your Plex server

You will see an overview of the infographics showing how the Plex works. Well just click GOT IT! button to advance.

7. Plex pass

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

Buy Pass Plex

8. Server configuration

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.

Additionally, those of you who plan to access the Plex outside of your home network, also remember to check the “Allow me to access my media outside of my homee “, if it is not selected by default.

Give your server a name

9. Add media library

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

Add music and videos to the library

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

Select the Plrx music category on the Debian server

Click on the “Browser for media folder”Then navigate to the folder in which you have your audio files. Select it, then click on the “Add library” button.

Add folders to your library

To note: In case that even after adding the media files the same is not displayed 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 Multimedia Web Client

Once you’ve added the media files, you’ll have them on the Plex web client on your browser or devices. Apart from that, we can also watch live TV, movies and shows, web shows and other content offered by the Plex itself.

Most Popular TV Shows & Movies LIVE TV

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

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. Moreover, its installation is super easy as the packages we need are already available in the Debian 11 repository. Therefore, just run the given command:

sudo apt install nginx

Start and activate the Nginx service

To make sure that Nginx can start automatically in the event of a system crash or restart, use the given command which not only starts its service but also enables it to start with system startup.

sudo systemctl enable --now nginx

To confirm the status of the service:

systemctl status nginx

Create an Nginx configuration file for Plex

Once Nginx is up and running, let’s create a configuration file that will tell Nginx what the IP address and port number Plex is running on, and which port Nginx should use to display it on the browser; 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 want to only access the Plex through the IP address then instead of giving the domain name just use the IP address.

For example:

Server name demo.how2shout.com change it whatever domain name you want to use. However, make sure A The record in your DNS is already pointed 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 + O, press the Enter key, then to exit, use: Ctrl + X.

To verify the configuration file we created, run without error:

nginx -t

After that, reload the Nginx service.

sudo systemctl reload nginx

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

12. How to update Plex Media Server on Debian 11

Well, since we used the official Plex repository to install it on Debian, we don’t have to do anything more 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 from Debian Linux

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

sudo systemctl stop plexmediaserver
sudo apt remove plexmediaserver*

To delete your deposit:

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 Debian 11 Bullseye. To know more about this, you can refer to the official Plex Knowledge page.

Other articles:

NGINX vs Apache: Comparison of web servers to host your website
3 ways to install VLC Media Player on Debian 11 Bullseye Linux

Share.

Comments are closed.