Personal Privacy

Login Advanced Search
     General TopicsSelf Hosted ServicesServer Setup

Plex Media Server

Installing Plex

Install Plex using

echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
sudo apt-get -y install curl
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install plexmediaserver

Accept the default if asked for options.

sudo ufw allow 32400/tcp
sudo ufw reload

Go to the internal IP address of your server on a browser SERVER_IP_ADDRESS:32400/web
Login to Plex (or create an account if you do not have one. Go to Library and add the media files you have.

Issuing SSL Certificates

You may need to stop apache/nginx before being able to install the let’s encrypt certificate using:

sudo systemctl stop apache2
sudo systemctl stop nginx
sudo certbot certonly --standalone --agree-tos -m admin@website.com -d plex.website.com

Then select
2 Automatically use a temporary webserver (standalone)
Don’t forget to start the apache/nginx afterward!

sudo systemctl start apache2
sudo systemctl start nginx

Make sure you do the port forwarding for 32400 on you router. Then run

sudo openssl pkcs12 -export -out ~/certificate.pfx \
-inkey /etc/letsencrypt/live/plex.arashbox.com/privkey.pem \
-in /etc/letsencrypt/live/plex.arashbox.com/cert.pem \
-certfile /etc/letsencrypt/live/plex.arashbox.com/chain.pem

Next, you'll be asked to enter a password to encrypt the .pfx file. Enter a password you won't mind saving in the Plex settings in plaintext.

sudo mv ~/certificate.pfx /var/lib/plexmediaserver
sudo chown plex:plex /var/lib/plexmediaserver/certificate.pfx
IMIPORTANT: After every letsecnrypt renewal, these steps must be repeated! Otherwise, you will receive a certificate date error.

Visit the Plex UI on your server: https://plex.website.com:32400
Go to Settings (icon on top right corner), then Server (tab), then Network (left navigation column).
Click "SHOW ADVANCED" to see the necessary fields.
Enter the following values:

Save your changes.

sudo systemctl restart plexmediaserver
Note: If any problem with loading items, on the web GUI, click on the library options and force DB optimization.

Buy me a coffe?!


Comments

No comments yet!
Add a new comment:

9