How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

 

This tutorial will likely be displaying you set up Plex media server on Ubuntu 20.04 LTS server/desktop. Plex is a free piece of software program that means that you can set up your films, TV exhibits, music and images in a single stunning interface and stream these media information in your PC, pill, cellphone, TV, Roku, and so forth on the community or over the Web. Plex might be put in on Linux, FreeBSD, MacOS, Home windows and varied NAS techniques.

Set up Plex Media Server on Ubuntu 20.04

First, go to Plex server obtain web page, (You will want to log into your Plex account.) choose Linux and select Ubuntu (16.04+) / Debian (8+)with 32-bit or 64-bit.

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

If you will set up Plex on a headless Ubuntu 20.04 server, then you may go to your browser’s obtain historical past, then copy the Plex obtain hyperlink and use wget to obtain Plex from command line like under.

wget https://downloads.plex.television/plex-media-server-new/1.19.3.2843-e3c1f7bcd/debian/plexmediaserver_1.19.3.2843-e3c1f7bcd_amd64.deb

As soon as the Plex deb package deal is downloaded, cd to the obtain listing. For instance, my Plex is downloaded to the Downloads listing underneath Residence, so I run the next command. The tilde (~) represents dwelling listing.

cd ~/Downloads

On Debian based mostly Linux distros (Ubuntu, Linux Mint, and so forth), dpkg is the usual command-line instrument to put in deb packages. So run the next command to put in the Plex deb package deal.

sudo dpkg -i plexmediaserver_1.19.3.2843-e3c1f7bcd_amd64.deb

The -i is brief for –install. Be aware that while you sort the next

sudo dpkg -i plex

You’ll be able to press the Tab key, which can autocomplete the filename.

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

Now Plex media server is put in. We are able to test its standing with:

systemctl standing plexmediaserver

As you may see, it’s working on my Ubuntu 20.04 system. (Press q key to take again management of terminal.)

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

If Plex media server isn’t working, you can begin it with:

sudo systemctl begin plexmediaserver

Allow Plex Repository

By enabling the official Plex repo, you may replace Plex on Ubuntu with apt package deal supervisor. The Plex deb package deal ships with a supply listing file. To see a listing of information put in from a package deal, run dpkg with -L flag.

dpkg -L plexmediaserver

Open this file with the next command.

sudo nano /and so forth/apt/sources.listing.d/plexmediaserver.listing

By default, its content material is commented out. Uncomment the final line. (Take away the start # image).

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

Then save and shut the file. To save lots of a file in Nano textual content editor, press Ctrl+O, the press Enter to verify. To exit, press Ctrl+X. After that, run the next command to import Plex public key to apt package deal supervisor.

wget -q https://downloads.plex.television/plex-keys/PlexSign.key -O – | sudo apt-key add –

Now replace software program repository index.

sudo apt replace

Plex Media Server Preliminary Setup

If you happen to run the next instructions:

suduo apt set up net-tools

sudo netstat -lnpt | grep Plex

You’ll be able to see that Plex media server is listening on 0.0.0.0:32400 and 127.0.0.1:32401.

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

The net-based administration interface is offered at port 32400. The primary time you configure Plex, you will need to go to Plex through 127.0.0.1:32400/internet or localhost:32400/internet. If you happen to put in Plex in your Ubuntu 20.04 desktop, then you may search Plex Media Supervisor in your utility menu. It’ll take you to Plex internet interface, which in flip will take you to https://app.plex.television as a result of you have to check in with a plex.television account.

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

Be aware that if Plex is put in on a distant Ubuntu 20.04 server, you have to arrange a SSH tunnel by executing the next command in your native pc. Substitute 12.34.56.78 with the IP handle of the distant Ubuntu server.

ssh 12.34.56.78 -L 8888:localhost:32400

Then you may entry Plex internet interface through the next URL.

http://localhost:8888/internet

This HTTP request will likely be redirected to http://localhost:32400/internet on the distant server via SSH tunnel. This SSH tunnel is barely wanted for the preliminary setup. After the preliminary setup, you may entry Plex internet interface through server-ip-address:32400. Substitute server-ip-address along with your actual server IP handle.

As soon as signed in, you’ll be redirected to localhost:32400 to do the preliminary setup. If you happen to don’t see the setup wizard, you may enter localhost:32400/internet/index.html#!/setup within the handle bar to launch it.

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

On the subsequent display screen, enter a reputation in your Plex server. Ensure that Permit me to entry my media exterior my house is checked. Then click on Subsequent.

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

Now you may add libraries. Click on Add Library button.

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

Choose a library sort, then click on browse for media folder button so as to add your media folders.

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

Be aware that the plex consumer must have learn and execute permission in your media directories. For instance, my 2T exterior onerous drive is mounted underneath /media/linuxbabe/ , which is owned by root. Customers not in group root can’t entry it, so I run the next command to present consumer plex learn and execute permission. (I don’t advocate altering possession with chown or chgrp command. Utilizing the setfacl command will suffice.)

sudo setfacl -m u:plex:rx /media/linuxbabe/

You might also must assign permission on particular person media directories like under.

sudo setfacl -m u:plex:rx /media/linuxbabe/directory-name

It may be tempting so as to add the recursive flag (-R), which supplies plex learn and execute permission on each file and sub-directory on the drive.

sudo setfacl -R -m u:plex:rx /media/linuxbabe/

In case your exterior onerous drive is barely used for storing media information, then you are able to do so, however in case you have delicate information on the exterior onerous drive, don’t do it.

When you end including your media folders, click on Subsequent after which click on Accomplished. You’ll be able to all the time add extra libraries later.

Redo the Preliminary Setup

If you happen to made a mistake within the preliminary setup, you may delete the Preferences.xml file and begin it over.

sudo rm /var/lib/plexmediaserver/Library/Utility Assist/Plex Media Server/Preferences.xml

sudo systemctl restart plexmediaserver

Now go to localhost:32400/internet once more. Plex will let you know there’s an unclaimed server. Click on declare it now.

Create Nginx Reverse Proxy

If you happen to don’t have an actual area identify, I like to recommend going to NameCheap to purchase one. The value is low and so they give whois privateness safety free for all times.

If you happen to choose to make use of a website identify slightly than typing http://localhost:32400 to entry your Plex media server, then you have to arrange a reverse proxy. We are able to use Nginx for this objective. Set up Nginx from the default Ubuntu software program repository.

sudo apt set up nginx

Then create a server block file for Plex.

sudo nano /and so forth/nginx/conf.d/plex.conf

Put the next traces into the file. Substitute plex.instance.com with your personal area identify. Bear in mind to create an A file for the sub-domain in your DNS supervisor. (In case your ISP offers you a dynamic IP handle slightly than a static IP handle, you have to arrange dynamic DNS and port forwarding, or use PageKite. )

server {
hear 80;
server_name plex.instance.com;

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

#improve to WebSocket protocol when requested
proxy_set_header Improve $http_upgrade;
proxy_set_header Connection “Improve”;

}

Save and shut this file. Then check Nginx configuration.

sudo nginx -t

If the check is profitable, reload Nginx for the change to take impact.

sudo systemctl reload nginx

Now you may entry Plex media server through plex.instance.com.

Create Apache Reverse Proxy

If you happen to choose Apache over Nginx, then set up Apache internet server through the use of the next command.

sudo apt set up apache2

To make use of Apache as a reverse proxy, we have to allow the proxy modules and the header module.

sudo a2enmod proxy proxy_http headers proxy_wstunnel

Then create a digital host file for Plex.

sudo nano /and so forth/apache2/sites-available/plex.conf

Put the next configurations into the file. Substitute plex.instance.com along with your precise area identify. Don’t overlook to create DNS A file for this sub-domain.

ServerName plex.instance.com
ErrorDocument 404 /404.html

#HTTP proxy
ProxyPass / http://localhost:32400/
ProxyPassReverse / http://localhost:32400/

#Websocket proxy
SSLProxyEngine on

ProxyPass wss://localhost:32400/:/websockets/notifications
ProxyPassReverse wss://localhost:32400/:/websockets/notifications

Header all the time unset X-Body-Choices

Save and shut the file. Then allow this digital host.

sudo a2ensite plex.conf

Restart Apache

sudo systemctl restart apache2

Now you may entry Plex media server utilizing the area identify.

Allow HTTPS

To encrypt the HTTP site visitors while you go to Plex server from exterior, we will allow HTTPS by putting in a free TLS certificates issued from Let’s Encrypt. Run the next command to put in Let’s Encrypt shopper (certbot) on Ubuntu 20.04.

sudo apt set up certbot

If you happen to use Nginx, you then additionally want to put in the Certbot Nginx plugin.

sudo apt set up python3-certbot-nginx

Subsequent, run the next command to acquire and set up TLS certificates.

sudo certbot –nginx –agree-tos –redirect –hsts –staple-ocsp –email [email protected] -d plex.instance.com

If you happen to use Apache, then you have to set up the Certbot Apache plugin.

sudo apt set up python3-certbot-apache

Subsequent, run the next command to acquire and set up TLS certificates.

sudo certbot –apache –agree-tos –redirect –hsts –staple-ocsp –email [email protected] -d plex.instance.com

The place:

  • –nginx: Use the nginx plugin.
  • –apache: Use the Apache plugin.
  • –agree-tos: Comply with phrases of service.
  • –redirect: Drive HTTPS by 301 redirect.
  • –hsts: Add the Strict-Transport-Safety header to each HTTP response. Forcing browser to all the time use TLS for the area. Defends towards SSL/TLS Stripping.
  • –staple-ocsp: Permits OCSP Stapling. A legitimate OCSP response is stapled to the certificates that the server presents throughout TLS.

The certificates ought to now be obtained and mechanically put in.

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

And you’ll entry Plex internet interface through HTTPS.

How to install Plex Media Server on Ubuntu 20.04 LTS Server / Desktop Server

Easy methods to Improve Plex on Ubuntu 20.04

When a brand new model of Plex media server comes out, you may improve it by executing the next instructions.

sudo apt replace

sudo apt improve

Then restart Plex.

sudo systemctl restart plexmediaserver

I hope this tutorial helped you put in Plex media server on Ubuntu 20.04. As all the time, should you discovered this submit helpful, then subscribe to our free e-newsletter to get extra suggestions and tips. Take care 🙂

Fee this tutorial

[Total: 1 Average: 5]

plex media server command line,plex media server download,reinstall plex ubuntu,ubuntu media server,add plex media server,install plex media server on elementary os,plex media server 64-bit,plex app ubuntu