> For the complete documentation index, see [llms.txt](https://docs.acecloud.ai/knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acecloud.ai/knowledge-base/tutorials/how-to-install-plex-media-server-on-ubuntu-20.04.md).

# How to install Plex media server on Ubuntu 20.04?

{% embed url="<https://youtu.be/VLRd_znnv2A>" %}

### **Overview**

Plex media server helps in managing movie, music, and photo libraries and stream content to your TV, computer, phone, tablet, or TV at any time and from any location. This tutorial outlines the installation process for Plex Media Server on Ubuntu 20.04.

### **Prerequisites**

There are certain prerequisites that need to be met before you begin.&#x20;

* A server running Ubuntu 22.04
* Non-root sudo user privileges

### **Get Started**

**Step 1** - Installation of Plex Media Server on Ubuntu 20.04

* Import the GPG key for the Plex APT repository and add it to your system:

```
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
```

<img src="https://customer.acecloudhosting.com/index.php?rp=/images/kb/1406_image-2023-4-18_15-27-44-2.png" alt="" height="40" width="800">

```
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
```

<img src="https://customer.acecloudhosting.com/index.php?rp=/images/kb/1409_image-2023-4-18_15-30-20.png" alt="" height="17" width="800">

* Update the apt package list.

```
sudo apt update
```

<img src="https://customer.acecloudhosting.com/index.php?rp=/images/kb/1404_image-2023-4-18_15-31-14-1.png" alt="" height="50" width="800">

* Now, install the most recent server version of plex media server after the repository has been enabled:

```
sudo apt install plexmediaserver
```

<img src="https://customer.acecloudhosting.com/index.php?rp=/images/kb/1397_image-2023-4-18_15-35-13.png" alt="" height="146" width="800">

* Check the status of the service to ensure that the Plex is active:

```
sudo systemctl status plexmediaserver
```

<img src="https://customer.acecloudhosting.com/index.php?rp=/images/kb/1402_image-2023-4-18_15-32-38-1.png" alt="" height="140" width="800">

Congratulations! You now have a Plex media server set up on your Ubuntu computer.

**Step 2** - Firewall Modifications

* Make sure the server firewall is set up to permit traffic on the Plex-specific ports after Plex has been installed and is active on your server.

```
sudo nano /etc/ufw/applications.d/plexmediaserver
```

```
[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp

[plexmediaserver-dlna]
title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)
ports=1900/udp|32469/tcp

[plexmediaserver-all]
title=Plex Media Server (Standard + DLNA)
description=The Plex Media Server (with additional DLNA capability)
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp|1900/udp|32469/tcp
```

<img src="https://customer.acecloudhosting.com/index.php?rp=/images/kb/1400_image-2023-4-18_15-46-15.png" alt="" height="114" width="800">

* Update the profiles list and save the file:

```
sudo ufw app update plexmediaserver
```

* Implement the updated firewall guidelines:

```
sudo ufw allow plexmediaserver-all
```

![](https://customer.acecloudhosting.com/index.php?rp=/images/kb/1399_image-2023-4-18_15-41-18.png)

**Step 3** - Setting up Plex Media Server

* For launching the Plex setup wizard, first construct the directories that will store the Plex media files:

```
sudo mkdir -p /opt/plexmedia/{movies,series}
```

* The Plex Media Server runs as user plex, hence the user must be granted read and execute access to the media files. Enter the following command to set the privileges:

```
sudo chown -R plex: /opt/plexmedia
```

* Now you may start configuring the server. Enter *<http://your\\_server\\_IP:32400/web>* in your browser to access the Plex media server web interface.

```
http://23.29.XXX.XX:32400/web
```

<figure><img src="https://customer.acecloudhosting.com/index.php?rp=/images/kb/1398_image-2023-4-18_15-20-58.png" alt=""><figcaption></figcaption></figure>

### **Conclusion**

We have successfully demonstrated how to install Plex Media Server on Ubuntu 20.04.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.acecloud.ai/knowledge-base/tutorials/how-to-install-plex-media-server-on-ubuntu-20.04.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
