How to set up a Plex server on a VPS

Aug 03, 2026 03:53 PM - 1 week ago 577

How to group up a Plex server connected a VPS

To group up a Plex server connected a virtual backstage server (VPS), instal Plex Media Server, springiness it entree to your media, link it to your Plex account, and let distant playback. This creates an always-on individual streaming room without leaving a machine moving astatine home.

Setting up Plex manually connected Ubuntu 24.04 gives you power complete the installation, media folders, permissions, and firewall rules. A preconfigured Plex template gets you to the setup surface faster because Plex is already installed. You’ll still request to upload your media, create libraries, and configure distant access, though.

Before you commencement streaming, cheque that the VPS has capable storage, monthly information transfer, and processing powerfulness for your needs. You’ll besides shape your files, trial playback, unafraid the server, show its resources, and hole communal service, permission, storage, and relationship failures.

What do you request earlier mounting up a Plex server?

You request a ready-to-use Ubuntu VPS, Secure Shell (SSH) access, a Plex account, media files, and capable server resources to shop and watercourse them.

Start by setting up your VPS. Note the server’s nationalist Internet Protocol (IP) address, past motion successful via SSH to corroborate you tin scope the server.

ssh username@your_server_ip

Replace username and your_server_ip pinch your ain server details.

SSH gives you an encrypted command-line relationship from your machine to the VPS. You’ll usage it to instal Plex and negociate the server. Your relationship besides needs support to tally sudo commands, since those commands alteration system-wide settings.

Once you tin link successfully, cheque that the server meets the remaining requirements:

Requirement

What to check

Operating system

The server is moving 64-bit Ubuntu 24.04

Random entree representation (RAM)

At slightest 4 GB is disposable – much if you’ll tally different package alongside Plex

Central processing portion (CPU)

Enough processing powerfulness for immoderate video conversion Plex performs

Storage

Enough free abstraction for media files, Plex room data, artwork, logs, and impermanent files

Network

Outbound velocity and monthly information transportation screen your expected streams

Plex account

You person an relationship to link and negociate the server

Media files

You clasp the authorities to the movies, shows, music, aliases photos you scheme to shop and stream

Once you tin link to the VPS, cheque its processor power, web capacity, and storage. These resources group the applicable limits connected really overmuch media you tin store, really galore streams the server tin handle, and whether playback runs without buffering.

Processor usage depends connected whether Plex tin play the original file. With Direct Play, Plex sends the record unconverted, truthful the server does very small processing.

If the viewing instrumentality doesn’t support the record aliases the relationship can’t grip its original quality, Plex mightiness transcode it by converting the video, audio, aliases solution during playback. Transcoding uses overmuch much CPU powerfulness and impermanent disk space.

Don’t presume that a modular VPS includes compatible graphics hardware for faster transcoding. Hardware-accelerated streaming requires supported hardware and an progressive Plex Pass. Without it, the CPU handles the conversion.

The web matters conscionable arsenic much. Outbound velocity determines whether each watercourse tin play without buffering, while the plan’s monthly information allowance determines really overmuch media the VPS tin nonstop successful total. Storage must besides time off room for Plex’s database, artwork, logs, and impermanent transcoding files, not conscionable your movies and shows.

Before choosing a VPS provider, cheque that it allows this type of usage and supports the web entree Plex needs. Plex licenses its server package for individual use, expects it to tally connected a location network, and notes that it mightiness not activity pinch each online hosting provider.

Important

Important! A VPS isn’t connected the aforesaid section web arsenic your viewing devices, truthful Plex treats video playback from it arsenic remote. Remote individual video playback requires Plex Pass connected the server administrator’s account, Plex Pass connected the viewer’s account, aliases Remote Watch Pass connected the viewer’s account. Music done Plexamp and photos done Plex Photos aren’t covered by this restriction.

How to group up a Plex server manually connected Ubuntu

Set up Plex manually connected Ubuntu 24.04 by installing Plex Media Server, creating media folders it tin access, connecting your Plex account, and allowing distant connections.

1. Update the Ubuntu server

Start by updating your Ubuntu server:

sudo apt update sudo apt upgrade -y

The first bid refreshes Ubuntu’s database of disposable packages. The 2nd installs the latest versions.

Ubuntu mightiness instal a caller Linux kernel during the upgrade. If it does, restart the VPS:

sudo reboot

The restart will adjacent your SSH connection. Wait for the server to travel backmost online, past reconnect earlier continuing.

2. Add the Plex repository and instal Plex Media Server

Ubuntu needs to cognize wherever to download Plex and really to corroborate that the package came from Plex.

A software repository is an online root that Ubuntu tin propulsion packages from and verify utilizing a signing key. Adding Plex’s repository besides lets later nationalist Plex releases get done Ubuntu’s normal package manager.

Install the devices needed to adhd the repository:

sudo apt instal -y curl gnupg2 sudo instal -d -m 0755 /etc/apt/keyrings

Download the Plex signing key:

curl -L https://downloads.plex.tv/plex-keys/PlexSign.v2.key \ | sudo gpg --yes --dearmor \ -o /etc/apt/keyrings/plexmediaserver.v2.gpg

The signing cardinal lets Ubuntu verify that Plex published the package and that it hasn’t been changed aft release.

Add the charismatic Plex repository:

echo "deb [signed-by=/etc/apt/keyrings/plexmediaserver.v2.gpg] https://repo.plex.tv/deb/ nationalist main" \ | sudo tee /etc/apt/sources.list.d/plex.list

Refresh the package database again and instal Plex Media Server:

sudo apt update sudo apt instal -y plexmediaserver

Once the installation finishes, Ubuntu tin instal early nationalist Plex releases done its accustomed package update process.

3. Start Plex and cheque that it’s running

Plex runs successful the inheritance arsenic a Linux service. A work is simply a programme that keeps moving aft you adjacent your SSH session. Ubuntu uses systemctl to manage Linux services, including starting, stopping, and checking their status.

Enable Plex and commencement it immediately:

sudo systemctl alteration --now plexmediaserver

The alteration portion tells Ubuntu to commencement Plex whenever the VPS boots. The –now portion starts it without waiting for the adjacent restart.

Check whether the work is active:

sudo systemctl is-active plexmediaserver

A moving installation returns:

active

You’re fresh to proceed erstwhile you spot that result.

If the bid returns inactive aliases failed, inspect the work position and caller log messages:

sudo systemctl position plexmediaserver sudo journalctl -u plexmediaserver -n 50 --no-pager

Look adjacent the bottommost of the output. A missing file, support failure, aliases larboard conflict will usually look there.

4. Create folders Plex tin access

Plex runs nether its ain Linux account, named plex. Your SSH relationship uploads the files, while the plex relationship sounds them during room scans and playback.

Both accounts request entree to the aforesaid media folders. Placing them successful a shared Linux group gives them that entree without making the files writable by each relationship connected the server.

Create a group named media, past adhd Plex and your existent login account:

sudo groupadd --force media sudo usermod -aG media plex sudo usermod -aG media "$USER"

Create a abstracted files for each media type:

sudo mkdir -p \ /srv/plexmedia/Movies \ "/srv/plexmedia/TV Shows" \ /srv/plexmedia/Music

Set your existent personification arsenic the proprietor and media arsenic the shared group:

sudo chown -R "$USER":media /srv/plexmedia

Adjust the files and record permissions for Plex:

sudo find /srv/plexmedia -type d -exec chmod 2775 {} \; sudo find /srv/plexmedia -type f -exec chmod 664 {} \;

These settings fto your relationship upload and shape files while giving Plex entree to the library. The starring 2 successful 2775 besides makes caller subfolders inherit the media group, truthful Plex is little apt to suffer entree arsenic the room grows.

Restart Plex aft changing its group membership:

sudo systemctl restart plexmediaserver

Disconnect and reconnect your SSH aliases file-transfer convention arsenic well. Linux applies your ain caller group rank erstwhile you motion successful again.

Check the Plex Support page for much guidance regarding Linux record and directory permissions.

Test the TV files done the aforesaid relationship Plex uses:

sudo -u plex ls "/srv/plexmedia/TV Shows"

No output is good if the files is empty. A Permission denied connection intends Plex still can’t entree the path.

5. Upload and shape your media

Use Secure File Transfer Protocol (SFTP) to transportation your media files securely.

SFTP sends files done the aforesaid encrypted relationship arsenic SSH. Upload each media type to its matching folder:

  • Movies: /srv/plexmedia/Movies
  • TV shows: /srv/plexmedia/TV Shows
  • Music: /srv/plexmedia/Music

Plex uses files and record names to activity retired what each point is. Clear naming helps it find the correct title, poster, summary, cast, and section information.

Give each movie its ain files and see the merchandise year:

/srv/plexmedia/Movies/ └── Arrival (2016)/ └── Arrival (2016).mkv

For a TV series, usage a show folder, play folder, and sXXeXX section number:

/srv/plexmedia/TV Shows/ └── Severance (2022)/ └── Season 01/ └── Severance (2022) - s01e01.mkv

In s01e01, s01 intends play 1 and e01 intends section 1.

Don’t operation movies and TV shows successful the aforesaid room folder. Plex scans each media type differently, truthful mixing them tin origin incorrect matches aliases make files vanish from the room scan.

After uploading a ample batch, check really overmuch disk abstraction remains:

df -h /srv/plexmedia

Check the Avail file to spot really overmuch abstraction remains.

Don’t capable the disk completely. Plex besides needs abstraction for its room database, downloaded artwork, logs, and impermanent files created during transcoding. By default, Plex keeps its transcoding files connected the operating strategy disk.

6. Open Plex done an SSH tunnel

Plex expects its first setup relationship to travel from the server itself aliases the aforesaid section network.

Your VPS is successful a information center, truthful your machine isn’t connected that section network. An SSH passageway solves this by securely forwarding a browser relationship from your machine to Plex connected the VPS.

Open a caller terminal connected your machine and run:

ssh -L 8888:127.0.0.1:32400 YOUR_USER@SERVER_IP

Replace:

  • YOUR_USER pinch your VPS username
  • SERVER_IP pinch your VPS IP address

The 2 larboard numbers person different jobs:

  • 8888 is simply a impermanent larboard connected your computer.
  • 32400 is the larboard Plex uses connected the VPS.

Keep the terminal open. Closing it besides closes the tunnel.

Now participate this reside successful your browser:

http://127.0.0.1:8888/web

Your browser connects to larboard 8888 connected your computer. SSH past carries that postulation securely to larboard 32400 connected the VPS.

Plex only requires this passageway during the first setup. Once the server is connected to your account, you tin entree it done the regular Plex Web App.

Sign successful to your Plex relationship and travel the setup screen.

Connecting the server to your relationship is besides called claiming the server. Claiming tells Plex which relationship owns the server and has support to alteration its settings.

7. Add your media libraries

A Plex room is simply a postulation for 1 type of media, specified arsenic movies, TV shows, aliases music.

During the setup screen, springiness the server a unique sanction – this is what shows up successful the Plex app’s server list. Then, prime Add LibraryMovies, TV Shows, aliases Music. Browse to the matching server folder. Then repetition the process for the different media types.

Use these paths:

Plex library

Server folder

Movies

/srv/plexmedia/Movies

TV shows

/srv/plexmedia/TV Shows

Music

/srv/plexmedia/Music

Don’t prime /srv/plexmedia arsenic 1 mixed library. Plex needs to cognize which scanning rules to usage for each folder.

After you adhd a library, Plex scans its files and downloads metadata. Metadata is the other accusation shown astir a file, including its poster, title, summary, cast, and section details.

Check respective items aft the scan finishes. If Plex selects the incorrect movie aliases show, cheque the record sanction and merchandise twelvemonth first. Plex relies connected decently separated and named media folders to lucifer files correctly.

8. Allow distant connections

Plex uses Transmission Control Protocol (TCP) larboard 32400 for its main server connection. Opening only this larboard lets Plex apps scope the server without exposing thing other moving connected it.

Ubuntu uses a firewall instrumentality called Uncomplicated Firewall (UFW). It comes pre-installed connected astir Ubuntu 24.04 images but is abnormal by default – instal it if your provider’s image doesn’t see it:

sudo apt instal -y ufw

Allow SSH earlier enabling the firewall. Otherwise, you could artifact the relationship you usage to negociate the VPS:

sudo ufw let OpenSSH sudo ufw let 32400/tcp sudo ufw enable sudo ufw status

Type y erstwhile Ubuntu asks whether to alteration UFW.

The output should database some SSH and 32400/tcp arsenic allowed.

If you changed the default SSH port, let that civilization larboard earlier enabling UFW alternatively of relying only connected the OpenSSH rule.

These rules configure your Ubuntu firewall to judge Plex postulation while leaving its optional local-network ports closed. Plex recommends opening only TCP larboard 32400 erstwhile the server has a nationalist IP address.

Your hosting supplier mightiness besides person a web firewall extracurricular Ubuntu. UFW controls postulation aft it reaches the VPS, while the supplier firewall controls whether that postulation reaches the VPS astatine all.

If your supplier blocks incoming connections by default, adhd an inbound TCP norm for larboard 32400 location arsenic well.

Enable distant entree successful Plex:

  1. Open Settings successful the Plex Web App.
  2. Select Remote Access nether the server settings.
  3. Click Enable Remote Access.
  4. Wait for Plex to trial the connection.

If the trial fails, alteration Manually specify nationalist port, participate 32400, and effort again.

A successful trial shows Fully accessible extracurricular your network.

Test the server from a telephone aliases different instrumentality that isn’t connected to your existent network.

While a video plays, unfastened the Plex dashboard and cheque the playback type:

  • Direct Play intends Plex sends the original record unchanged.
  • Direct Stream intends Plex repackages the record but doesn’t person the video.
  • Transcode intends Plex converts portion aliases each of the record during playback.

Plex chooses the mode based connected the original record and the formats supported by the receiving device.

If playback buffers and the dashboard show transcoding, cheque the VPS CPU use. A server that stays adjacent afloat CPU mightiness request much processing power, little playback quality, aliases files that the receiving instrumentality tin Direct Play.

How to group up Plex faster pinch a VPS template

You tin group up Plex faster pinch Hostinger’s Plex VPS template, which installs Ubuntu 24.04 and Plex Media Server for you.

Available pinch our Plex VPS hosting plans, the template skips the repository setup, package installation, and work configuration required by the manual method.

Hostinger VPS hosting landing page

Follow the Plex VPS template setup instructions to prime it successful hPanel, link to Plex done an SSH tunnel, and complete the first setup.

The template besides creates /home/plexlibrary/ for your media. Upload your files location done Secure File Transfer Protocol (SFTP), past adhd the corresponding folders arsenic Plex libraries.

Plex comes preinstalled, but you still request to link your account, shape your media, configure distant access, and support the VPS updated.

Important

Important! Applying the template to an existing VPS reinstalls its operating strategy and deletes the information stored connected it. Back up your VPS files you request earlier switching the OS.

What are the benefits of moving Plex connected a VPS?

A VPS keeps your Plex room disposable without requiring a location machine to enactment powered on.

  • The server stays online independently. Restarting aliases turning disconnected your individual machine won’t return Plex offline.
  • You don’t request to configure a location router. The VPS already has a nationalist IP address, though you still request to let Plex done its firewalls.
  • Your location upload velocity isn’t involved. Media leaves the information halfway wherever the VPS runs alternatively than passing done your location net connection.
  • You tin take the server location. Placing the VPS person to its regular viewers reduces the region each watercourse has to travel.
  • You tin summation resources later. A larger room aliases much simultaneous viewers mightiness require much storage, CPU power, RAM, aliases monthly information transfer.
  • Your media stays successful 1 library. Plex organizes movies, shows, music, and photos successful 1 place, disposable done supported apps connected to your account.

However, a VPS isn’t the correct fresh for each Plex library.

Large media collections tin make hosted retention expensive, and respective high-quality streams adhd up successful monthly information transportation fast.

Don’t presume that a VPS includes a compatible graphics processing portion (GPU) for hardware-assisted transcoding. Hardware-accelerated streaming requires an progressive Plex Pass.

A modular VPS useful champion erstwhile astir viewing devices tin usage Direct Play and the room fits wrong the plan’s retention and data-transfer limits.

How do you support a Plex server unafraid and responsive?

Keep your Plex server unafraid and responsive by limiting access, installing updates, monitoring resources, and backing up its data.

  • Secure the VPS itself. Use SSH keys, disable guidelines login, region unused services, configure a firewall, and show server logs.
  • Protect your Plex account. Use a unsocial password and alteration two-factor authentication, truthful a stolen password isn’t capable to motion in.
  • Install updates regularly. Because you added the Plex repository, Ubuntu tin update Plex on pinch the different installed packages:
sudo apt update sudo apt upgrade -y
  • Keep the firewall narrow. Allow your SSH larboard and TCP larboard 32400. Don’t expose Plex’s optional find ports connected a nationalist VPS.
  • Watch the server during playback. Monitor your server’s performance while 1 aliases much videos play. High CPU usage during a watercourse usually intends Plex is transcoding.
  • Leave free disk space. A afloat disk tin interrupt scans, updates, logging, and transcoding. Converting media for aggregate viewers astatine erstwhile often uses respective gigabytes of impermanent space.
  • Back up the Plex information directory. On Ubuntu, Plex stores its database, settings, artwork, and viewing accusation here:
/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/

This directory doesn’t incorporate the movie aliases euphony files themselves. It contains the accusation Plex uses to shape them. Back it up separately from your media truthful you don’t person to rebuild each room lucifer and mounting aft a server failure.

How do you hole communal Plex server setup problems?

Start troubleshooting pinch the Plex service, files permissions, larboard 32400, and existent server assets use.

Symptom

What to check

What to do

The setup page won’t open

Plex work and SSH tunnel

Run systemctl is-active plexmediaserver, recreate the tunnel, and support its terminal open

Plex shows an quiet library

Folder way and permissions

Confirm the way and tally sudo -u plex ls /path/to/library

Plex identifies the incorrect title

Folder and record names

Add the movie’s merchandise twelvemonth aliases usage sXXeXX episode numbering

Remote entree remains unavailable

UFW and the supplier firewall

Allow TCP larboard 32400 in some places, past retry the Plex test

Remote video won’t play

Plex relationship requirements

Confirm that the server administrator aliases spectator has the required Plex subscription

Playback buffers

CPU use, web speed, and playback type

Check whether Plex is transcoding, past little the value aliases usage a Direct Play format

New files don’t appear

Library scan and permissions

Scan the room again and corroborate that the plex user tin publication the files

Plex stops aft an update

Service logs

Run sudo journalctl -u plexmediaserver -n 50 --no-pager and cheque the newest error

If the setup page won’t load, cheque that the Plex work is progressive earlier changing firewall rules. An unfastened larboard won’t thief erstwhile the exertion down it isn’t running.

If Plex can’t spot your files, trial the files arsenic the plex user. This tells you whether the nonaccomplishment is owed to Linux permissions aliases an incorrect room path.

If distant entree fails, cheque some firewall layers. Opening the larboard successful Ubuntu won’t thief if your hosting provider’s web firewall still blocks it.

If playback stutters, unfastened the Plex dashboard earlier upgrading the VPS. Direct Play pinch debased CPU usage points toward a web limit. Sustained precocious CPU during transcoding points toward a processing limit.

Manual installation gives you the astir power complete packages, folders, and permissions. The preconfigured template gets Plex moving faster. Both methods still request capable storage, readable media folders, restricted web access, and server resources that lucifer your expected streams.

All of the tutorial contented connected this website is taxable to Hostinger's rigorous editorial standards and values.

Author

Add arsenic Google Prefered Source

Alma is an AI Content Editor pinch 9+ years of acquisition helping ideas return style crossed SEO, marketing, and content. She loves moving pinch words, structure, and strategy to make contented some useful and enjoyable to read. Off the clock, she tin beryllium recovered gaming, drawing, aliases diving into her latest D&D adventure.

Author

The Co-author

Ariffud Muhammad

Add arsenic Google Prefered Source

Ariffud is simply a Technical Content Writer pinch an acquisition inheritance successful Informatics. He has extended expertise successful Linux and VPS, authoring complete 200 articles connected server guidance and web development. Follow him connected LinkedIn.

More