Install Plex Media Server on Ubuntu 18.04

Select distribution:
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 media library platform that allows you to organize and stream your digital video and audio from anywhere. This guide shows you how to set up the Plex Media Server on your Linode running Ubuntu 18.04 LTS, as well as how to connect to your media server from a [Plex client application](https://www.plex.tv/apps-devices/. A Plex media server could benefit from large amounts of disk space, so consider using our Block Storage service with this setup.

Note
This guide is written for a non-root user. Commands that require elevated privileges are prefixed with sudo. If you’re not familiar with the sudo command, see the Users and Groups guide.

Prerequisites to Install Plex Media Server on Ubuntu 18.04

  1. Familiarize yourself with our Getting Started guide and complete the steps for setting your Linode’s hostname and timezone.

  2. Complete the sections of our Securing Your Server to create a standard user account with sudo privileges.

  3. Ensure that your system is up to date:

    sudo apt-get update && sudo apt-get upgrade
    
  4. Create a Plex account. This is required to make use of the service, and provides additional features such as DVR capability and offline viewing if you pay for their premium Plex Pass. Purchasing a premium Plex Pass is optional.

Installing Plex Media Server on Ubuntu 18.04

This section shows you how to install the Plex Media Server on your Ubuntu 18.04 Linode.

  1. Go to the Plex Server Downloads page and select Linux from the Plex Media Server dropdown menu.

  2. Click on the Choose Distribution button and copy the installation link for Ubuntu. For example, the Ubuntu (16.04+) / Debian (8+) - Intel/AMD 64-bit link is compatible with a Linode running Ubuntu 18.04.

  3. Connect to your Ubuntu 18.04 Linode via SSH and use wget to download the installer via the copied link. Replace the link with your selected distribution as shown in the example below:

     wget https://downloads.plex.tv/plex-media-server/1.14.1.5488-cc260c476/plexmediaserver_1.14.1.5488-cc260c476_amd64.deb
    

    This example uses the current link for Ubuntu, at the time of writing. Be sure to use the up-to-date version supplied on the Plex website.

  4. Use dpkg to install the Plex .deb files (Plex distribution) you downloaded using wget with the following command:

    sudo dpkg -i plexmediaserver*.deb
    
  5. To start the Plex Media Server automatically when booting your Ubuntu, run the following commands:

    sudo systemctl enable plexmediaserver.service
    sudo systemctl start plexmediaserver.service
    

Configuring Plex Media Server on Ubuntu 18.04

In this section, you complete your server setup and start adding media libraries. Run the commands from this section on your local computer unless otherwise stated.

  1. Setup an SSH tunnel to your Linode. Run the following command by replacing the username with your Linode system’s username and 192.0.2.1 with your Linode’s IP address:

    ssh user@192.0.2.1 -L 8888:localhost:32400
    
  2. Open a browser and navigate to http://localhost:8888/web to view the Plex web interface. Input your Plex account username and password to proceed with the setup process:

    Plex web interface.

  3. Give your Plex server a name. Be sure to leave the Allow me to access my media outside my home box checked, and click Next:

    Plex web interface - Server Name.

  4. Finally, connect to your Linode via SSH to create the directories that store your Plex media. In the example, you create library directories for movies and television within a plex-media directory. These are located within your user’s home directory (/home/username/):

    cd ~/
    mkdir -p plex-media/movies && mkdir plex-media/television
    

Organizing Plex Media Server on Ubuntu 18.04

The steps in this section are performed using your Plex Media Server’s web interface.

  1. Sign into your Plex Media Server’s account using the same credentials you used in the Configuring Plex Media Server on Ubuntu 18.04 section.

  2. Once logged in, you should see the example page. Click the Add Library button to start setting up your media libraries:

    Plex web interface - Add Library

  3. Select your library type, and click Next:

    Plex web interface - Library type

  4. Navigate to the media directory that you created previously (/home/username/plex-media/movies), then click Add:

    Plex web interface - Library location

  5. You can add additional libraries by clicking the + symbol next to the Libraries list on the Plex side bar:

    Plex web interface - additional Library

  6. Add your media to the appropriate directories. Be sure to review Plex’s naming conventions for media files to ensure that your files are identified correctly.

In more recent versions of Plex Media Server, DLNA is usually disabled. However, with certain older distributions, you have to disable it manually. DLNA server uses Universal Plug and Play Protocol (UPnP) and is not specific to a user account. This means any app or device in a network can access files without restriction if DLNA is enabled. This section shows you how to disable DLNA.

  1. While logged into your Plex Media Server account, click on the wrench icon at the top and select Server.

  2. Navigate to the DLNA section, uncheck Enable the DLNA server, and click Save Changes:

Plex media client

Connecting to Your Plex Server

Now that your server is set up, you’re ready to connect to it from a Plex client application. You can connect to your Plex Server from a device, like an Apple device.

  1. Navigate to Plex’s list of streaming devices.

  2. Select the right client for your device and download it.

  3. Next, sign-in to your Plex client application and select your server from the dropdown menu. Now, you can browse media files available on your Plex server.

Plex media client

Configuring Plex Media Server Firewall on Ubuntu 18.04

In this section you set up a firewall on your Plex Media Server using the Uncomplicated Firewall (UFW).

  1. UFW is usually pre-installed on Ubuntu. If UFW isn’t installed, run the following command to install it on your Ubuntu system:

     sudo  apt-install ufw
    
  2. To confirm that UFW is installed, view its status by running the example command. If the output returns a Status: active confirmation, UFW is installed.

     sudo ufw status verbose
    
  3. Using a text editor of your choice, create a new UFW application profile file in the following location /etc/ufw/applications.d/plexmediaserver. Copy and past the contents of the example file to your own plexmediaserver file:

    File: /etc/ufw/applications.d/plexmediaserver
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    
    [plexmediaserver]
    title=Plex Media Server (Standard)
    description=The Plex Media Server
    ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp
    
    [plexmediaserver-dlna]
    title=Plex Media Server (DLNA)
    description=The Plex Media Server (additional DLNA capability only)
    ports=1900/udp|32469/tcp
    
    [plexmediaserver-all]
    title=Plex Media Server (Standard + DLNA)
    description=The Plex Media Server (with additional DLNA capability)
    ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp|1900/udp|32469/tcp
  4. Save and update your UFW application profile:

     sudo ufw app update plexmediaserver
    
  5. Apply these UFW rules by running:

     sudo ufw allow plexmediaserver-all
    
  6. You should see a similar output, which confirms that your new firewall rules are in place.

    To                                    Action      From
    --                                    ------      ----
    22/tcp                                ALLOW IN    Anywhere
    32400/tcp (plexmediaserver-all)       ALLOW IN    Anywhere
    3005/tcp (plexmediaserver-all)        ALLOW IN    Anywhere
    5353/udp (plexmediaserver-all)        ALLOW IN    Anywhere
    8324/tcp (plexmediaserver-all)        ALLOW IN    Anywhere
    32410:32414/udp (plexmediaserver-all) ALLOW IN    Anywhere
    1900/udp (plexmediaserver-all)        ALLOW IN    Anywhere
    32469/tcp (plexmediaserver-all)       ALLOW IN    Anywhere

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.