How To Setup Simple Media Streaming Server

Transform your old computer into a state-of-the-art entertainment hub with this killer media streaming guide!

Hey there! Got an old computer gathering dust and have no idea what to do with it? Want to jazz up your home server or add some excitement to your Raspberry Pi? or do you want to have fun with your virtual machine on your PC? Well, you're in luck because I'm about to show you how to set up a killer media streaming site using Plex media server software and an Ubuntu server operating system. Get ready to transform that old piece of tech into a state-of-the-art entertainment hub that will have everyone talking. Let's dive in!

Getting Ubuntu Server OS

Head over to this link to get the Ubuntu server operating system and install it.

Ubuntu Server: https://ubuntu.com/download/server

Connecting to The Server

Alright, assuming that you've successfully installed the Ubuntu server, let's move on to the next step: Connecting to the server. If you're not sure how to install the Ubuntu server, don't worry - there are plenty of tutorial videos available on YouTube that can guide you through the process.

Now, here's the thing: since the Ubuntu server doesn't come with a desktop environment for user interaction, we're going to need to use another computer to interact with the server via SSH. But don't worry, it's super easy and I'll walk you through it step by step. Let's get started!

  1. To get the IP address of your Ubuntu server, you'll need to run the following command in the terminal of the server:

     ip addr
    

    This will display information about your network interfaces, including their IP addresses. Look for the interface that's currently active (it should have the word "UP" next to it) and find the line that starts with "inet". The IP address listed after "inet" is the one you'll need to use in the URL when accessing the server from your client device.

  2. To connect to your Ubuntu server using SSH from your PC, open up the terminal or PowerShell or CMD and run the following command:

     ssh username@ipaddress
    

    Replace "username" with your registered username on the server and "ipaddress" with the server's IP address. This will initiate a secure shell session with your server, allowing you to interact with it from your PC.

    Like demonstrated bellow

     PS C:\Users\numnet> ssh innocent@192.168.206.128 The authenticity of host '192.168.206.128 (192.168.206.128)' can't be established. ECDSA key fingerprint is SHA256:6XWZzaKQBvChDjG1klJKLMHClPQ6JbyhfLGrFYw1vHw. Are you sure you want to continue connecting (yes/no/[fingerprint])? y Please type 'yes', 'no' or the fingerprint: yes Warning: Permanently added '192.168.206.128' (ECDSA) to the list of known hosts.
    
  3. Enter your server account password to connect to the server.

    Installing Plex Media Server

    Now that we are connected to the server let's install the Plex media server.

    1. Update the package list.

       sudo apt-get update
      
    2. Install the Plex repository key:

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

       echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
      
    4. Update the package list again:

       sudo apt-get update
      
    5. Install the Plex Media Server package:

       sudo apt-get install plexmediaserver
      
    6. Enable the Plex Media Server service to start on boot:

       sudo systemctl enable plexmediaserver
      

Once you've completed the installation process, open up a web browser on your client device and enter the following URL: ipAddressOfTheServer:32400/manage. If everything has been set up correctly, your client device should connect to the Plex server running on your Ubuntu server. If for some reason the server isn't up and running, don't worry - just run the following command to start it:

sudo systemctl status plexmediaserver

Once you have connected to the server you will be asked to sign up for Plex media service, create your account, and login to the server.

Plex will get you through a guided setup where you will set the name of your media server and make media libraries.

Transferring Files to the Server

To make your media libraries you will need to transfer the files to the server. In this article, we are going to use a USB drive. First of all, we need to make a directory to store our files. Navigate to a directory you would like to be storing your files in and run

sudo mkdir media

Stick the USB drive to your server and on the client device run :

lsblk

In my case

innocent@numnet:~$ lsblk
NAME                        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0                         7:0    0  79.9M  1 loop  /snap/lxd/22923
loop1                         7:1    0    62M  1 loop  /snap/core20/1587
loop2                         7:2    0    47M  1 loop  /snap/snapd/16292
sda                           8:0    0    20G  0 disk
├─sda1                        8:1    0     1M  0 part
├─sda2                        8:2    0   1.8G  0 part  /boot
└─sda3                        8:3    0  18.2G  0 part
  └─dm_crypt-0              253:0    0  18.2G  0 crypt
    └─ubuntu--vg-ubuntu--lv 253:1    0    10G  0 lvm   /
sdb                           8:16   1 117.2G  0 disk
└─sdb1                        8:17   1 117.2G  0 part
sr0                          11:0    1   1.4G  0 rom

The USB drive is on sdb/sdb1.

To mount the USB drive to the server run

sudo mount /dev/sdb1 /mnt

On the USB drive, I have a media file containing multiple video files. The USB drive is mounted in the mnt directory.

Navigate to the root directory

cd /

Navigate to the mnt directory

cd mnt

If the USB drive was mounted you will see the directories in the drive using the ls command below

innocent@numnet:/mnt$ ls
 Media  'System Volume Information'

Now we should copy the media files to the media directory we created earlier in the home directory. We are going to do this by using the cp command

 cp -r /mnt/media ~/media

The "-r" option is used to copy the directory recursively, which means that it will copy all files and subdirectories within the directory as well.

You can replace "~/media" with any other destination directory that you prefer. If the directory already exists, the "cp" command will merge the contents of the source directory with the destination directory.

To view the copied files navigate to the root and run

cd ~/media/media

You can run the ls command to view the contents of the media directory

ls

You can now import your media into your Plex library using the Plex web-based file explorer.

You can also import the files directly from the USB drive. Just make sure to keep it on the server while the server is running.

To stream the media, connect your client device whether a phone or a PC to the server using ipAddressOfTheServer:32400/manage. Choose the library of your choice and enjoy.

Conclusion

Congratulations, you've done it! You've transformed your old computer or Raspberry Pi into a powerful media streaming site using the Plex media server and Ubuntu operating system. Now, you can stream your favorite movies, TV shows, and music with ease.

By following the steps outlined in this article, you've learned how to install and set up the Plex media server, configure your Ubuntu operating system, and organize your media library.

Remember, Plex is a versatile tool that can be customized to fit your specific needs. Don't be afraid to explore and experiment with the various features and settings available to you. The more you use it, the more you'll discover just how powerful and user-friendly it truly is.

So, what are you waiting for? Get out there and start streaming! Your newly configured Plex media server is waiting for you.