====== Systems - Media Server - Install Docker ======
===== Install Docker =====
sudo apt install docker.io docker-compose -y
----
===== Create a Media Directory =====
mkdir /media
----
===== Change ownership of the Media Directory =====
chown -R 1000:1000 /media
**NOTE:** The 1000:1000 is usually the first user.
* Check the contents of **/etc/passwd** and **/etc/group** files.
* This should show the user associated with UID 1000 and GID 1000.
* Alternatively, check which UID and GID is associated with 1000:1000 by running:
id 1000
----
===== Create an environment file =====
# Main path for all MEDIA apps:
MEDIAPATH=/media/
# Global Variables
PUID=1000
PGID=1000
TZ=Europe/London
**NOTE:** Ensure the UID and GID point to the same user as before.
----
===== Create a Docker Compose file =====
services:
#
# PROWLER
#
prowlarr:
image: linuxserver/prowlarr:latest
container_name: prowlarr
hostname: prowlarr
volumes:
- ${MEDIAPATH}Prowlarr/config:/config
- ${MEDIAPATH}Prowlarr/backup:/data/Backup
- ${MEDIAPATH}Downloads:/downloads
ports:
- 9696:9696
restart: unless-stopped
env_file:
- 'docker-media.env'
#
# SONARR
#
sonarr:
image: linuxserver/sonarr:latest
container_name: sonarr
hostname: sonarr
volumes:
- ${MEDIAPATH}Sonarr/config:/config
- ${MEDIAPATH}Sonarr/backup:/data/Backup
- ${MEDIAPATH}Sonarr/tvshows:/data/tvshows
- ${MEDIAPATH}Downloads:/downloads
ports:
- 8989:8989
restart: unless-stopped
env_file:
- 'docker-media.env'
#
# RADARR
#
radarr:
image: linuxserver/radarr:latest
container_name: radarr
hostname: radarr
volumes:
- ${MEDIAPATH}Radarr/config:/config
- ${MEDIAPATH}Radarr/movies:/data/movies
- ${MEDIAPATH}Radarr/backup:/data/Backup
- ${MEDIAPATH}Downloads:/downloads
ports:
- 7878:7878
restart: unless-stopped
env_file:
- 'docker-media.env'
#
# LIDARR
#
lidarr:
image: linuxserver/lidarr:latest
container_name: lidarr
hostname: lidarr
volumes:
- ${MEDIAPATH}Lidarr/config:/config
- ${MEDIAPATH}Lidarr/music:/data/musicfolder
- ${MEDIAPATH}Downloads:/downloads
ports:
- 8686:8686
restart: unless-stopped
env_file:
- 'docker-media.env'
#
# READARR
#
readarr:
image: linuxserver/readarr:develop
container_name: readarr
hostname: readarr
volumes:
- ${MEDIAPATH}Readarr/config:/config
- ${MEDIAPATH}Readarr/books:/data/books
- ${MEDIAPATH}Downloads:/downloads
ports:
- 8787:8787
restart: unless-stopped
env_file:
- 'docker-media.env'
#
# HOMARR
#
homarr:
container_name: homarr
image: ghcr.io/ajnart/homarr:latest
restart: unless-stopped
volumes:
- ${MEDIAPATH}Homarr/configs:/app/data/configs
- ${MEDIAPATH}Homarr/icons:/app/public/icons
- ${MEDIAPATH}Homarr/data:/data
ports:
- '7575:7575'
env_file:
- 'docker-media.env'
#
# JELLYFIN
#
jellyfin:
image: linuxserver/jellyfin
container_name: jellyfin
ports:
- '8096:8096/tcp' # Jellyfin web interface
- '7359:7359/udp' # Network discovery
- '1900:1900/udp' # DLNA port
volumes:
- ${MEDIAPATH}Jellyfin/config:/config
- ${MEDIAPATH}Radarr/movies:/data/Movies
- ${MEDIAPATH}Sonarr/tvshows:/data/TVShows
- ${MEDIAPATH}Lidarr/music:/data/Music
- ${MEDIAPATH}Readarr/books:/data/Books
env_file:
- 'docker-media.env'
restart: unless-stopped
#
# QBITTORRENT
#
qbittorrent:
image: linuxserver/qbittorrent:latest
container_name: qbittorrent
hostname: qbittorrent
restart: unless-stopped
labels:
- "com.centurylinklabs.watchtower.enable=false"
volumes:
- ${MEDIAPATH}qbittorrent/config:/config
- ${MEDIAPATH}Downloads:/downloads
ports:
- 8080:8080
- 6881:6881
- 6881:6881/udp
environment:
- WEBUI_PORT=8080
- TORRENTING_PORT=6881
healthcheck:
start_period: 15s
env_file:
- 'docker-media.env'
----
===== Change ownership of the Media directory =====
chown -R 1000:1000 /media
**NOTE:** This is the directory specified in the **docker-media.env** file.
* Use the UID (user id) and GID (group id) configured in the **docker-media.env** file.
----
===== Do an initial run =====
sudo docker-compose up -d
sudo docker-compose stop
sudo docker-compose rm
**NOTE:** Ensure the command is run within the directory that contains the docker-compose and environment files.
* This may take a long time the first time this is run.
To stop and remove the docker containers:
sudo docker-compose stop
sudo docker-compose rm
----
===== Configure the various services =====
==== Configure qBittorrent service ====
qBittorrent will initially be using a temporary password only.
Check the logs for the qbittorrent container.
sudo docker logs qbittorrent
returns:
...
The WebUI administrator username is: admin
The WebUI administrator password was not set. A temporary password is provided for this session:
...
----
Log into qbittorrent
Visit http://localhost:8080 and log on using details provided in container logs.
Navigate to **Tools -> Options -> WebUI -> change the user and password** and check **bypass authentication for clients on localhost**.
----
===== Configure the Prowlarr service =====
* Visit http://localhost:9696.
* Navigate to **Settings -> Download Clients -> + symbol -> Add download client**.
* Choose qBittorrent.
* Enter the port number matching the WebUI in docker-compose for qBittorrent (default is 8080) and username and password that you configured for qBittorrent in previous step.
* Host - This may need to be changed from **localhost** to the IP address of the host machine.
* Check what the IP Address is on the host system with ip address
* Return to the 'qbittorrent' URL.
* Click the **Test** button at the bottom to make sure you get a green **tick**.
* Click **Save**.
----
===== Configure the Sonarr service =====
* Visit http://localhost:8989.
* Navigate to **Settings -> Media Management -> Add Root Folder**, and set the root folder to what it is on the right side of the colon in the **volume** config line for Sonarr.
* In the docker-compose file its {MEDIAPATH}Sonarr/tvshows:/data/tvshows
* Therefore, set **/data/tvshows** as the root directory.
* Navigate to **Settings -> Download Clients**, and click the **+ symbol**.
* Choose qBittorrent and repeat the steps from Prowlarr.
* Navigate to **Settings -> General**, and scroll down to the **API key**.
* Copy this key, and then go to **Prowlarr -> Settings -> Apps**, and click the **+ - Sonarr**, and paste the API key.
* The host might also have to be changed from **localhost** to IP address of the Host.
* Click the **Test** button below to see if a green 'tick' is shown.
* Navigate to **Settings -> General**, and switch to **show advanced** in top left corner.
* Scroll down to **Backups** and choose **/data/Backup** (or whatever location is in the docker compose file for Sonarr backups.
* This is currently ${MEDIAPATH}Sonarr/backup:/data/Backup hence we set **/data/Backup**, as that is on the right side of the colon.
----