How to Set Up Plex with Docker Compose (Step-by-Step Video)

Plex logo with the words install with Docker Compose, step by step

For educational purposes only. This guide shows how to install self-hosted software on your own hardware. I don't condone piracy: only use these apps with media you own or have the right to use, and follow the law where you live. Back up your data first. Full disclaimer

Updated 16 November 2026 Tested with: Plex Media Server 1.43.5

Plex turns your films and TV shows into your own Netflix. It shows them with artwork and descriptions, remembers where you got to, and plays them on almost anything: smart TVs, phones, tablets, Apple TV, Fire Stick, games consoles and web browsers, at home or away.

This guide sets up Plex with Docker Compose in six short steps, including hardware transcoding so it runs smoothly when several people watch at once. It takes about 15 minutes.

On this page (13 sections)

Watch: install Plex with Docker Compose

The video has subtitles at the bottom and no sound. It was recorded on a clean test install linked to a demo Plex account, with the account name blurred. It uses a simple compose file with host networking; the generator below gives you more options. The test film is Big Buck Bunny © Blender Foundation, peach.blender.org, licensed under Creative Commons Attribution 3.0.

See how Plex plays your films

Pick what someone’s watching on and what they’re watching. When the device can’t play a file as it is, Plex has to transcode it (convert it on the fly), and that’s hard work for your server. Try the old web browser with the 4K film and three people, then switch on Hardware transcoding. Under the demo is the generator you’ll use in Step 2.


Open the generator full screen

What you need to set up Plex with Docker Compose

  • A computer or NAS running Docker. New to Docker? My Docker install guide covers Windows, Mac and Linux.
  • A free Plex account from plex.tv.
  • Your films and TV in folders. If you use Radarr and Sonarr, that’s /data/media/movies and /data/media/tv.
Do I need a Plex Pass? No, Plex works without one. But hardware transcoding (letting a graphics chip do the heavy lifting) needs a Plex Pass. If most of your devices Direct Play, as in the demo, you may never miss it.

Step 1: Get a claim token

The claim token links your new server to your Plex account automatically.

  1. Sign in at plex.tv/claim.
  2. Copy the code it shows. It starts with claim-.

It only works for 4 minutes, so get Step 2 ready first, then grab the code just before you start Plex in Step 3.

Step 2: Make your compose file

In the generator, keep Host network (recommended), and choose your hardware transcoding: Intel / AMD for most mini PCs and NAS boxes, NVIDIA if you have a GeForce or Quadro card, or None. Then on your server:

  1. Make a folder and go into it:
    mkdir -p ~/plex && cd ~/plex
  2. Save compose.yaml and .env from the generator there.
  3. Paste your claim token after PLEX_CLAIM= in .env.

Plex gets only your /data/media folder. It needs to read your films and shows, but not your downloads.

Step 3: Start it and sign in

Run the commands from the generator’s Commands tab. The important one is:

docker compose up -d

Then open http://YOUR-SERVER-IP:32400/web. You’ll be signed in to your Plex account and asked to name your server. Give it a name you’ll recognise, like “Home”.

Step 4: Add your libraries

  1. In the setup wizard (or later in Settings → Manage → Libraries → Add Library), choose Movies.
  2. Click Browse for media folder and pick /data/media/movies, then Add Library.
  3. Do the same with TV Shows and /data/media/tv.

Plex scans the folders and fetches artwork and descriptions. A big library can take a while the first time.

Step 5: Turn on hardware transcoding

Skip this if you chose None in the generator.

  1. Go to Settings → Transcoder and click Show Advanced.
  2. Tick Use hardware acceleration when available (and Use hardware-accelerated video encoding if it’s there).
  3. If you ticked Transcode in RAM, set Transcoder temporary directory to /transcode.
  4. Click Save Changes.

To check it works, play something that needs transcoding (for example, lower the quality in the player to 720p), then open Dashboard. The stream should say Transcode (hw).

Step 6: Watch away from home (optional)

  1. Go to Settings → Remote Access and click Enable Remote Access.
  2. If it turns green, you’re done. Your Plex apps will find the server anywhere.
  3. If it stays red, tick Manually specify public port, enter 32400, and forward port 32400 (TCP) on your router to your server’s IP. Many routers can also do this automatically with UPnP.

Connect Radarr and Sonarr (optional)

Plex notices new files on its own, but you can make new films and episodes appear instantly. In Radarr and Sonarr, go to Settings → Connect → + → Plex Media Server, sign in with Plex, and tick Update Library.

If something’s wrong

  • The server doesn’t appear in your Plex account. The claim token expired. Get a new one, put it in .env, and run docker compose up -d --force-recreate within 4 minutes.
  • A library is empty. Check the folder path, and that Plex’s PUID/PGID can read your media folders.
  • Videos buffer. Open Dashboard while it plays. If it says Transcode without (hw), your CPU is doing the work. Turn on hardware transcoding, or set the player’s quality to Original so it can Direct Play.
  • The TV app can’t find the server. Use host networking (the generator’s default). On bridge, add your server’s address under Settings → Network → Custom server access URLs.
  • No hardware option in Settings. You need a Plex Pass and a supported GPU passed into the container. Check the generator’s Commands tab for how to test it.

Updating Plex

cd ~/plex
docker compose pull && docker compose up -d

Frequently asked questions

Do I need Plex Pass for hardware transcoding?

Yes. Hardware transcoding in Plex needs a Plex Pass and a supported GPU passed into the container. Without it, Plex transcodes on the CPU.

Why doesn't my Plex server appear in my account?

The claim token expired. Tokens only last 4 minutes. Get a new one, put it in .env and run docker compose up -d --force-recreate straight away.

Why do my videos buffer in Plex?

Open Dashboard while it plays. If it says Transcode without (hw), the CPU is doing the work. Turn on hardware transcoding, or set the player's quality to Original so it can Direct Play.

Plex or Jellyfin?

Plex is more polished and easier to use away from home. Jellyfin is free and open source, with hardware transcoding at no cost. You can run both on the same films. See my Jellyfin guide.

Thank you

Thanks to Plex for a great free media server, and to LinuxServer.io for the Docker image this guide uses.

Next in this series: SABnzbd, for downloading from Usenet.

If this guide helped you, consider buying me a coffee. It helps keep guides like this one coming.

☕Buy me a coffee

Get new guides by email

About one email a month: new step-by-step guides and card releases. No spam, unsubscribe any time.

I'll send a confirmation email first. See the privacy policy.

Leave a Reply