Content Linux Plex Media Server Plex Requests Ubuntu Ubuntu Server

How to Install Plex Requests on Ubuntu 16.04, 18.04 Server

plex requests nginx subdirectory

This tutorial can be displaying you ways to set up Plex Requests on Ubuntu 16.04 and Ubuntu 18.04 server. Plex Requests is an easy automated approach for customers to request new content material on your Plex media server.

Plex Requests permits your customers to submit content material requests on a devoted net web page. The newest model is v1.21.2, launched on Feb 16, 2018. Options of Plex Requests are as follows:

  • Customers can simply search the TheMovieDB for content material to request
  • Useful listing of requested films and TV collection and primary situation reporting
  • Easy consumer authentication with new approval system
  • CouchPotato integration for automated downloads of flicks
  • SickRage and Sonarr integration for automated TV Collection downloads
  • Pushbullet or Pushover notifications to sustain to date with requests

plex requests nginx subdirectory

Conditions

To comply with this tutorial, it’s assumed that you’ve already arrange Plex media server on Ubuntu 16.04 or Ubuntu 18.04. You possibly can take a look at the next articles.

To run Plex Requests, your server should have a minimum of 1GB of RAM. 2GB is beneficial to run it easily. With out additional ado, let’s set up Plex Requests.

Install Plex Requests on Ubuntu 16.04, 18.04 Server

Plex Requests is written with MeteorJS, which is a free and open-source JavaScript net framework for constructing net and cellular apps. To run Plex Requests, we’d like to set up MeteorJS with the next command.

sudo apt set up curl

curl https://install.meteor.com/ | sh

install meteorjs on ubuntu 16.04 18.04

Then head over to Github and obtain the newest launch.

plex requests meteor

To obtain it from command line, use the next command. If a brand new model comes out, merely substitute 1.12.2 with the brand new model quantity.

wget -O plexrequests-meteor-1.21.2.zip https://codeload.github.com/lokenx/plexrequests-meteor/zip/v1.21.2

Subsequent, unzip the archive.

sudo apt set up unzip

unzip plexrequests-meteor-1.21.2.zip

Cd into the listing.

cd plexrequests-meteor-1.21.2/

Now we will run Plex Requests with the next command.

meteor

Word that in case your server doesn’t have sufficient RAM, this command will fail and you will notice the next error. ENOMEM stands for “Error – No Memory”.

Error: spawn ENOMEM

Additionally, Plex Requests by default listens on port 3000. If one other software is utilizing port 3000, then specify an alternate port like 3002. (MongoDB listens on port 3001.)

meteor –port 3002

plex requests meteor port 3000

Now you possibly can entry the Plex Requests admin web page at

your-server-ip:3000/admin

If port 3000 is blocked by firewall, then run the next command to permit entry on port 3000.

sudo iptables -I INPUT -p tcp –dport 3000 -j ACCEPT

plex requests create admin account
Click on the Register hyperlink to create an admin account.

Plex Requests login forbidden

Run Plex Requests within the background with SystemD

By default, the meteor command runs within the foreground, which suggests for those who give up the terminal, Plex Requests will cease operating. To run it within the background, we will create a SystemD service. First, press Ctrl+C to cease the present meteor course of. Then create a SystemD service file for Plex Requests with a command line textual content editor like nano.

sudo nano /and so on/systemd/system/plex-requests.service

On this file, we’d like to set the HOME surroundings variable, set the working listing and specify that meteor will run as an ordinary consumer. So put the next textual content into this file. Exchange the pink textual content as applicable.

[Unit] Description=Plex Requests
After=syslog.goal community.goal

[Service] Setting=”HOME=/home/linuxbabe”
WorkingDirectory=/residence/linuxbabe/plexrequests-meteor-1.21.2
ExecStart=/usr/native/bin/meteor
Sort=easy
Restart=all the time
RestartSec=10
Consumer=linuxbabe
Group=linuxbabe

[Install] WantedBy=multi-user.goal

To save lots of the file in Nano textual content editor, press Ctrl+O, then press Enter to affirm. To exit, press Ctrl+X. Subsequent, we will begin the SystemD service with:

sudo systemctl begin plex-requests

And allow auto-start at system boot time.

sudo systemctl allow plex-requests

Now examine the standing:

systemctl standing plex-requests

Make sure that it’s operating. Then press q to achieve again management of terminal.

meteor plex requests systemd run in the background

Arrange Nginx Reverse Proxy (Subdomain)

To entry Plex Requests by way of a website identify as an alternative of typing IP handle and port quantity, you possibly can arrange a reverse proxy with Nginx. Run the next command set up Nginx net server.

sudo apt set up nginx

Then create a Nginx digital host file for Plex Requests.

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

Put the next strains into the file. Substitute requests.instance.com with your personal area identify. Don’t overlook to set A report for the sub area. The situation / … block will make Nginx redirect requests to port 3000.

server
pay attention 80;
server_name requests.instance.com;

error_log /var/log/nginx/plex-requests.error;

location /
proxy_pass http://127.0.0.1:3000;
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
proxy_set_header Improve $http_upgrade;
proxy_set_header Connection “Upgrade”;

Save and shut the file. Then check Nginx configuration.

sudo nginx -t

If the check is profitable, then reload Nginx for the brand new configuration to take impact.

sudo systemctl reload nginx

Now Plex Requests is put behind Nginx and you may entry it by way of a website identify (requests.instance.com).

To allow HTTPS safe connection, you possibly can acquire and set up a free TLS/SSL certificates from Let’s Encrypt. Install Let’s Encrypt (certbot) shopper with:

sudo apt set up software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt replace
sudo apt set up certbot python3-certbot-nginx

Then challenge the next command, which makes use of Certbot Nginx plugin to mechanically acquire and set up TLS certificates. Exchange purple textual content together with your precise knowledge.

sudo certbot –nginx –agree-tos –redirect –hsts –staple-ocsp –email your-email-address –domain requests.instance.com

Inside a couple of seconds, you must see a congrats message like under which suggests the certificates is efficiently obtained.

plex requests certbot

Refresh the Plex Requests net web page, you can see HTTP connection is routinely redirected to HTTPS safe connection.

Set Up Nginx Reverse Proxy (Subdirectory)

If you need Plex Requests accessible by way of a subdirectory of your area, then open the prevailing Nginx digital host file on your Plex media server. Mine is known as plex.conf.

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

Should you adopted my earlier Plex media server tutorial, then you need to now have HTTPS enabled on your Plex media server. And also you simply want to add the next strains to the SSL server block (indicated by pay attention 443 ssl).

location ~* (/search|/admin|/requests|/packages|/sockjs|/app|/merged-stylesheets.css)
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Actual-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Improve $http_upgrade;
proxy_set_header Connection “Upgrade”;

Within the above configuration, we specify that if the request URL ends in /search, /admin, /requests, /packages, /sockjs, /app, or /merged-stylesheets.css, then inform Nginx to redirect request to port 3000. If the request URL ends in /sockjs, there will probably be some WebSocket requests together with regular HTTP requests, so we add the final two proxy_set_header directives to improve to WebSocket protocol.

Save and shut the file. Then check Nginx configuration.

sudo nginx -t

If the check is profitable, then reload Nginx for the brand new configuration to take impact.

sudo systemctl reload nginx

Now the primary Plex Requests webpage is accessible by way of a sub-directory.

instance.com/search

And the admin web page is accessible by way of

instance.com/admin

Arrange Apache Reverse Proxy (Subdomain)

In case you favor Apache to Nginx, then set up it with:

sudo apt set up apache2

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

sudo a2enmod proxy proxy_http proxy_wstunnel headers

Then create a digital host file for Plex Requests.

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

Put the next strains into the file. Substitute requests.instance.com with your personal area identify. Don’t overlook to set A report for the sub area.

<VirtualHost *:80>
ServerName requests.instance.com
ErrorDocument 404 /404.html

#HTTP Requests
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/

#When protocol improve to Websocket is acquired, change the origin (protocol scheme, host and port)
RewriteEngine on
RewriteCond %HTTP:UPGRADE ^WebSocket$ [NC] RewriteCond %HTTP:CONNECTION ^Improve$ [NC] RewriteRule .* ws://localhost:3000%REQUEST_URI [P] </VirtualHost>

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

sudo a2ensite plex-requests.conf

Restart Apache

sudo systemctl restart apache2

Now Plex Requests is put behind Apache and you may entry it by way of a website identify (requests.instance.com).

To allow HTTPS safe connection, you’ll be able to get hold of and set up a free TLS/SSL certificates from Let’s Encrypt. Install Let’s Encrypt (certbot) shopper with:

sudo apt set up software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt replace
sudo apt set up certbot python3-certbot-apache

Then problem the next command, which makes use of Certbot Nginx plugin to routinely acquire and set up TLS certificates. Exchange pink textual content together with your precise knowledge.

sudo certbot –apache –agree-tos –redirect –hsts –staple-ocsp –email your-email-address –domain requests.instance.com

Inside a couple of seconds, you must see a congrats message like under which suggests the certificates is efficiently obtained.

plex requests certbot

Refresh the Plex Requests net web page, you can find HTTP connection is mechanically redirected to HTTPS safe connection.

Arrange Apache Reverse Proxy (Subdirectory)

If you’d like Plex Requests accessible by way of a subdirectory of your area, then open the prevailing Apache digital host file in your Plex media server. Mine is known as plex-le-ssl.conf. (Notice that you simply want to edit the digital host that listens on 443.)

sudo nano /and so on/nginx/conf.d/plex-le-ssl.conf

For those who adopted my earlier Plex media server tutorial, then you need to now have HTTPS enabled in your Plex media server. And also you simply want to add the next strains contained in the <VirtualHost *:443>…</VirtualHost> block.

RewriteEngine on

#If the requested URL is supposed for Plex Requests, then redirect the request to localhost:3000
RewriteCond %REQUEST_URI ^/(search|admin|requests|packages|app|sockjs|merged-stylesheets.css) [NC] RewriteRule .* http://localhost:3000%REQUEST_URI [P]

#That is for Websocket requests.
<Location /sockjs/>
RewriteCond %HTTP:UPGRADE ^WebSocket$ [NC] RewriteCond %HTTP:CONNECTION ^Improve$ [NC] RewriteRule .* ws://localhost:3000%REQUEST_URI [P] </Location>

Save and shut the file. Then reload Apache for the modifications to take impact.

sudo systemctl reload apache2

Now the primary Plex Requests webpage is accessible by way of a sub-directory.

instance.com/search

And the admin web page is accessible by way of

instance.com/admin

Conclusion

I hope this tutorial helped you put in Plex Requests on Ubuntu 18.04 and 16.04. As all the time, should you discovered this publish helpful, then subscribe to our free publication to get extra ideas and tips. Take care ?

Price this tutorial

[Total: 0 Average: 0]

(perform(d, s, id)
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//connect.facebook.net/zh_CN/sdk.js#xfbml=1&version=v2.8&appId=961591023917170”;
fjs.parentNode.insertBefore(js, fjs);
(doc, ‘script’, ‘facebook-jssdk’));