Deploying Plex Media Server through the Linode Marketplace

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $100 credit.
This credit will be applied to any valid services used during your first 60 days.

Plex is a feature-rich streaming platform that allows you to organize and stream your own digital video and audio to your devices. This guide shows you how to deploy the Plex Media Server using Linode’s Plex Marketplace App, upload media to your Plex Server, and connect to it from a Plex client application. Your Plex Media Server could benefit from large amounts of disk space, so consider using our Block Storage service with this app.

Why Use Plex Media Server

Owning a Plex Media Server enables you to maintain a personal media library in addition to accessing Plex’s own content, all available to stream to nearly any device. The ability to stream your own media is a unique advantage over other streaming services like Netflix, and comes only at the cost of your Linode services. Additional features, including local downloading, bandwidth limiting, and hardware transcoding are also available through the paid Plex Pass service.

Deploying the Plex Marketplace App

The Linode Marketplace allows you to easily deploy software on a Linode using the Linode Cloud Manager.

  1. Log in to the Cloud Manager and select the Marketplace link from the left navigation menu. This displays the Linode Compute Create page with the Marketplace tab pre-selected.

  2. Under the Select App section, select the app you would like to deploy.

  3. Fill out all required Options for the selected app as well as any desired Advanced Options (which are optional). See the Configuration Options section for details.

  4. Complete the rest of the form as discussed within the Getting Started > Create a Linode.

  5. Click the Create Linode button. Once the Linode has provisioned and has fully powered on, wait for the software installation to complete. If the Linode is powered off or restarted before this time, the software installation will likely fail. To determine if the installation has completed, open the Linode’s Lish console and wait for the system login prompt to appear.

  6. Follow the instructions within the Getting Started After Deployment section.

Software installation should complete within 1-5 minutes after the Linode has finished provisioning.

Configuration Options

Plex Options

The following configuration options create a secure Limited User to run your Plex Media Server.

Note
  • As a security measure, root login over SSH is disabled for this App. Use your Limited User credentials to access your Linode via SSH instead.
  • The Limited User configurations below are for your Linode’s Linux user, which is distinct from your Plex account user.
ConfigurationDescription
Limited User NameThe username for SSH access to your Linode. Required.

If the username root is specified, a limited user is not be created and extra security features are not configured. In this case, you can access your Plex Server and complete this guide as root using your Linode Options credentials.
Limited User PasswordThe user password for SSH access to your Linode. Required.
Limited User SSH KeyThe user public SSH key for SSH access to your Linode. Optional.

You can find instructions on generating an SSH key pair in our guide on Using Public Key Authentication with SSH. For an additional layer of security, you can require SSH key access by disabling password authentication.

General Options

For advice on filling out the remaining options on the Create a Linode form, see Getting Started > Create a Linode. That said, some options may be limited or recommended based on this Marketplace App:

  • Supported distributions: Debian 10
  • Recommended minimum plan: 4GB Dedicated CPU or Shared Compute Instance

Getting Started After Deployment

After your Plex Server has been deployed, you can upload media and configure access to your Plex Server from Plex clients for your media devices.

Before you begin, ensure that you have signed up for a Plex account.

Initial Setup

Administration of your Plex Server is performed from its web interface. Before you can connect to the web interface from your workstation, you first need to create an SSH tunnel to your Linode.

Note

This guide occasionally directs you to substitute variables beginning with $ in certain commands.

An easy way to make these substitutions is to set the variables in your shell, then simply copy the commands as they are provided in this guide — your shell automatically substitutes the $ variables in those commands with the values you have set.

For example, you can set configure a substitution for $IP_ADDRESS like so:

IP_ADDRESS=192.0.2.0

Your shell then interprets $IP_ADDRESS as the value you have provided in following commands, for example:

echo $IP_ADDRESS
192.0.2.0
  1. From your workstation terminal, enter the following the command, substituting $USERNAME with your Linux Limited User Name, and $IP_ADDRESS with the IP address of your Plex Server Linode:

    ssh $USERNAME@$IP_ADDRESS -L 8888:localhost:32400
    

    You now have an established SSH connection to your Plex Server Linode in your terminal, and can also access the Plex web interface from your workstation browser.

  2. Enter http://localhost:8888/web into your workstation browser to access the Plex Server setup web interface. Enter your Plex account username and password to proceed with the setup process.

  3. Give your Plex Server a name. Be sure to leave the Allow me to access my media outside my home box checked, and select NEXT.

  4. Skip Media Library setup by selecting NEXT for now. You will Upload Media and Add Media Libraries in the sections below.

  5. Finish initial setup and reach the Plex home screen by selecting DONE.

  6. Click on the Settings icon in top-right corner of the Plex web interface.

  7. On the left side bar, ensure that your new Plex Server is selected and select on Remote Access under the Settings section.

  8. Click the check box next to Manually specify public port, keep the default value of 32400, and select RETRY or APPLY. You may need to select SHOW ADVANCED to see these settings.

  9. Wait until you see a message stating that your Plex Server is Fully accessible outside your network.

You can now access uploaded media and manage your Plex Server from any Plex Client, such as the Plex Web App. If you are unable to reach your Plex Server remotely, you can repeat the steps in this section to re-establish a direct connection for administrative purposes.

(Optional) Connect a Linode Block Storage Volume

If your media collection is larger than the space available from your Linode plan, Block Storage is a convenient solution. This section outlines the steps for creating and connecting a Block Storage Volume for use with your Plex Server.

Note
For future reference, you can find examples of the instructions provided in this section in Cloud Manager by navigating to Volumes, then selecting Show Configuration from the option menu for your Volume.
  1. Create a Block Storage Volume if you do not already have one prepared.

  2. Establish an SSH connection to your Plex Server Linode as your Limited User.

  3. On your Plex Server Linode, create a directory to your Volume’s mountpoint:

    mkdir ~/plex/media/linode-volume
    
  4. Mount your Volume path to the mountpoint you have created, substituting $FILE_SYSTEM_PATH with your Volume’s file system path (which is viewable from the Cloud Manager Volumes dashboard):

    sudo mount $FILE_SYSTEM_PATH ~/plex/media/linode-volume
    
  5. Check available disk space:

    df -BG
    
    Filesystem     1G-blocks  Used Available Use% Mounted on
    udev                  1G    0G        1G   0% /dev
    tmpfs                 1G    1G        1G  11% /run
    /dev/sda             49G    3G       45G   5% /
    tmpfs                 1G    0G        1G   0% /dev/shm
    tmpfs                 1G    0G        1G   0% /run/lock
    tmpfs                 1G    0G        1G   0% /sys/fs/cgroup
    tmpfs                 1G    0G        1G   0% /run/user/1000
    /dev/sdc             20G    1G       19G   1% /home/username/plex/media/linode-volume

    Notice that there is some overhead with the Volume due to the file system.

  6. To ensure that your Volume automatically mounts every time your Linode reboots, run the following command to modify your /etc/fstab file, substituting $FILE_SYSTEM_PATH with your Volume’s file system path (the $HOME environment variable should already be set as your user’s home directory):

    echo "$FILE_SYSTEM_PATH $HOME/plex/media/linode-volume ext4 defaults,noatime,nofail 0 2" | \
    sudo tee -a /etc/fstab
    
  7. Restart your Plex Server Docker container:

    docker restart plex
    

Media on your Volume is now accessible through the Plex web interface at the mounted directory on your Linode. Next, follow the instructions below on how to Upload Media to your Volume (use your Volume’s mountpoint instead of creating a new subdirectory), and Add Media Libraries to enable streaming media stored on your Volume.

Upload Media

Your Plex Server is set up to access media files in the ~/plex/media directory. You have many options for uploading or downloading media to your Plex Server. This section shows you how to organize and upload files to your Plex Server using the scp command.

Note
This section directs you to run commands either on your Plex Server Linode through an SSH connection as your Limited User, or from the workstation terminal where the media files you wish to upload are stored.
  1. On your Plex Server Linode, create a subdirectory within ~/plex/media to store your media files. Plex recommends organizing media by type, so pick a subdirectory name that matches the type of media you plan to upload. For example, to create a directory to store movie files, enter the following command:

    mkdir ~/plex/media/movies
    
  2. From your media workstation, use the scp command to move media to your Plex Server’s media subdirectory, substituting $USERNAME with your Linux Limited User Name, and $IP_ADDRESS with the IP address of your Plex Server Linode:

    scp example_video.mp4 $USERNAME@$IP_ADDRESS:~/plex/media/movies
    

    Depending on the file size(s), this may take a few minutes.

    Note
    There are other ways to upload files to your Plex Server Linode. See our section in Linux System Administration Basics for more information.

Add Media Libraries

  1. Log into a Plex Client, such as the Plex Web App, then select the MORE > link on the Plex side bar.

  2. Hover over your Plex Server’s name in the Plex side bar, then select the + icon.

  3. Select your library type, set the name for your media library, select your language, then select the NEXT button.

  4. Click BROWSE FOR MEDIA FOLDER, navigate to the directory within /media where your files are stored, then select the ADD button.

  5. Once you are satisfied with your selection, select the ADD LIBRARY button.

  6. Pin your new media library to make it accessible from the Plex home screen.

  7. Repeat the steps in this section to add additional media folders.

You now have all the tools you need to create an online media library and stream it to any device with Plex.

Software Included

The Plex Marketplace App installs the following required software on your Linode:

SoftwareDescription
Docker EngineDocker Engine is an open source containerization technology for building and containerizing your applications. This Marketplace App deploys Plex Media Server as a Docker container.
Plex Media ServerThe Plex Media Server transmits locally-stored media files, enabling you to stream your personal media collection to any device that can support a Plex Client.
Note
Currently, Linode does not manage software and systems updates for Marketplace Apps. It is up to the user to perform routine maintenance on software deployed in this fashion.

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This page was originally published on


Your Feedback Is Important

Let us know if this guide made it easy to get the answer you needed.


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.