1. Academy
  2. Compute & Instances

How to install a Plex Media Server

With Plex, you can organize and stream your video and audio files from anywhere in the world. This guide will show you how to deploy your own Plex Media Server running on an Ubuntu instance located on the Fuga Cloud.

Prerequisites

For this tutorial you’ll need the following:

  1. A Fuga Cloud account
  2. An instance already running Ubuntu 16.04 where an ssh connection is possible.
  3. Ensure that your Ubuntu instance is up to date: sudo apt-get update && sudo apt-get upgrade -y
  4. Plex requires an account in order to make use of the service. Click here to create a Plex account.

In case you don’t have a running instance on Fuga Cloud yet, please follow and complete our Getting Started series.

Fuga Cloud account

Step 1 - Installing Plex

  1. Open the terminal and make an ssh connection with the Ubuntu instance.

  2. Add the Plex APT repository to your system and import the repository’s GPG key by running the following commands:

    $ curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
    $ echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
  3. IOnce that is enabled. Update your system with the following command:

    $ sudo apt update && sudo apt-get upgrade -y
  4. Now install the plex media server, this allows you to installing the latest version of plex

    $ sudo apt install plexmediaserver
  5. Check if plex is running bij using the following command:
    $ sudo systemctl status plexmediaserver
  6. Check if the server is active and running, while using the command above, you should have the following output:

Step 2 - Configuring Plex Media Server

Before starting Plex, you need to create the directories to store the media files, it doesn't really matter where the files are stored, if you can relocate the files.

$ sudo mkdir -p <dir> {media,cd,movies,series}

In order to perform administration of your Plex server, access to the web interface is required. To get access to the web interface, open a new terminal and run the following command, this allows you to use an ssh tunnel:

For Windows

Use the following information for setting up the Putty/SSH connection:

  • Gateway: FLOATING_IP
  • Source Port: 8888
  • Destination: localhost:32400

For OS X or Linux

If you’re using an imported key pair:

ssh -i ~/.ssh/id_rsa  ubuntu@FLOATING_IP -N -L 8888:localhost:32400

If you’re using a generated key pair:

ssh -i KEYPAIR.pem  ubuntu@FLOATING_IP -N -L 8888:localhost:32400 

While the command above runs, enter the following link into your web browser to view the interface:

http://localhost:8888/web

Now, follow the steps below:

  1. Create a free Plex account with.
  2. Give your Plex Media Server a name and leave the ‘Allow me to access my media outside my home’ box checked. Afterward, click Next.
  3. Add the libraries by selecting the directories that you just made in a previous step.
  4. To access the Plex Media server from outside your home, you need to open a specified port. Open the My.fuga dashboard, go to Networking next go to Security Groups
  5. Select the security group that is used attached with your instances, or create a new security group. We do not recommend changing the default settings.
  6. When you choose the security group or have created one, click the Add Rule button.
  7. Add the port 32400 in the port ingress field, then click Add.
  8. Return to the Plex dashboard and go to Settings → Server → Remote Access.
  9. Activate Enable Remote Access if this option isn’t already activated and use the custom port 32400. If you have trouble enabling remote access, try restarting your instance and wait a few minutes.

Step 3 - Connecting to Plex

  1. Download the Plex application to your device. Click here for a list of supported devices.

  2. Sign in to the application using your Plex account.

  3. Select your Plex server from the dropdown menu in the upper left corner of the screen.

Congratulations! Your Plex Media Server is ready for use. You’re now free to add your own media to the specified directories.

Conclusion

In this tutorial, you’ve installed a Plex Media Server on an Ubuntu-based OpenStack instance. You configured your Plex Media Server and enabled remote access. In the last step, you connected to the Plex Media Server which is now ready for usage.