How to Install Plex in a Docker Container

If you want a clean, portable, and easily maintainable Plex setup, running Plex in Docker is the best option. It keeps Plex isolated, makes upgrades trivial, and plays nicely with VPN containers, download clients, and other services. If you want to run Plex and route traffic via a VPN, click here for instructions.

This guide assumes:

  • Docker is already installed

  • You have a media directory on the host

Run in terminal:

docker pull plexinc/pms-docker:1.42.2.10156-f737b826c

Architecture

[ Plex Container ][ Host Network ][ LAN ][ Clients ]

Plex runs in its own container and exposes ports to the host.


Step 1 – Create Directories on the Host

You need:

  • One directory for Plex config

  • One (or more) for media

Example:

mkdir -p /docker/plex/config
mkdir -p /media/movies
mkdir -p /media/tv

Adjust paths for:

  • macOS: /Users/yourname/...

  • Windows: C:\docker\plex\config


Step 2 – Run Plex Container

Recommended image: linuxserver/plex

docker run -d \
--name plex \
--restart unless-stopped \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=America/New_York \
-p 32400:32400 \
-v /docker/plex/config:/config \
-v /media:/media \
linuxserver/plex

What these do:

  • -p 32400:32400 → Plex web + client access

  • /config → Plex database + settings

  • /media → Your movies / TV / music

  • PUID/PGID → File permissions (important on Linux/NAS)


Step 3 – Open Plex and Claim Server

In your browser:

http://<host-ip>:32400/web

Example:

http://192.168.1.50:32400/web

Sign in with your Plex account and claim the server.


Step 4 – Add Libraries

Inside Plex UI:

  • Settings → Libraries → Add Library

  • Point to:

    • /media/movies

    • /media/tv

    • etc.

Plex will begin scanning immediately.


Step 5 – Verify

You should now be able to:

  • Play media locally

  • See the server from other devices on the network

  • Access the Plex web UI reliably

At this point:

Plex is fully functional in Docker.


Important Notes (That Save Headaches)

1. Permissions Matter

If media doesn’t show up:

  • Check ownership of /media

  • PUID and PGID must match the user who owns the files


2. Hardware Transcoding

If you plan to use hardware acceleration (Intel Quick Sync, NVIDIA, Apple VideoToolbox), you will need:

  • Extra device mappings

  • Different flags

This is optional and can be layered later.


3. Remote Access

Remote access works normally with this setup:

  • Port 32400 forwarded on router (if desired)

  • Or Plex Relay

No special config required at this stage.