Plex Media Server install, configure and deploy on Ubuntu Linux Server

plex server install

Plex Media helps you to stream all of your stuff on any device anywhere in the world. Plex Media Server is a free software. Once you install it on your device, it starts scanning and indexing media. Plex Media Server makes your media to look intuitive and beautiful in an organized manner in Plex library.

Plex Media Server supports a big range of file types. You will simply need to sign up and download Plex Media Server, add media and start streaming files. Either you want to watch episodes or you want to watch movies, Plex Media Server makes it easy for you to watch anything on any device. It helps you to stream different music files and access your music tracks on any device.

Plex Media Server is a best solution to store high quality pictures so that these can be loaded faster. You can use Plex VR to enjoy interactive virtual reality. You can even watch together and host your family and friends for a best movie experience.

Plex Media Server provides a beautiful interface and a big range of features. It provides privacy and security to its users. You can use Plex app on your tablet or phone to control any Plex player.

Plex Media Server supports 4K. It allows you to sync contents from your library to your cloud storage and helps you to enjoy when your Plex Media Server is offline. Plex also allows you to sync photos, music and videos to your mobile device. It provides Plex Pass Perks where you get exclusive access to discounts and promos on partner products.

Plex Media Server allows you to see timed lyrics for your favorite songs so that you can karaoke. You can enjoy Mood Mix and Plex Mix playlists based on your mood. Plex Media Server allows you to create optimized versions of your media files for buffer-free and smooth streaming. It helps you to find lost files in your library by recommendations and discovery. You can share your photos and videos to your friends and family.

Plex Media Server provides you the feature to create photo albums and share your memories. It helps you to automatically upload videos and photos from your mobile device to your Plex Media Server at home. Plex Media Server uses advanced machine learning and scene recognition to automatically add tags to your photos using location.

Plex Media Server gives you a timeline view to explore your beautiful photos. It provides you the feature to create separate accounts for childish roommates. Plex allows you to enable parental controls. It allows you to enjoy behind the scenes features, deleted scenes, cast interviews and much more. You can watch trailers of movies.

With Plex Media Server, you can watch TV without any cable network. You will need Plex Pass, antenna and tuner to stream free OTA live TV. You can record videos from HD broadcast with Plex DVR. Plex Media Server allows you to playback with intuitive voice commands.

Plex Media Server is a centralized server which helps you to access your content from anywhere in the world. It provides personalized and comprehensive news experience. It supports almost all the types of file formats including a big range of photos and video formats, 4K devices and hi-fi music. In Live TV, it has 100+ local channels, 70+ supported counties and 80% major networks. Plex Media Server allows you to voice chat while watching the movie.

It supports all the major platforms including Windows, Linux, OS X, Nvidia Shield TV, Synology Disk Manager, unRAID, Netgear, QNAP, Drobo, Western Digital, ASUStor, Seagate, PlayStation and Xbox.

Recommendation of Server

As a developer, I prefer the services of Alibaba Cloud ECS. Alibaba Elastic Compute (ECS) is highly scalable and flexible. You can upgrade the hardware resources anytime when required. Alibaba Cloud can also provide you technical support and assistance in order to launch any kind of system. You can also get cheap servers from WebSoft IT Development Solutions (Private) Limited.

In this tutorial, I will be using Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed on it. I will install and setup Plex Media Server.

Prerequisites:

  1. ECS must have at least 2GB RAM and 2 Core processor (2.4 GHz or higher).
  2. Domain name must be pointed to your domain IP address.
  3. You should setup your server’s hostname.
  4. Access to VNC console in your Alibaba Cloud or SSH client installed in your PC.
  5. Login as root user and create user with root privileges.

Before you start:

You must create an account on https://www.plex.tv/features/ to get downloading link for the installation of Plex Media Server.

Update your Ubuntu System

Before proceeding with installation of any kind of package, use the following command to update your Ubuntu system. To execute this command, remember to login from non-root user with sudo privileges. After execution of this command, you will be prompted to Is this ok? Type ‘y’ and hit Enter key.

Step 1:

# sudo apt update && sudo apt upgrade

How to install Plex Media Server?

You will need to download Plex Media Server. Always remember to get the latest version of Plex Media Server, otherwise, after login, you will not be able to find your server and you will see errors. To download this, follow the steps below.

Step 1:

To download Plex Media Server copy, execute the following command.

# wget https://downloads.plex.tv/plex-media-server/1.13.5.5332-21ab172de/plexmediaserver_1.13.5.5332-21ab172de_amd64.deb

The above link may be changed when you install Plex, so keep in mind to get the link for latest release of Plex from official website.

Step 2:

Now de-package the downloaded .deb file by executing the command below.

# sudo dpkg -i plexmediaserver_1.13.5.5332-21ab172de_amd64.deb

Step 3:

Now start and enable Plex Media Server so that on rebooting system, Plex Media Server can start automatically.

To enable execute the command below.

# sudo systemctl enable plexmediaserver.service

To start execute the command below.

# sudo systemctl start plexmediaserver.service

How to setup Plex Media Server?

Now you will need to create SSH tunnel to your Alibaba Cloud ECS. To do so, open terminal from your Linux installed laptop and execute the following command to connect to your server.

# ssh your_username@alibaba_cloud_ecs_ip_address -L 8888:localhost:32400
plex media server

Now you will be able to access Plex Media Server via browser installed in your laptop as shown below. Use URL http://localhost:8888/web

plex media server index page

Now you will be asked to login using your Plex Media Server account credentials. After login, you will be redirected to the following screen.

Plex-Media-server-how-it-works

Now click Got IT! to proceed further.

plex-media-server-plex-pass

Click on X on right above side to close this. Plex Pass is required when you are interested in using premium services like TV, mobile sync, exclusive forum access, trailers and extras etc. After closing it, you will see the following screen.

plex server setup

Remember to tick allow me to access my media outside my home and hit Next button, you will be redirected to following screen.

plex-setup-media-library

Now click next and you will be redirected to the following screen.

get-plex-apps

Click Done to proceed further.

Setup firewalls

If you have activated firewalls, you will have to define a rule for your server to add exception for port 80/tcp, 443/tcp and 32400/tcp.

You may refer to Firewall UFW article.

How to install Nginx on Ubuntu Linux?

To install Nginx server, execute the command below.

# sudo apt-get install -y nginx

Now start and enable nginx server so that on system reboot, it can start automatically. To do so, execute the commands below.

# sudo systemctl start nginx
# sudo systemctl enable nginx

On successful installation, you will see the following screen.

nginx-server-ubuntu-linux

How to install Node.JS on Ubuntu Linux?

To install Node.js, execute the command below.

# sudo apt-get install nodejs

How to setup reverse proxy on Nginx server?

In this step, you will setup reverse proxy to access Plex Media Server so that you can access it via domain name without using any port in the end of address. To do so, execute the following command to create a nginx configuration file using nano editor.

# sudo nano /etc/nginx/conf.d/Plex.conf

Now add the following text in the opened file and save it.

server {
  listen 80;
  listen [::]:80;

  server_name softpedia.xyz;

  location / {
      proxy_pass http://localhost:32400/;
  }
}

Restart nginx server using the command below.

# sudo systemctl restart nginx

Now you can access your Plex Media Server via your Alibaba Cloud ECS IP address or domain name pointed to IP address. After accessing, you will be redirected to dashboard where you can add media files to your server.

plex-media-server-dashboard

In the end, you will have to create directories for TV and movies within a parent directory to store media files.

Navigate to home.

# cd ~

Create directories:

# mkdir -p plex-media/movies && mkdir plex-media/television

How to install software-properties-common on Ubuntu Linux?

Software-properties-common package is required to get the supported files for installation of SSL. In order to install software-properties-common package, follow the steps below.

Step 1:

To install software-properties-common execute the command.

# sudo apt-get install software-properties-common -y 

How to install SSL Certificate on Ubuntu?

To install SSL certificate using Let’s Encrypt SSL, follow the steps below.

Step 1:

Update your system by executing command below.

# sudo apt-get update

Step 2:

Install software-common-properties.

Add certbot repository using PPA by executing command below.

# sudo add-apt-repository ppa:certbot/certbot

Step 3:

Update your system by executing command below.

# sudo apt-get update

Step 4:

Now install python-certbot-nginx using the command below.

# sudo apt-get install python-certbot-nginx

Step 5:

Now issue SSL certificate to your domain by executing the command below.

# sudo certbot --nginx -d softpedia.xyz

Step 6:

Restart nginx server using the command below.

# sudo systemctl restart nginx

Now you can see, your Plex Media Server is working fine and SSL certificate has been installed successfully.

plex-media-server-dashboard

Congratulations…!!! Here you go…you have successfully installed and configured Plex Media Server.

Author: Arslan ud Din Shafiq

Alibaba Cloud MVP, Alibaba Cloud Technical Author, Dzone MVB, Software Engineer, Software Developer, Software Designer, Web Engineer, Web Developer, Web Designer, Database Designer, Database Developer, Cloud Computing Specialist, Linux Expert, Servers, 3D Modeling, Blogger, Facebook Map Editor, Google Map Editor

Leave a Reply

Your email address will not be published. Required fields are marked *