Home > Software > How to Set Up Plex Media Server with Docker Compose

How to Set Up Plex Media Server with Docker Compose

Anastasios Antoniadis

Discover the seamless process of setting up a Plex Media Server with Docker Compose through our detailed guide. Streamline your media management and enjoy a personalized home entertainment system with ease.

Docker (1)

Plex is a popular media server software that organizes video, music, and photos from personal media libraries and streams them to smart TVs, streaming boxes, and mobile devices. Docker Compose simplifies the deployment of Plex Media Server on a containerized environment, offering an easy and efficient way to manage your media library. This guide will walk you through setting up Plex Media Server using Docker Compose, enabling you to enjoy your media collection with minimal setup hassle.

Prerequisites

Before you start, ensure you have the following:

  • Docker installed on your system.
  • Docker Compose installed on your system.
  • Basic understanding of Docker concepts and the YAML syntax used in Docker Compose files.

Step 1: Create a Docker Compose File

Create a directory dedicated to your Plex setup. This directory will contain your Docker Compose file (docker-compose.yml) and any additional configuration files or directories you might need.

mkdir plex-docker && cd plex-docker

Create the docker-compose.yml file:

touch docker-compose.yml

Open this file in a text editor and insert the following configuration:

version: '3.8'
services:
  plex:
    image: plexinc/pms-docker
    container_name: plex_media_server
    network_mode: host
    environment:
      - PLEX_CLAIM= # Insert your claim token here
      - ADVERTISE_IP=http://your-server-ip:32400/
    volumes:
      - /path/to/plex/config:/config
      - /path/to/plex/transcode:/transcode
      - /path/to/your/media:/data
    restart: unless-stopped

Configuration Explained:

  • image: Specifies the Plex Media Server Docker image from the official Plex Inc repository.
  • container_name: Sets a custom name for your container for easier reference.
  • network_mode: Uses the host network mode for easier port management and network performance.
  • environment:
    • PLEX_CLAIM: Use a claim token to link your new Plex server to your account. Obtain a claim token at https://www.plex.tv/claim.
    • ADVERTISE_IP: Set this to the IP address of your server followed by the port Plex will run on, ensuring devices on your network can find and connect to your Plex server.
  • volumes: Maps volumes for Plex configuration, transcoding temporary directory, and the directory where your media files are stored.
  • restart: Ensures the Plex container restarts automatically unless explicitly stopped.

Step 2: Launch Plex Media Server

Navigate to the directory containing your docker-compose.yml file and start Plex Media Server by running:

docker compose up -d

This command will download the necessary Docker image (if not already present) and start the Plex Media Server container in detached mode.

Step 3: Access Plex Media Server

Once the container is up and running, you can access the Plex Web Interface by navigating to http://your-server-ip:32400/web on any browser within your network. If you’re accessing it for the first time, follow the on-screen instructions to complete the server setup, including signing into your Plex account and adding your media libraries.

Conclusion

Deploying Plex Media Server with Docker Compose offers a convenient and efficient method for setting up a personal media server. By following the steps outlined in this guide, you can have your Plex server up and running quickly, ready to stream your favorite content. Docker Compose simplifies the management of Plex services, making it easy to maintain, backup, and update your setup. Whether you’re a movie enthusiast, a music lover, or someone who enjoys organizing and accessing personal media collections effortlessly, Plex Media Server combined with Docker Compose provides a powerful solution to meet your needs.

Anastasios Antoniadis
Follow me
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x