Plex Media Server is a versatile digital media player that allows you to host and access multiple online content channels from non-local sources. It is compatible with various platforms, including Windows, Linux, FreeBSD, and OS X. With Plex Media Server, you can aggregate all your media files stored on your computer and enjoy instant access on all your devices.
Prerequisites
Before setting up Plex Media Server on Debian 11, there are a few requirements you need to fulfill:
- RAM: It is recommended to have at least 2GB of RAM for smooth operation under Linux.
- Hard Disk Drive: Allocate a minimum of 3GB of available disk space for installation, plus additional free space for channel storage.
- Processor: A processor with at least 2 GHz Core is recommended for optimal performance.
- Root access: Make sure you have root access to your Linux machine to install new software.
Updating the System
To begin the installation process, it is crucial to update your Debian 11 system to ensure that all packages in your repositories are up-to-date. Open the terminal and enter the following command:
sudo apt update && sudo apt upgrade -y
Once the update is complete, install the required dependencies by running the following command:
sudo apt install unzip socat libexpat1 apt-transport-https -y sudo apt install wget software-properties-common -y
Installing Plex Media Server on Debian 11
Since the Plex Media Server package is not available in the Debian 11 base repository, we need to add the Plex repository to download and install it. Follow the steps below:
- Import the GPG key to the APT keyring for verifying the authenticity of the Plex repository:
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add-
- Add the Plex repository as a source to your system:
echo deb https://downloads.plex.tv/repo/debpublic main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
- Update the repository package lists:
sudo apt update
- Install the Plex Media Server:
sudo apt install plexmediaserver -y
Once the installation is complete, start and enable Plex to ensure it starts on boot:
sudo systemctl start plexmediaserver && sudo systemctl enable plexmediaserver
To verify that Plex is running properly, use the following command:
sudo systemctl status plexmediaserver
The output will display the process ID, whether it is running in the foreground or background, and how long it has been running.
Configuring the Firewall
To enable communication and client connections for Plex Media Server, you need to configure your firewall to allow traffic on port 32400. Follow the steps below:
- Allow traffic on port 32400 for all interfaces:
sudo ufw allow 32400
- Verify the changes by checking the firewall’s status:
sudo ufw status
The status should indicate that port 32400 is allowed from any interface, ensuring that you can access the Plex Media Server from any client on your network.
Configuring Plex Media Server
After installing Plex Media Server, it’s time to configure it and set up the necessary settings. Access the Plex Web App Admin Console by entering your server’s IP address followed by port 32400 in your browser’s address bar. For example, if your server’s IP address is 192.168.0.10, enter the following URL:
http://192.168.0.10:32400/web/
Alternatively, you can search for Plex Media Manager in your application menu on your Debian 11 server.
Once you reach the login screen, use your existing Google or social media accounts to log in. After logging in, you will be directed to the Plex initial setup page. If you haven’t done so already, proceed with the initial Plex setup by going to server_ip:32400/web/index.html#!/setup and follow the on-screen prompts.
Configuring NGINX Reverse Proxy for Plex
To enable remote access for Plex Media Server, it is recommended to set up a reverse proxy server using NGINX. NGINX is a high-performance HTTP server and reverse proxy server that can handle incoming client requests. Follow the steps below to configure NGINX:
- Install the NGINX web server:
sudo apt install nginx -y
- Start and enable NGINX:
sudo systemctl start nginx && sudo systemctl enable nginx
Verify the installation by checking the status of NGINX:
sudo systemctl status nginx
- Create a new Nginx virtual host configuration file for Plex:
sudo nano /etc/nginx/conf.d/plex.conf
- Add the following lines to the Plex Nginx configuration file:
server {
listen 80;
server_name plex.your-domain.com;
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";
}
}
Replace plex.your-domain.com with your chosen domain name. Save and close the file.
- Check the Nginx configuration for syntax errors:
sudo nginx -t
Fix any warnings or errors before proceeding.
- Reload Nginx for the changes to take effect:
sudo systemctl reload nginx
You can now access Plex Media Server from any client on your network using the domain name you assigned to Plex.
Conclusion
Setting up Plex Media Server on Debian 11 allows you to conveniently organize and access your media content from various devices. With its multi-platform support, local media playback, remote access, and photo library features, Plex offers a comprehensive media streaming solution.
In this guide, you have learned how to install Plex Media Server on Debian 11, configure the necessary settings, and set up a reverse proxy server using NGINX. By following these steps, you can create a seamless media streaming experience within your home network.
For reliable and high-performance Linux SSD VPS hosting services, consider Shape.host. Shape.host offers a range of hosting solutions designed to meet your specific needs. Visit Shape.host to explore their services and take your media streaming experience to the next level.