Add the Plex APT repository to your system and import the repository’s GPG key:
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add - echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
Once the repository is enabled, update the apt package list and install the latest server version:
sudo apt update sudo apt install plexmediaserver
To verify that the Plex is running, check the service status:
sudo systemctl status plexmediaserver
The output should look something like this:
● plexmediaserver.service - Plex Media Server Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2021-06-17 19:36:33 UTC; 23min ago
That’s it. At this point, you have a Plex media server installed on your Ubuntu machine.
Configuring Plex Media Server
Before starting the Plex setup wizard, you can first create the directories that will store the Plex media files:
sudo mkdir -p /opt/plexmedia/{movies,series}
The Plex Media Server runs as the user plex, which must have read and execute permissions to the media files and directories. To set the correct ownership , enter the following command:
sudo chown -R plex: /opt/plexmedia
You can choose any location to store the media files; just make sure you set the correct permissions.
You can now proceed with the server configuration. Open your browser, type http://YOUR_SERVER_IP:32400/web, and you will be redirected to the plex website.