How to Install a Plex Media Server on Alibaba Cloud

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud’s incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

Plex is a free software that lets you to stream all of your stuff on any device anywhere in the world. It supports a wide range of file types and supports all the major platforms including Windows, Linux, and OS X.

In this tutorial, we will be installing and setting up a Plex media server on an Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.

Prerequisites

  • You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get $300 — $1200 worth in Alibaba Cloud credits for your new account. If you don’t know about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 2GB RAM and 2 Core processor (2.4 GHz or higher).
  • A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  • Domain name must be pointed to your Alibaba Cloud ECS’s IP address
  • Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  • Set up your server’s hostname and create user with root privileges.

Setting Up Your Server

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.

Install Plex

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

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

Step 1:

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

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.

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.

To start execute the command below.

Set Up Plex

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.

Image for post
Image for post

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

Image for post
Image for post

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

Image for post
Image for post

Now click Got IT! to proceed.

Image for post
Image for post

Close this window if you do not require a Plex Pass. It is required only if you are interested in using premium services like TV, mobile sync, exclusive forum access, trailers and extras. After closing it, you will see the following screen.

Image for post
Image for post

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

Image for post
Image for post

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

Image for post
Image for post

Click Done to proceed further.

Set Up Firewalls and Ports

If you have activated firewalls, you will have to define a rule in Alibaba Cloud security group for your cloud server to add exception for port 80/tcp and 443/tcp. You can enable these ports while creating ECS instance, but in case if you have forgotten to unblock these ports, you can follow the procedure in this guide: https://www.alibabacloud.com/help/doc-detail/25471.htm

Install Nginx

To install Nginx server, execute the command below.

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

On successful installation, you will see the following screen.

Image for post
Image for post

Install Node.js:

To install Node.js, execute the command below.

Set Up Reverse Proxy

In this step, you will setup reverse proxy to access Plex 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 an nginx configuration file using nano editor.

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

Now restart nginx server using the command below.

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.

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

Navigate to home.

Create directories:

Install software-properties-common

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.

To install software-properties-common execute the command.

Install SSL Certificate

To install SSL certificate using Let’s Encrypt, you will use Certbot. To do so, execute the following steps.

Update the package.

To install software-properties-common, execute the command below.

Add the certbot repository.

Update the package to load the added certbot repository.

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

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

Now restart nginx server using the command below.

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

Reference:https://www.alibabacloud.com/blog/how-to-install-a-plex-media-server-on-alibaba-cloud_594744?spm=a2c41.12842862.0.0

Written by

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store