Lifted from: https://vpsie.com/knowledge-base/how-to-install-plex-in-ubuntu-22-04/
If your looking for help installing Plex then you already know what it is, and how amazing it is. With this I am not going to go into an online prestatement on how awesome and what it is.
Let us begin.
I am going to assume the following.
- You have the basic understandings of the command line in a Ubuntu environment.
- You don’t need a gui for this setup.
- You already have your vps picked out and ordered.
The install process is pretty easy around 10 commands and your off to the races.
Ok so lets connect via your favorite SSH client over to your vps.
## Change that root password right off the bat.
passwd
## Now we need to install that firewall.
apt install ufw
ufw allow 22
ufw allow 32400
ufw enable
## select y to continue.
Now we need to update our system.
apt-get update && apt-get upgrade -y
## Personally I always reboot just to make sure.
reboot
Ok now we got our base system installed, our firewall up and running, and our system updated. Now lets install those final pieces and get our Plex Media Server online!
## We need to install some dependiences.
apt install apt-transport-https curl
## Add the Plex repository.
curl https://downloads.plex.tv/plex-keys/PlexSign.key | gpg --dearmor | sudo tee /usr/share/keyrings/plexserver.gpg > /dev/null
echo deb [arch=amd64 signed-by=/usr/share/keyrings/plexserver.gpg] https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
## Update the system again.
apt update
## Now we install Plex
apt install plexmediaserver -y
## Make is start at boot time.
sudo systemctl enable plexmediaserver
Now that Plex is installed, we have a few small pieces left to finish.
Open up your browser of choice, example Firefox, Chrome, now head over to your IP Address :32400/web
After accessing the Plex Web interface, the user needs to register the server with their Plex account by logging in. If you don’t have a Plex account yet, you can register one using any of the available methods.
On the next screen, enter a name for your Plex server. Make sure Allow me to access my media outside my home is checked.
That is it! Once you get the rest finished, and your Libraries added, your good to go!