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.
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.
# sudo apt update && sudo apt upgrade
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.
# 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
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
Now you will be able to access Plex via browser installed in your laptop as shown below. Use URL http://localhost:8888/web
Now you will be asked to login using your Plex account credentials. After login, you will be redirected to the following screen.
Now click Got IT! to proceed.
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.
Remember to tick allow me to access my media outside my home and hit Next button, you will be redirected to following screen.
Now click next and you will be redirected to the following screen.
Click Done to proceed further.
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
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.
To install Node.js, execute the command below.
# sudo apt-get install nodejs
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.
# 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/;
}
}
Now 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.
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
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.
# sudo apt-get install software-properties-common -y
To install SSL certificate using Let's Encrypt, you will use Certbot. To do so, execute the following steps.
Update the package.
# sudo apt-get update
To install software-properties-common, execute the command below.
# sudo apt-get install software-properties-common
Add the certbot repository.
# sudo add-apt-repository ppa:certbot/certbot
Update the package to load the added certbot repository.
# sudo apt-get update
Now install python-certbot-nginx using the command below.
# sudo apt-get install python-certbot-nginx
Now issue SSL certificate to your domain by executing the command below.
# sudo certbot --nginx -d softpedia.xyz
Now 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.
11 Security Recommendations for Production Instances on Alibaba Cloud
2,599 posts | 762 followers
FollowAlibaba Clouder - April 26, 2019
Alibaba Cloud Community - August 5, 2022
Alibaba Clouder - August 5, 2019
Alibaba Clouder - April 15, 2019
Alibaba Clouder - September 7, 2018
Alibaba Clouder - August 2, 2018
2,599 posts | 762 followers
FollowElastic and secure virtual cloud servers to cater all your cloud hosting needs.
Learn MoreAn encrypted and secure cloud storage service which stores, processes and accesses massive amounts of data from anywhere in the world
Learn MoreLearn More
More Posts by Alibaba Clouder
5481784353814084 March 16, 2020 at 10:23 am
1MB of streaming isn’t enough. Bad method. That’s how much you’ll get with this method.