Docker Stack: Media
1. Contents
This docker stack is composed of the following docker images:
- Surfshark
-
SurfShark VPN client.
- qBittorrent
-
qBittorrent bittorrent client.
- Jellyfin
-
Jellyfin Server is a media server that allows the contents of a media library to be streamed to Jellyfin clients.
- Radarr
-
Radarr allows for automatic downloading of
Moviesby controlling a bittorrent client. - Sonarr
-
Sonarr allow for automatic downloading of
TV Showsby controlling a bittorrent client. - Lidarr
-
Lidarr is a
Musiccollection manager. - Prowlarr
-
Prowlarr is a proxy for Torrent and Usenet indexers. It will be used as an indexer for Sonarr, Radarr, and Lidarr.
- Plex
-
Possible future addition - Jellyfinshould suffice for now…
2. Prerequisites
-
First install the cifs-utils package (your system may already have this installed):
sudo dnf install cifs-utils -
Create a
docker-media-stackdirectory. The rest of the document will reference this directory.-
All data for these docker services will be stored here so be mindful of space constraints.
This directory can be created in your home directory or any other directory that can grow to a few GBs in size.
-
-
Create various directories for the docker containers:
-
Change directory to the root of where you want to store the docker data files.
cd /home/mattosd -
Make folder for docker data.
mkdir docker-media-stackIn this example the docker project directory will be
/home/<user name>/docker-media-stack
-
-
Get the
Surfsharkusername and password credentials.These are different and not the same as the username and password for your login account. -
Open this page in order to generate the
OpenVPNcredentials. -
If the values are empty, click the
Generate new credentials link. -
These values will need to be plugged into the
docker-compose.ymlfile referenced in the next section.
-
3. Start Containers
Use a docker-compose file to start all services.
-
Within the
docker-media-stackfolder, create adocker-compose.ymlfile with the following contentsExpand for
docker-compose.ymlcontentsversion: "3.5" services: # Define SurfShark VPN service surfshark: image: ilteoood/docker-surfshark container_name: My-Surfshark-VPN environment: - SURFSHARK_USER=${SURFSHARK_USER} - SURFSHARK_PASSWORD=${SURFSHARK_PASSWORD} - SURFSHARK_COUNTRY=us - SURFSHARK_CITY=nyc - CONNECTION_TYPE=udp - LAN_NETWORK= cap_add: - NET_ADMIN devices: - /dev/net/tun # This container will be the access point for other containers that use the VPN service. # Ports for the other containers need to be accounted for here ports: - 8080:8080 # Add the port for qBittorrent - 6881:6881 # another qBittorrent port - 6881:6881/udp # another qBittorrent port restart: unless-stopped dns: - 1.1.1.1 #---------------------------------------------------------------------- # Define qBittorrent service qbittorrent: image: lscr.io/linuxserver/qbittorrent:latest container_name: My-qBittorrent network_mode: service:surfshark # Use the VPN depends_on: - surfshark environment: #- PUID=1000 #- PGID=1000 - PUID=0 - PGID=0 - TZ=America/New_York - WEBUI_PORT=8080 volumes: - ./qBittorrent/config:/config - norco-torrents:/downloads restart: unless-stopped #---------------------------------------------------------------------- # Define Prowlerr service for indexer access # https://docs.linuxserver.io/images/docker-prowlarr prowlarr: image: lscr.io/linuxserver/prowlarr:latest container_name: My-Prowlarr environment: - PUID=0 - PGID=0 - TZ=America/New_York ports: - 9696:9696 volumes: - ./Prowlarr/config:/config #---------------------------------------------------------------------- # Define Radarr service for Movies radarr: image: linuxserver/radarr:latest container_name: My-Radarr environment: - PUID=0 - PGID=0 - TZ=America/New_York ports: - 7878:7878 volumes: - ./Radarr/config:/config - ./Radarr/media:/media # Media can be stored here but should use a larger Windows Shared drive instead - norco-plex2:/plex2 # Windows Shared drive for media. - norco-torrents:/downloads # Radarr needs to be able to see files downloaded via qBittorrent restart: unless-stopped # Define Sonarr service for TV Shows sonarr: image: lscr.io/linuxserver/sonarr:latest container_name: My-Sonarr environment: - PUID=0 - PGID=0 - TZ=America/New_York ports: - 8989:8989 volumes: - ./Sonarr/config:/config - ./Sonarr/media:/media # Media can be stored here but should use a larger Windows Shared drive instead - norco-plex2:/plex2 # Windows Shared drive for media. - norco-torrents:/downloads # Sonarr needs to be able to see files downloaded via qBittorrent restart: unless-stopped # Define Lidarr service for Music lidarr: image: lscr.io/linuxserver/lidarr:latest container_name: My-Lidarr environment: - PUID=0 - PGID=0 - TZ=America/New_York ports: - 8686:8686 volumes: - ./Lidarr/config:/config - ./Lidarr/media:/media # Media can be stored here but should use a larger Windows Shared drive instead - norco-music:/data/Musics # Windows Shared drive for media. - norco-torrents:/downloads # Lidarr needs to be able to see files downloaded via qBittorrent restart: unless-stopped # Define Readarr service for Books readarr: image: lscr.io/linuxserver/readarr:develop container_name: My-Readarr environment: - PUID=0 - PGID=0 - TZ=America/New_York ports: - 8787:8787 volumes: - ./Readarr/config:/config - ./Readarr/media:/media # Books can be stored here but should use a larger Windows Shared drive instead - norco-books:/data/books # Windows Shared drive for books. - norco-torrents:/downloads # Readarr needs to be able to see files downloaded via qBittorrent restart: unless-stopped #---------------------------------------------------------------------- # Define Jellyfin service jellyfin: image: jellyfin/jellyfin:latest container_name: My-Jellyfin ports: - 8096:8096 #user: 1000:1000 network_mode: "bridge" volumes: - ./Jellyfin/cache:/cache - ./Jellyfin/config:/config - ./Sonarr/media:/sonar-media # This is where Sonar can store media on a local dir - norco-plex2:/plex2 # Ideally, all media will be here on this Windows Shared drive restart: "unless-stopped" #---------------------------------------------------------------------- #---------------------------------------------------------------------- volumes: # Windows Shared drive for torrent downloads norco-torrents: driver_opts: type: cifs device: "//norco.dhante.local/Torrents" o: "user=${NORCO_USER},password=${NORCO_PASSWORD},addr=norco.dhante.local" # Windows Shared drive for TV/Movie media norco-plex2: driver_opts: type: cifs device: "//norco.dhante.local/Plex2" o: "user=${NORCO_USER},password=${NORCO_PASSWORD},addr=norco.dhante.local" # Windows Shared drive for Music norco-music: driver_opts: type: cifs device: "//norco.dhante.local/Media/Music/Lidarr" o: "user=${NORCO_USER},password=${NORCO_PASSWORD},addr=norco.dhante.local" # Windows Shared drive for Books norco-books: driver_opts: type: cifs device: "//norco.dhante.local/Library/Readarr" o: "user=${NORCO_USER},password=${NORCO_PASSWORD},addr=norco.dhante.local" -
Within the
docker-media-stackfolder, create a.envfile with the following variables and values:SURFSHARK_USER=<surfshark user> (1) SURFSHARK_PASSWORD=<surfshark password> (2) NORCO_USER=<user> (3) NORCO_PASSWORD=<password> (4)1 This is the Surfsharkuser credential value discovered in the previous step.2 This is the Surfsharkpassword credential value discovered in the previous step.3 Provide the user name with read/write access to the network share. 4 Provide the user’s password. -
Start the container:
cd docker-media-stack sudo docker-compose up -dWait a few moments while all services are started.
4. Confirm VPN is running.
| It is important that the torrent client uses the VPN for all of its traffic. |
-
Get the WAN IP of the
docker host serverCommandcurl icanhazip.comSample results$ curl icanhazip.com 100.37.103.77 -
Get the WAN IP for the
My-qBittorrentcontainer:Example Commandsudo docker exec -t <container_name> curl icanhazip.comSample resultssudo docker exec -t My-qBittorrent curl icanhazip.com 91.246.58.171 (1)1 This should not be your ISP’s WANaddress. -
Confirm that the IP address is not your
WANaddress. -
If the VPN is reporting your ISP’s
WANaddress then restart thedocker-media-stackand then go back to the previous step to confirm the VPN is working:Change directorycd docker-media-stack
Stop all containerssudo docker-compose down
Start all containerssudo docker-compose up -d
You’ve now confirmed the VPN is running.
|
5. Access Web Pages
-
On the
docker serveropen FW ports for each app-
qBittorrent: 8080
-
Jellyfin: 8096
-
Radarr: 7878
-
Sonarr: 8989
-
Lidarr: 8686
-
Prowlarr: 9696
-
-
On the
docker serveropen a browser and navigate to each of the container’s web pages :-
qBittorrent
http://localhost:8080 username=admin password=adminadmin -
Radarr
http://localhost:7878 -
Sonarr
http://localhost:8989 -
Lidarr
http://localhost:8686 -
Prowlarr
http://localhost:9696
-
-
Jellyfinis the exception and is not configured to use theVPN. Navigate to it normally via the address of the docker host server.http://localhost:8096
6. Configure Apps
6.1. Configure Jellyfin
Refer to the Jellyfin Guide.
6.2. Configure qBittorrent
Refer to the qBittorrent Guide.
6.3. Configure Sonarr
Refer to the Sonarr Guide.
6.4. Configure Radarr
| Radarr and Sonarr are basically the same app. Use the Sonarr instructions for configuration. |
6.5. Configure Prowlarr
Refer to the Prowlarr Guide.