
Hello and welcome to Projects with Jackie. Today we will be going over how to install and set up Plex Media Server on an Ubuntu headless Server. We will be covering: Setting a static IP address, attaching a secondary drive automatically, attaching a network drive, how to access the Plex Media Server GUI (Local Web Interface), and how to add both secondary drives and network drives to the Plex Media Server Database. This guide does not cover how to install Ubuntu Server.
Getting Started
Before we get into setting up your Ubuntu Server with Plex Media Server please make sure of the following:
- Your server has Ubuntu Server installed already.
- A guide is coming soon for this.
- Swapping hard drive around can cause issues. It is best to set up a drive for data and then copy files from a source that is known to function. This is explained in more detail below.
- Ensure your server is connected to the router using an Ethernet Cable and not WiFi.
- Servers can use a lot of bandwidth and an Ethernet is better than WiFi for data transfer speeds.
- Ensure both the Router and Ubuntu Server are on an UPS.
- Learn more about UPSs here: https://projectswithjackie.com/ups/
Install and Access Plex Media Server
First we will install Plex Media Server onto our Ubuntu Server and access it from the local GUI IP address.
- First ssh into your Ubuntu Server
- Example. For windows computers open Command Prompt and type in SSH Server_User_Name@Server_IP_Address (SSH [email protected])
- It is a good idea to update your Ubuntu Server with the latest patches. Type in the command:
- Sudo Apt Upgrade
- To install Plex Media Server type in the command:
sudo snap install plexmediaserver
- Plex should automatically start on its own but you can use the htop command to view processes that are active on your ubuntu server.
- Press Ctrl + C to back out of htop
- Access the Plex Web GUI: On another computer in your local network open an internet browser, such as firefox or Chrome, and go to:
http://<Server_IP_Address>:32400/web- Replace <Server_IP_Address> with the local IP address of your Ubuntu Server
- An example would be http://192.168.1.50:32400/web
- You can make admin changes to your Plex server from here. To include setting up access to your movie database.
Before we add storage locations to our plex media server we will need to go over setting your server as a static IP in your network router. This is important because if the power goes out your Ubuntu Server, it may be assigned a different IP address and that can cause issues.
Setting Up Ubuntu Server with a Static IP
A static IP ensures consistent network access to your Plex server. I prefer setting the static IP in the router rather than directly on the Ubuntu Server. This approach centralizes all static IP assignments, making it easier to manage, and troubleshoot, network configurations from one location. Each router is different so I will only provide a general guide to follow:
- Log in to Your Router:
- Access your router’s admin interface (usually
192.168.1.1or192.168.0.1).
- You can google the make and model of your router to find out the default ip address for your router.
- Access your router’s admin interface (usually
- Type the IP address into your preferred internet browser and sign in.
- Locate the “DHCP Reservation” or “Static IP Assignment” section (the location varies by router model).
- Assign a static IP to your Ubuntu Server by associating its MAC address with the desired IP (e.g.,
192.168.1.100)
- Assign a static IP to your Ubuntu Server by associating its MAC address with the desired IP (e.g.,
Now we will explain how to mount secondary drives and then shared drives. A secondary drive is simply a second drive on your server that is used for storage. A shared drive is a storage location being shared from another server such as a NAS allowing other computers/servers to access the shared drive over the network.
Caution for Drives
Please keep in mind that sometimes moving drive from one computer/server to another can cause issues reading the data. An example of this would be if you have all of your Plex movies on a drive in a QNAP NAS and try to take that drive out of the QNAP NAS and put it in your Ubuntu Server. The Ubuntu Server will most likely not be able to read the data. So it is best to put an empty drive on your Ubuntu Server and then copy the Plex Data from the QNAP NAS to your Ubuntu Server. It is usually a good idea to have a backup of all of your data anyhow.
- Guide on how to move data to your Ubuntu Server coming soon.
Attaching a Secondary Drive for Plex Media
- Identify the Drive: Use the
lsblkcommand to identify your secondary drive:lsblk- Ubuntu usually identifies drives as sdx, where x is another letter. Usually sda is the hard drive that stores the current Ubuntu Operating System and additional drives start as sdb, ect.
- Mount the Drive:
- Create a mount point:
sudo mkdir /mnt/Secondary_drive- A mount point is like building a boat deck. The boat deck allows boats to dock so people can exit the boat. A mount point is a location to mount a drive to so the Ubuntu Server can access the data on the drive that is mounted to it.
- to ensure the drive point is created use the command:
ls /mnt- the ls /mnt command lists files, directories and mount points. You should see Secondary_drive there.
- Now we want to mount the secondary drive partition, in my case it was sdb3, to the the mount point temporarily so that we can ensure we have the correct drive mounted to the correct mount point.
- Create a mount point:
- Mount the drive temporarily:
sudo mount /dev/sdb3 /mnt/Secondary_drive- Ensure to change the sdb3 to the drive partition for your drive.
Step 3: Edit /etc/fstab to Automatically Mount the Secondary Drive
- Find the UUID of the Drive:
sudo blkid - Edit the
/etc/fstabFile:sudo nano /etc/fstab - Add an Entry for the Drive:
UUID=your-drive-uuid /mnt/plex_drive ext4 defaults 0 2- Remember to remove the ” ” from the UUID
- change the /mnt/plex_drive to the designated location for the secondary drive.
- Test the Configuration:
sudo reboot - After the Ubuntu Server has rebooted check that the Secondary Drive was mounted with the command:
- lsblk
- Your sdb3 drive should have a /mnt/Secondary_drive under MOUNTPOINTS
In some cases, like mine, the data for Plex Media Server is located on another server. If this is the case then we will need to create a mount point on the Plex Media Server and connect the mount point to the server hosting the Plex Data.
- Create a Mount Point:
sudo mkdir /mnt/network_drive - Mount the Network Drive:
sudo mount -t cifs -o username=your_username,password=your_password,vers=3.0 //192.168.1.200/shared_folder /mnt/network_drive- Replace the sections that are underlined with your individual data.
- The IP address needs to be the IP address of your shared drive that the Plex Media Server needs to point to.
- Test the mount point by typing in the command lsblk and check under mountpoints for a /mnt/network_drive
- If there is a /mnt/network_drive mountpoint showing up then we need can go and edit the fstab file for automatic mounting:
- Type in
sudo nano /etc/fstab - Add this line:
//192.168.1.200/shared_folder /mnt/network_drive cifs username=your_username,password=your_password,vers=3.0 0 0
- once the line is added press ctrl + O at the same time to save the fstab file.
- Press ctrl + C to exit the fstab file
- type in
sudo reboot to reboot the Ubuntu Server - Check that the /mnt/network_drive was re-mounted with the lsblk command
Step 6: Add File Paths to Plex Media Server
- Access Plex Library Settings:
- In the Plex Web GUI, navigate to
Settings > Manage > Libraries > Add Library.
- In the Plex Web GUI, navigate to
- Add Local Drive (Secondary Drive):
- Use the file picker to navigate to
/mnt/plex_drive.
- Use the file picker to navigate to
- Add Network Shared Drive:
- Use the file picker to navigate to
/mnt/network_drive.
- Use the file picker to navigate to
- Scan the Libraries:
- After adding folders, Plex will automatically scan and add media files.
With these steps, your Plex Media Server is set up on an Ubuntu Server, configured for optimal performance, and connected to both local and network drives. Enjoy your media streaming experience!
