Tech Up Your Life is reader-supported. Learn more.

How to Install Plex on Docker

Plex is a popular media server software that allows you to organize and stream your media files across multiple devices. Docker, on the other hand, is a platform that helps you easily create, deploy, and run applications in containers. By installing Plex on Docker, you can ensure a consistent and reliable experience across different environments. In this guide, we will walk you through the process of installing Plex on Docker step-by-step.

What is Plex?

How to Install Plex on Docker

Plex is a media server that allows users to organize and stream their media content to multiple devices. It has a user-friendly interface that enables users to easily add and manage their media libraries. Plex can transcode media on the fly, enabling users to watch their content on different devices with different resolutions and formats. It also supports a wide range of platforms, including smart TVs, streaming devices, and mobile devices.

What is Docker?

Docker is an open-source containerization platform that allows developers to package applications and their dependencies into containers. Containers are lightweight, portable, and isolated environments that provide a consistent runtime for applications. Docker containers can run on any platform that supports Docker, including Windows, Mac, Linux, and cloud platforms like Amazon Web Services (AWS) and Google Cloud Platform (GCP). Docker simplifies the deployment and management of applications by providing a standardized way of packaging and running them.

Why Use Docker for Plex?

Using Docker for Plex has several advantages:

  1. Portability: Docker containers are portable and can be run on any platform that supports Docker. This makes it easy to move Plex between different environments without worrying about compatibility issues.
  2. Isolation: Docker containers are isolated from the host system and other containers, providing a secure runtime environment for Plex. This reduces the risk of conflicts with other applications or dependencies on the host system.
  3. Easy management: Docker provides a simple and consistent way of managing Plex and its dependencies. Updates and maintenance tasks can be easily performed using Docker commands.
  4. Scalability: Docker makes it easy to scale Plex by creating multiple containers running the same application. This enables load balancing and improves performance.

How to Install Plex on Docker

Here’s how to install Plex on Docker, from installing Docker to configuring Plex!

Step 1: Install Docker

First, install Docker. You can run Docker on Linux, macOS, and Windows.

Step 2: Create a Docker network

The next step is to create a Docker network. This is required to allow your Plex container to communicate with other containers. To create a network, run the following command:

docker network create plex

Step 3: Download the Plex Docker image

The next step is to download the Plex Docker image. This image contains all the necessary files and dependencies required to run Plex. To download the image, run the following command:

docker pull plexinc/pms-docker

Step 4: Create a Plex container

Once you have downloaded the Plex Docker image, the next step is to create a container. This container will run the Plex server. To create a container, run the following command:

docker create \
--name=plex \
--network=plex \
-e PUID=<UID> -e PGID=<GID> \
-e VERSION=<VERSION> \
-v </path/to/plex/config>:/config \
-v </path/to/plex/data>:/data \
-v </path/to/plex/transcode>:/transcode \
plexinc/pms-docker

But let’s dig in and understand what’s going on with this Docker command:

Let’s break down this command:

  • docker create: This command creates a new container.
  • --name=plex: This sets the name of the container to “plex”.
  • --network=plex: This connects the container to the “plex” network that we created earlier.
  • -e PUID=<UID> -e PGID=<GID>: This sets the user and group IDs for the container. Replace <UID> and <GID> with the IDs of your user and group.
  • -e VERSION=<VERSION>: This sets the version of Plex that you want to use. Replace <VERSION> with the version number (e.g., “latest”).
  • -v </path/to/plex/config>:/config: This maps the Plex configuration directory on your host machine to the container’s /config directory.
  • -v </path/to/plex/data>:/data: This maps the Plex data directory on your host machine to the container’s /data directory.
  • -v </path/to/plex/transcode>:/transcode: This maps the Plex transcode directory on your host machine to the container’s /transcode directory.
  • plexinc/pms-docker: This specifies the name of the Docker image that we downloaded earlier.

Alternatively, you can install Plex on Docker using Docker Compose. Create a new Docker Compose file called docker-compose.yml in your preferred directory and copy/paste the following content:

version: "3"
services:
  plex:
    container_name: plex
    image: plexinc/pms-docker
    restart: unless-stopped
    network_mode: host
    environment:
      - PLEX_CLAIM=your_claim_token
      - TZ=your_timezone
      - ADVERTISE_IP=http://your_host_ip:32400/
    volumes:
      - ~/plex/config:/config
      - ~/plex/media:/media
      - ~/plex/transcode:/transcode

Replace your_claim_token with the claim token you obtain from https://www.plex.tv/claim/. Replace your_timezone with your timezone (e.g., ‘America/New_York’) and your_host_ip with the IP address of your Docker host.

Step 5: Start the Plex container

Now that we have created the Plex container, the next step is to start it. To start the container, run the following command:

docker start plex

Step 6: Configure Plex

Once the container is running, you can access the Plex web interface by navigating to http://localhost:32400/web in your web browser. From here, you can configure Plex and add media files to your library.

Understanding Plex for Docker

Plex’s Docker containerization offers three different networking types:

  • Bridge: The default networking type, bridge, establishes a new network inside the host where it runs containers. Bridge networking is connected to the physical network using an internal router configured by Docker to forward specific ports to containers.
  • Host: How networking relies on the IP address of the host that’s running Docker so a container’s network is presented as the host device, not a separate IP address.
  • Macvlan: With a macvlan set up, a fresh virtual computer is created on the network that’s the container.

Host and macvlan networking are pretty similar and easy to configure.

For host networking, use:

docker run \
-d \
--name plex \
--network=host \
-e TZ="<timezone>" \
-e PLEX_CLAIM="<claimToken>" \
-v <path/to/plex/database>:/config \
-v <path/to/transcode/temp>:/transcode \
-v <path/to/media>:/data \
plexinc/pms-docker

With macvlan, use:

docker run \
-d \
--name plex \
--network=physical \
--ip=<IPAddress> \
-e TZ="<timezone>" \
-e PLEX_CLAIM="<claimToken>" \
-h <HOSTNAME> \
-v <path/to/plex/database>:/config \
-v <path/to/transcode/temp>:/transcode \
-v <path/to/media>:/data \
plexinc/pms-docker

On bridge networking, you’ll use:

docker run \
-d \
--name plex \
-p 32400:32400/tcp \
-p 3005:3005/tcp \
-p 8324:8324/tcp \
-p 32469:32469/tcp \
-p 1900:1900/udp \
-p 32410:32410/udp \
-p 32412:32412/udp \
-p 32413:32413/udp \
-p 32414:32414/udp \
-e TZ="<timezone>" \
-e PLEX_CLAIM="<claimToken>" \
-e ADVERTISE_IP="http://<hostIPAddress>:32400/" \
-h <HOSTNAME> \
-v <path/to/plex/database>:/config \
-v <path/to/transcode/temp>:/transcode \
-v <path/to/media>:/data \
plexinc/pms-docker

How to Install Docker

Here’s how to install Docker on Linux:

Step 1: Update the system

Before you start installing Docker, it’s essential to ensure that your system is up-to-date. You can do this by running the following command:

sudo apt-get update

This command will update your system’s package lists to ensure that you have the latest versions of all installed packages.

Step 2: Install Docker

Once your system is updated, you can install Docker by running the following command:

sudo apt-get install docker-ce docker-ce-cli containerd.io

This command will install Docker and its dependencies on your system.

Step 3: Start the Docker service

After the installation is complete, you need to start the Docker service by running the following command:

sudo systemctl start docker

This command will start the Docker service on your system. You can also check the status of the Docker service by running the following command:

sudo systemctl status docker

This command will display the status of the Docker service.

sudo docker run hello-world

This command will download a test image and run it in a container. If the installation is successful, you should see a message that says “Hello from Docker!” in the output.

Congratulations! You have successfully installed Docker on your Linux system. You can now start building and running applications in containers using Docker.

How to Install Docker on Windows

Step 1: System requirements

Before installing Docker, you need to ensure that your Windows machine meets the following system requirements:

  • Windows 10 64-bit: Pro, Enterprise, or Education (Build 16299 or later)
  • Windows Server 2016 or later

Your machine should also have:

  • A 64-bit processor with Second Level Address Translation (SLAT)
  • At least 4 GB of RAM
  • Virtualization support enabled in BIOS

Step 2: Download Docker Desktop for Windows

To download Docker Desktop for Windows, follow these steps:

  1. Go to the Docker Desktop for Windows page.
  2. Click the “Download for Windows” button.
  3. If prompted, log in to your Docker Hub account. If you don’t have a Docker Hub account, you can create one for free.
  4. Once logged in, the download will start automatically.

Step 3: Install Docker Desktop for Windows

To install Docker Desktop for Windows, follow these steps:

  1. Locate the downloaded installer and double-click it.
  2. If prompted by User Account Control (UAC), click “Yes” to allow the installer to make changes to your system.
  3. Follow the on-screen instructions to complete the installation. You may be prompted to restart your computer.
  4. Once the installation is complete, Docker Desktop for Windows will launch automatically.

Step 4: Configure Docker

After installing Docker Desktop for Windows, you need to configure Docker by setting up your Docker preferences. To do this, follow these steps:

  1. Right-click the Docker Desktop icon in the system tray and select “Settings.”
  2. In the Settings dialog box, select the “General” tab.
  3. Set the desired options for starting Docker Desktop at login, sending usage statistics, and updating Docker.
  4. Select the “Resources” tab and set the desired options for CPU, memory, and disk usage.
  5. Select the “Advanced” tab and set the desired options for HTTP/HTTPS proxy settings, network settings, and other advanced options.
  6. Click “Apply & Restart” to save your changes and restart Docker Desktop.

Step 5: Verify Docker installation

To verify that Docker is installed correctly, you can run the following command in a PowerShell or Command Prompt window:

docker --version

This command should output the version number of Docker that you have installed.

Step 6: Get started with Docker

With Docker Desktop for Windows installed and configured, you can now start using Docker to run and manage containers. You can use the Docker command-line interface (CLI) or a Docker GUI tool such as Docker Compose to create and manage containers.

To get started with Docker, you can try running a simple “Hello World” container:

  1. Open a PowerShell or Command Prompt window.
  2. Run the following command:
docker run hello-world

This command will download the “hello-world” image from the Docker Hub registry and run a container based on that image. Once the container is running, you should see a message that says “Hello from Docker!” followed by some additional output.

Congratulations, you have successfully installed Docker on your Windows machine and run your first container!

How to Install Docker on macOS

If you’re an Apple aficionado, here’s how to install Docker on macOS:

Step 1: Check system requirements

Before installing Docker on macOS, you should ensure that your system meets the following requirements:

  • macOS 10.13 or newer
  • 64-bit processor with Intel chip or Apple silicon

Step 2: Download Docker for Mac

Go to the Docker website and click on the “Download from Docker Hub” button to download the latest stable release of Docker for Mac.

Once the download is complete, double-click on the .dmg file to open the installer.

Step 3: Install Docker for Mac

In the Docker for Mac installer window, drag the Docker icon to the Applications folder to install Docker on your Mac.

When the installation is complete, double-click the Docker icon in the Applications folder to launch Docker.

You will be prompted to grant permission to Docker to run on your system. Click “OK” to proceed.

Step 4: Run Docker

Once Docker is installed and running, you can verify that it’s working correctly by opening a terminal window and entering the following command:

docker version

If everything is working properly, you should see output similar to the following:

Client:
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.7
 Git commit:        3967b7d
 Built:             Fri Jul 30 19:55:20 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.8
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.7
  Git commit:       75249d8
  Built:            Fri Jul 30 19:53:53 2021
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.4.9
  GitCommit:        e25210fe30a0a703442421b0f60afac609f950a3
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Step 5: Test Docker

To test that Docker is working correctly, you can run a simple Docker container by entering the following command in the terminal window:

docker run hello-world

If everything is working correctly, you should see output similar to the following:

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete 
Digest: sha256:9f6ad537c4e23a5a14da21b99c22e5

This indicates that Docker was able to successfully download and run the “hello-world” container image.

Congratulations! You have successfully installed Docker on your Mac and tested that it’s working correctly. You can now start exploring the world of containerization and build and deploy your own Docker containers on your Mac.

Best Plex Servers – Top Plex NAS Devices

Whether you’re in the market for your first Plex server or are upgrading, a new Plex media server may be in order. The best Plex servers are the NVIDIA Shield TV Pro 2019, Synology DS920+, QNAP TVS-872XT, TerraMaster F2-421, and Dell PowerEdge T40. We also recommend the QNAP TSx53D and Raspberry Pi 4.

Best Plex Client – Top Plex Streaming Devices

If you’re looking for a device to stream your media library on, you’ve got plenty of choices. The Plex app is available for various platforms including Android, Android TV, iOS, iPadOS, tvOS, macOS, Roku, Amazon Fire TV, PlayStation 5, Xbox Series X/S, Windows, and Kodi. The best Plex client devices are the NVIDIA Shield TV Pro 2019, Roku Ultra, Amazon Fire TV Cube, and Apple TV. On a budget, we recommend the Chromecast with Google TV, Amazon Fire TV 4K Stick Max, and Roku Streaming Stick 4K+.

How to Install Plex on Docker: FAQs

How do you install Plex in a Docker container?

To install Plex on Docker first, install and set up Docker on your host operating system – Linux, macOS, or Windows. Then, pull the Plex Media Server Docker image. After that, configure Plex, point Plex for Docker to your media files, and you’re ready to start streaming.

Is Plex better on Docker?

Plex on Docker lets you easily spin up or delete a Plex Media Server instance, make your app portable, and requires fewer resources than running on bare metal. However, streaming media performance is about the same as a native install of Plex.

How to Install Plex on Docker: Final Thoughts

Overall, Installing Plex on Docker is a great way to containerize your media server. You can set up Plex on Docker in Linux, Windows, or macOS. Additionally, many NAS boxes from the likes of Synology run Docker, so you can spin up a Plex Docker container on a network-attached storage device. For another great option, find out how to setup Plex Media Server on the Nvidia Shield TV.

Tech Up Your Life is reader-supported and a participant in affiliate programs including the Amazon Services LLC Associates Program. However, all products are thoroughly tested and reviews are honest and unbiased. Learn more.