How to Install Plex Media Server on VPS for Streaming

Plex Media Server is one of the most popular solutions for media management and streaming. With Plex, you can store and stream media content to any device, be it your phone, tablet, smart TV, or computer. Setting up Plex on a VPS allows you to create your own cloud-based media server, giving you secure and remote access to your media library. This guide will show you how to install Plex on an Ubuntu 20.04 LTS VPS.


Step 1: Set Up Your VPS

  1. Choose a VPS

    • For Plex Media Server, ensure your VPS has at least 2GB of RAM and sufficient storage space for your media library. A VPS with a good CPU (at least 2 cores) is recommended for smooth media streaming.
    • Make sure your VPS is running Ubuntu 20.04 LTS or a later version.
  2. Access Your VPS via SSH

    • Once your VPS is created, access it through SSH:
       
      ssh username@your-vps-ip
  3. Update Your VPS

    • Before installing Plex, update your system to ensure all software packages are up-to-date:
       
      sudo apt update && sudo apt upgrade -y

Step 2: Install Plex Media Server on Ubuntu

  1. Add Plex Repository and Install Dependencies

    • Plex provides an official repository for Ubuntu, so you can easily install it via the package manager. First, install required dependencies:
       
      sudo apt install apt-transport-https curl -y
  2. Add Plex Repository

    • Download and add the Plex repository to your system:
       
      curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
  3. Add Plex Source

    • Add the Plex repository to the APT sources list:
       
      sudo sh -c 'echo "deb https://downloads.plex.tv/repo/deb public main" > /etc/apt/sources.list.d/plex.list'
  4. Update Your System

    • Now, update your package list to include the Plex repository:
       
      sudo apt update
  5. Install Plex Media Server

    • Install Plex Media Server using the following command:
       
      sudo apt install plexmediaserver -y

Step 3: Configure Plex Media Server

  1. Start Plex Media Server

    • Plex Media Server should start automatically after installation. However, if it doesn't, you can start it manually with the following command:
       
      sudo systemctl start plexmediaserver
  2. Enable Plex to Start on Boot

    • To ensure Plex starts automatically when your server reboots, enable it using:
       
      sudo systemctl enable plexmediaserver
  3. Check the Plex Service Status

    • To verify Plex is running, check its status:
       
      sudo systemctl status plexmediaserver

Step 4: Set Up Plex Media Server

  1. Access Plex Web Interface

    • Plex is configured through a web-based interface. Open a web browser and navigate to:
       
      http://your-vps-ip:32400/web
    • Replace your-vps-ip with the actual IP address of your VPS.
    • You should see the Plex setup screen. Sign in with your Plex account or create a new one if you don’t have one.
  2. Configure Media Folders

    • Plex will prompt you to add media libraries. These are the folders where your movies, music, TV shows, and other media files are stored.
      • Click Add Library and choose the type of media you want to add (Movies, TV Shows, Music, etc.).
      • Select the folder on your VPS where the media files are located.
  3. Configure Server Settings

    • Customize settings like server name, remote access, and security in the Plex settings page.
    • It’s recommended to set up Remote Access so you can stream your media anywhere. If you face issues with remote access, you can configure port forwarding on your VPS or use Plex's NAT/UPnP feature.

Step 5: Add Media to Plex

  1. Upload Media to Your VPS

    • Upload your media files to the designated folders on your VPS. This can be done using an FTP client (like FileZilla) or using SSH commands to move files.
  2. Update Your Plex Libraries

    • After adding media, go to the Plex web interface and click the Refresh button in your library section to ensure Plex detects and indexes all new files.

Step 6: Configure SSL for Secure Access (Optional but Recommended)

To make sure your connection to Plex is secure, it’s a good idea to enable HTTPS using SSL certificates.

  1. Install Certbot

    • Install Certbot, which is used to get free SSL certificates from Let's Encrypt:
       
      sudo apt install certbot python3-certbot-apache -y
  2. Obtain SSL Certificate

    • Run the following command to obtain an SSL certificate for your domain (if you have one set up for your VPS):
       
      sudo certbot --apache
  3. Auto-Renew SSL Certificate

    • Certbot automatically renews your SSL certificates. To test this, run:
       
      sudo certbot renew --dry-run

Step 7: Install Plex Media Server Apps (Optional)

Plex provides mobile and desktop apps for various devices (iOS, Android, Roku, Apple TV, Smart TVs, etc.). You can install the Plex app on any of these devices to start streaming media from your VPS.

  1. Install Plex on Your Devices

    • Go to the Plex website or respective app stores (Google Play, Apple App Store, etc.) and download the Plex app for your device.
  2. Log in to Your Plex Account

    • Open the Plex app on your device, and log in using the same Plex account you used for the server.
  3. Start Streaming

    • Once logged in, you should be able to stream all the media stored on your Plex server, right from your mobile device, tablet, or TV.

Step 8: Maintain and Back Up Your Plex Server

  1. Regular Backups

    • It’s important to back up your Plex server settings and metadata regularly. You can do this by copying the Plex data directory (/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/) to a safe location.
  2. Update Plex Media Server

    • To ensure your Plex server is up to date with the latest features and security patches, run:
       
      sudo apt update sudo apt upgrade plexmediaserver -y
  3. Monitor Server Performance

    • Use htop or top to monitor the performance of your Plex server:
       
      htop

Step 9: Troubleshooting

  1. Plex Won’t Start?

    • Check the Plex logs for errors located at /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/.
    • Restart Plex using:
       
      sudo systemctl restart plexmediaserver
  2. Remote Access Not Working?

    • If you have issues with remote access, make sure that port 32400 is open in your VPS firewall and, if necessary, configure port forwarding or use Plex's NAT/UPnP feature.

Conclusion

Congratulations! You've successfully installed and set up Plex Media Server on your VPS. You now have your own private streaming server that can be accessed from anywhere. Plex allows you to organize, share, and stream all your media content securely. With mobile apps and smart TV integration, you can enjoy your media on a wide range of devices.

For even better performance, ensure that your VPS has enough storage space and processing power, especially if you plan to stream in high-quality resolutions like 4K. Plex also supports a wide range of plugins and customization options to enhance your media experience further.

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution