keepcalculator

06 Numbers and Powers

Install Plex Media Server on CentOS: Step-by-Step

Card No. 06·1350 · Updated · Standard formula, shown below

This guide walks you through installing Plex Media Server on CentOS, turning your server into a personal media hub. You’ll add the official Plex repository, install the package, and configure basic settings. By the end, you’ll have a working Plex server accessible from your local network.

What You’ll Need

  • A CentOS server (7, 8, or 9) with root or sudo access.
  • An internet connection to download the package.
  • Optional: A static IP address or a hostname for your server.
  • Optional: A Plex account (free) to access your library remotely.

Step-by-Step

  1. Update your system
    Run sudo yum update -y (CentOS 7) or sudo dnf update -y (CentOS 8/9) to ensure all existing packages are up to date.
  2. Add the Plex repository
    Plex provides an official RPM repository. Create a repo file:
    sudo tee /etc/yum.repos.d/plex.repo <<EOF
    [plex]
    name=Plex Repository
    baseurl=https://downloads.plex.tv/repo/rpm/
    enabled=1
    gpgcheck=1
    gpgkey=https://downloads.plex.tv/plex-keys/PlexSigningKey.asc
    EOF
  3. Install Plex Media Server
    Use your package manager to install:
    sudo yum install plexmediaserver -y (or sudo dnf install plexmediaserver -y on CentOS 8/9).
  4. Enable and start the service
    Plex runs as a systemd service. Enable it to start on boot and launch it now:
    sudo systemctl enable plexmediaserver
    sudo systemctl start plexmediaserver
  5. Verify the service is running
    Check status with sudo systemctl status plexmediaserver. You should see “active (running)�. If not, check logs with journalctl -u plexmediaserver.
  6. Open the firewall (if enabled)
    If you have firewalld active, allow Plex’s default port (32400):
    sudo firewall-cmd --permanent --add-port=32400/tcp
    sudo firewall-cmd --reload
  7. Access the Plex web interface
    Open a browser and go to http://your-server-ip:32400/web. You’ll see the initial setup wizard.
  8. Complete the initial setup
    Sign in with a Plex account (or create one), name your server, and add media libraries (e.g., Movies, TV Shows) by specifying folder paths on your server.
  9. Optional: Set up remote access
    In Plex settings, enable “Remote Access� to allow streaming outside your local network. This requires port forwarding on your router (TCP 32400) and a Plex account.

Common Mistakes

  • Using the wrong repository URL – Ensure the baseurl is exactly https://downloads.plex.tv/repo/rpm/ with a trailing slash.
  • Forgetting to enable the service – If you don’t run systemctl enable, Plex won’t start after a reboot.
  • Ignoring the firewall – Even if Plex is running, a firewall can block access. Always open port 32400.
  • SELinux blocking access – CentOS has SELinux enabled by default. If you store media in unusual locations, you may need to adjust SELinux contexts. Use sudo chcon -R -t httpd_sys_rw_content_t /path/to/media or set booleans as needed.
  • Using a weak password for the Plex account – Since Plex can be accessed remotely, use a strong unique password.

Tips

  • Use a static IP – Assign a static IP to your server to avoid connection issues when the IP changes.
  • Organize your media folders – Plex scans folders you add. Keep movies and TV shows in separate directories for better metadata matching.
  • Update Plex regularly – Check for updates with sudo yum update plexmediaserver (or dnf) to get new features and security fixes.
  • Back up your Plex configuration – The configuration is in /var/lib/plexmediaserver/Library. Back it up before major changes.
  • Use a dedicated user – Plex runs as the plex user. Ensure that user has read access to your media directories.

Troubleshooting

  • Web interface not loading – Check that the service is running: systemctl status plexmediaserver. Also verify port 32400 is open: ss -tuln | grep 32400. If not, restart the service.
  • Permission denied when scanning media – Ensure the plex user has execute and read permissions on the media folders. Use chmod -R o+rx /path/to/media or chown -R plex:plex /path/to/media (if appropriate).
  • SELinux errors – If you see “Permission deniedâ€� in logs but file permissions are correct, SELinux may be blocking. Temporarily set SELinux to permissive with setenforce 0 to test. If that fixes it, adjust contexts permanently.
  • Cannot connect remotely – Ensure your router forwards TCP port 32400 to the server’s IP. Also check that Plex’s “Remote Accessâ€� is enabled and shows a green checkmark.
  • Plex doesn’t start after reboot – Run systemctl is-enabled plexmediaserver. If it says “disabledâ€�, re-enable it.

Frequently Asked Questions

Do I need a Plex account to use Plex Media Server?

Yes, a free Plex account is required to access the server’s web interface and to use features like remote access and syncing.

Can I install Plex on CentOS 7?

Yes, the official repository supports CentOS 7. Use yum commands as shown. Note that CentOS 7 is EOL, so consider upgrading to a newer version for security.

How do I update Plex after installation?

Run sudo yum update plexmediaserver (or sudo dnf update plexmediaserver). The repository will fetch the latest version.

What port does Plex use?

Plex uses TCP port 32400 for its web interface and remote access. You must open this port in your firewall and router.

Can I run Plex on a headless server?

Yes, Plex is designed to run headless. You manage it via the web interface from any device on your network.

How do I uninstall Plex?

Use sudo yum remove plexmediaserver (or sudo dnf remove plexmediaserver). Optionally, remove the configuration directory /var/lib/plexmediaserver if you want to delete all data.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →