Say Goodbye to Boring Nights: Create the Ultimate Plex/Jellyfin Media Server Now!

Say Goodbye to Boring Nights: Create the Ultimate Plex/Jellyfin Media Server Now!

In this guide, we'll walk through setting up a media server using Docker, specifically configuring Plex and Jellyfin along with other complementary services like Transmission, Jackett, Sonarr, Radarr, and Overseerr. Docker makes it easy to manage and deploy these services in isolated containers, ensuring stability and flexibility.


Let's understand all the components that will power our media server.

  • Plex Media Server: Organizes and streams media, including movies, TV shows, and music, to various devices.
  • Jellyfin: Open-source alternative to Plex for media streaming and sharing, emphasizing privacy and flexibility.
  • Transmission with VPN: BitTorrent client with integrated VPN support for secure downloading and sharing of files.
  • Jackett: Proxy server providing API support for multiple torrent trackers, enhancing integration with download managers.
  • Sonarr: Automates downloading and managing TV shows, ensuring episodes are organized in your library.
  • Radarr: Similar to Sonarr but focuses on movies, automating the search, download, and organization of films.
  • Overseerr: Manages media requests, integrating with Sonarr and Radarr to streamline content addition to your library.
Relations Between each component.

Prerequisites

Before starting, ensure you have Docker and Docker Compose installed on your system. If not, follow these steps:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Need a plex account if you are going to use plex.

Need a PIA account for VPN.

Steps To install:

  1. Create a Docker compose file
  2. create .env file
  3. Setting up each service
  4. Enjoy your movies/shows

Create Your docker-compose.yaml file

Open up a terminal.

$ mkdir plex
$ cd plex
$ nano docker-compose.yaml
#paste the below docker file
# to exit out of nano use ctrl+x then y to save. 
make sure to change your local_network to your ip range.
Example: 
if your ip is 192.168.1.X, local_network will be 192.168.1.0/24
version: "3.3"
networks:
  internal:
    driver: bridge

services:

  plexms:
    container_name: plexms
    restart: always
    image: plexinc/pms-docker:plexpass
    volumes:
      - ${USERDIR}/docker/plexms:/config
      - ${USERDIR}/Downloads/plex_tmp:/transcode
      - ${USERDIR}/media:/media
      - ${USERDIR}/docker/certs:/certs
    network_mode: host
    environment:
      - TZ=${TZ}
      - HOSTNAME=${PLEX_HOSTNAME}
      - PLEX_CLAIM=${PLEX_CLAIM}
      - PLEX_UID=${PUID}
      - PLEX_GID=${PGID}
      - ADVERTISE_IP=${PLEX_ADVERTISE_IP}

  transmission-vpn:
    container_name: transmission-vpn
    image: haugene/transmission-openvpn
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    restart: always
    ports:
      - "9091:9091"
    dns:
      - 8.8.8.8
      - 8.8.4.4
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${USERDIR}/docker/transmission-vpn:/data
      - ${USERDIR}/docker/certs:/certs
      - ${USERDIR}/Downloads:/data/watch
      - ${USERDIR}/Downloads/completed:/data/completed
      - ${USERDIR}/Downloads/incomplete:/data/incomplete
    environment:
      - OPENVPN_PROVIDER=${OPENVPN_PROVIDER}
      - OPENVPN_USERNAME=${OPENVPN_USERNAME}
      - OPENVPN_PASSWORD=${OPENVPN_PASSWORD}
      - OPENVPN_CONFIG=${OPENVPN_CONFIG}
      - OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60 --mute-replay-warnings
      - LOCAL_NETWORK=192.168.1.0/24
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - PASS=plex
      - USER=plex
      - TRANSMISSION_UMASK=2
      - TRANSMISSION_RATIO_LIMIT_ENABLED=true
      - TRANSMISSION_RATIO_LIMIT=0

  jackett:
    image: linuxserver/jackett
    container_name: jackett
    volumes:
      - ${USERDIR}/docker/jackett:/config
      - /etc/localtime:/etc/localtime:ro
      - ${USERDIR}/docker/certs:/certs
    ports:
      - "9117:9117"
    restart: always
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}

  sonarr:
    image: mdhiggins/sonarr-sma
    container_name: sonarr
    volumes:
      - ${USERDIR}/docker/sonarr:/config
      - ${USERDIR}/Downloads/completed:/data/completed
      - ${USERDIR}/Downloads/completed/recyclingBin:/data/completed/recyclingBin
      - /etc/localtime:/etc/localtime:ro
      - ${USERDIR}/docker/certs:/certs
      - ${USERDIR}/media/tvshows:/tvshows
    ports:
      - "8989:8989"
    restart: always
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}

  radarr:
    image: mdhiggins/radarr-sma
    container_name: radarr
    volumes:
      - ${USERDIR}/docker/radarr:/config
      - ${USERDIR}/media/movies:/movies
      - /etc/localtime:/etc/localtime:ro
      - ${USERDIR}/docker/certs:/certs
      - ${USERDIR}/Downloads/completed:/data/completed
      - ${USERDIR}/Downloads/completed/recyclingBin:/data/completed/recyclingBin
    ports:
      - "7878:7878"
    restart: always
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}

  overseerr:
    image: lscr.io/linuxserver/overseerr:latest
    container_name: overseerr
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    volumes:
      - ${USERDIR}/docker/overseer/config:/config
    ports:
      - 5055:5055
    restart: unless-stopped

  jellyfin:
    image: lscr.io/linuxserver/jellyfin:latest
    container_name: jellyfin
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - /path/to/library:/config
      - ${USERDIR}/media/tvshows:/data/tvshows
      - ${USERDIR}/media/movies:/data/movies
    ports:
      - "8096:8096"
      - "8920:8920"  # Optional
      - "7359:7359/udp"  # Optional
      - "1900:1900/udp"  # Optional
    restart: unless-stopped

Now you need to create your .env file

# in the same plex directory 
$ nano .env

# to exit out of nano use ctrl+x then y to save. 
#paste the follwing data. 
# Basic Configuration
PATH="/usr/local/sbin:/usr/local/bin"
PUID=1000 # Find more about PUID/PGID at https://docs.linuxserver.io/general/understanding-puid-and-pgid
PGID=999
TZ=America/New_York # See more timezone options at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
USERDIR=/home/plex/plex # Path to your home directory or desired location.

# Plex Specific
PLEX_ADVERTISE_IP=https://192.168.1.184:32400/ # Needed in Bridge Networking.
PLEX_CLAIM=claim-plex_password # Obtain from https://www.plex.tv/claim. Necessary for server token.
PLEX_HOSTNAME=192.168.1.X

# Optional Settings
[email protected]
PASSWORD=examplepassword
HTTP_USERNAME=exampleuser
HTTP_PASSWORD=examplepassword
DOMAIN=
DOMAINNAME=mycustomdomain.com

# Transmission Settings
TRANSMISSION_USERNAME=transmissionuser # Username for logging into transmission frontend
TRANSMISSION_PASSWORD=transmissionpassword # Password for logging into transmission frontend

# OpenVPN Configuration
## more info: https://haugene.github.io/docker-transmission-openvpn/
OPENVPN_PROVIDER=PIA # (Private Internet Access)
OPENVPN_CONFIG=ca_montreal # Optional line (update this to whichever location you prefer)
OPENVPN_USERNAME=openvpnuser
OPENVPN_PASSWORD=openvpnpassword
  1. Get the Plex claim code.
  2. Update plex advertise ip to your ip address.
  3. Add your PIA login information.

Now, all you need is to run Docker-compose up.

$ sudo docker compose up -d

This should pull all the necessary files you need.

To check if everything is running:

$ sudo docker ps -a

output:

CONTAINER ID   IMAGE                                  COMMAND                  CREATED       STATUS                PORTS                                                                                                                                                                        NAMES
                                                                                                                                                                                                                                    sonarr
3a7463534806   lscr.io/linuxserver/overseerr:latest   "/init"                  2 days ago    Up 2 days             0.0.0.0:5055->5055/tcp, :::5055->5055/tcp                                                                                                                                    overseerr
882849df2b7d   mdhiggins/radarr-sma                   "/init"                  2 days ago    Up 2 days             0.0.0.0:7878->7878/tcp, :::7878->7878/tcp                                                                                                                                    radarr
a02939876978   haugene/transmission-openvpn           "dumb-init /etc/open…"   2 days ago    Up 2 days (healthy)   8118/tcp, 0.0.0.0:9091->9091/tcp, :::9091->9091/tcp                                                                                                                          transmission-vpn
1aaeb66d22be   plexinc/pms-docker:plexpass            "/init"                  2 days ago    Up 2 days (healthy)                                                                                                                                                                                plexms
26596c23520e   lscr.io/linuxserver/jellyfin:latest    "/init"                  2 days ago    Up 2 days             0.0.0.0:1900->1900/udp, :::1900->1900/udp, 0.0.0.0:8096->8096/tcp, :::8096->8096/tcp, 0.0.0.0:7359->7359/udp, :::7359->7359/udp, 0.0.0.0:8920->8920/tcp, :::8920->8920/tcp   jellyfin
451354da4995   linuxserver/jackett                    "/init"                  2 days ago    Up 2 days             0.0.0.0:9117->9117/tcp, :::9117->9117/tcp                                                                                                                                    jackett
                                            

Setting up Sonarr, radarr, jackett requestrr and transmission

Jackett Setup

  1. Access the Jackett web UI at localhost:9117 or http://your-ip:9117.
  2. Click on + Add Indexer.
  3. Choose an indexer, such as 1337x, and copy the API key and Torznab feed URL.

Sonarr and Radarr Setup

  1. Access Sonarr at localhost:8989 and Radarr at localhost:7878.
  2. Set up the username and password.
  3. Go to Settings > Indexers > + Add > Torznab.
  4. Fill in the name, URL, and API key you copied from Jackett.
  5. Go to Settings > Download Clients > + Add > Transmission.
  6. Add your IP address and save.

Repeat these steps for both Sonarr and Radarr.

Overseerr Setup

  1. Access Overseerr at localhost:5055.
  2. Sign in using your Plex account.
  3. Add Sonarr and Radarr information (IP and API keys, which can be found in Sonarr/Radarr under Settings > General > API).

Enjoy Your Media

Once the setup is complete, you can request a movie or TV show via Overseerr. The request will be sent to Sonarr or Radarr, which will then find the torrent file through Jackett and send it to Transmission for downloading. Once the file is downloaded, Sonarr or Radarr will index the file into the correct folders, making it available on your Plex or Jellyfin server.

Say goodbye to boring nights and enjoy your ultimate media server setup!