├── .gitignore ├── extra └── transmission_remove_completed.py ├── docs └── docker_install.md ├── docker-compose.yaml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | venv 2 | .idea -------------------------------------------------------------------------------- /extra/transmission_remove_completed.py: -------------------------------------------------------------------------------- 1 | # requirement: transmission-clutch 2 | # A sloppy script to delete torrents and data from transmission that are completed and are not seeding anymore 3 | from clutch.core import Client 4 | 5 | transmission_host = '192.168.4.4' 6 | client = Client(host=transmission_host) 7 | 8 | torrents_list = client.list() 9 | 10 | percent_downloaded = client.torrent.percent_done() 11 | finished_torrents = [] 12 | for torrent_id, v in percent_downloaded.items(): 13 | if v == 1: # 1 means its 100% downloaded 14 | # status of 0 means its stopped, 6: seeding, 4: downloading, 3: download pending 15 | if torrents_list[torrent_id]['status'] == 0: 16 | # remove local data 17 | print('removing torrent: {0}'.format(torrents_list[torrent_id]['name'])) 18 | user_input = input('remove torrent: {0}? Proceed: y/n'.format(torrents_list[torrent_id]['name'])) 19 | if user_input == 'y': 20 | client.torrent.remove(ids=torrent_id, delete_local_data=True) 21 | print('torrent: {0} removed'.format(torrents_list[torrent_id]['name'])) 22 | print() 23 | -------------------------------------------------------------------------------- /docs/docker_install.md: -------------------------------------------------------------------------------- 1 | #### What is docker container and how do I install it? 2 | From docker.com; 3 | > A container is a standard unit of software that packages up code and all its dependencies so the application runs 4 | > quickly and reliably from one computing environment to another. A Docker container image is a lightweight, 5 | > standalone, executable package of software that includes everything needed to run an application: code, runtime, 6 | > system tools, system libraries and settings. 7 | 8 | A docker container can be thought of a process with all its dependencies coupled into a package and this package runs 9 | as a normal process on the host. 10 | 11 | ##### Install docker: 12 | ```bash 13 | $ curl -fsSL https://get.docker.com -o get-docker.sh 14 | $ sudo sh get-docker.sh 15 | $ sudo groupadd docker 16 | $ sudo usermod -aG docker $USER 17 | ``` 18 | These steps are from: https://docs.docker.com/install/linux/docker-ce/debian/#install-using-the-convenience-script 19 | 20 | After installation, disconnect from your host (RPi) and re-connect and check docker is installed correctly. 21 | After re-connecting, type `docker version` and you should get a response from like this 22 | ```bash 23 | $ docker version 24 | Client: Docker Engine - Community 25 | Version: 19.03.1 26 | API version: 1.40 27 | Go version: go1.12.5 28 | Git commit: 74b1e89 29 | Built: Thu Jul 25 21:33:17 2019 30 | OS/Arch: linux/arm 31 | Experimental: true 32 | 33 | Server: Docker Engine - Community 34 | Engine: 35 | Version: 19.03.1 36 | API version: 1.40 (minimum version 1.12) 37 | Go version: go1.12.5 38 | Git commit: 74b1e89 39 | Built: Thu Jul 25 21:27:09 2019 40 | OS/Arch: linux/arm 41 | Experimental: true 42 | containerd: 43 | Version: 1.2.6 44 | GitCommit: 894b81a4b802e4eb2a91d1ce216b8817763c29fb 45 | runc: 46 | Version: 1.0.0-rc8 47 | GitCommit: 425e105d5a03fabd737a126ad93d62a9eeede87f 48 | docker-init: 49 | Version: 0.18.0 50 | GitCommit: fec3683 51 | ``` 52 | 53 | #### What is docker-compose and how do I install it? 54 | Its just a simpler way of running and managing docker containers. 55 | 56 | You need python 3 to install docker-compose. 57 | 58 | Not sure if you already have python 3? 59 | Just type on the console, `python3` and if you are put in the python console then you have python3 installed, if not 60 | follow steps to install python3. You may `python3` installed but not `python3-pip`. In that case just installed `python3-pip`, 61 | command `sudo apt install python3-pip` 62 | 63 | ##### Install python 3 and python 3 pip 64 | ```bash 65 | $ sudo apt install python3 && sudo apt install python3-pip 66 | ``` 67 | 68 | ##### Install docker-compose 69 | ```bash 70 | $ python3 -m pip install docker-compose 71 | ``` 72 | 73 | After installation, check if docker-compose is installed correctly. Type `docker-compose version` and you should get a response 74 | like this 75 | ```bash 76 | $ docker-compose version 77 | docker-compose version 1.24.1, build 4667896 78 | docker-py version: 3.7.3 79 | CPython version: 3.7.3 80 | OpenSSL version: OpenSSL 1.1.1c 28 May 2019 81 | ``` 82 | 83 | ##### Got error while docker or docker-compose installation? 84 | - Check that docker isn't already installed on your host. 85 | - Try installation again after a reboot. 86 | - Still not working? Try and start from clean slate, re-install the OS on SD card or try googling. 87 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | x-extra_hosts: 3 | # This is added so that within each service you can communicate to another service by using the DNS name of pi rather 4 | # than using IP address. Makes it easy if the IP address changes. For example, when configuring Radarr, you can 5 | # configure the transmission client url as http://pi:9091 6 | &pi 7 | # Change this to IP of your RPi 8 | - "pi:192.168.4.4" 9 | services: 10 | # All the services use docker bind mounts to store config data and media on the host's filesystem. If you're familiar with 11 | # docker storage, you can use whatever you want. You can change it to use docker volumes if you want. 12 | # I have my external HDD mounted as /mnt/media. Hence all the bind mounts use /mnt/media as the root. If you want 13 | # to use a different directory for bind mount, you can do that by modifying the bind mounts under volumes section of 14 | # a service. 15 | # 16 | # Nearly all the containers can be run as non root. This is controlled by PUID and PGID environment variables. 17 | # Make sure any volume directories on the host are owned by the same user you specify to run the container as. Else 18 | # you may have permissions issues. 19 | # 20 | # If you dont want any service, you can delete that section. Alternatively, if you want to use another service or 21 | # add more services, you can add/change them in this file. 22 | # For example: if you want to use Emby instead of Plex, you can change the plex service to emby. Linuxserver.io 23 | # provide most of the docker images that you would need. They provide a docker image for emby as well. 24 | # 25 | # Each services runs on a different port number. Plex and transmission-openvpn uses host networking mode whereas all 26 | # the other services use docker bridge networking and have host ports mapped to container ports. For these you can 27 | # change the mapping between host ports and container ports. Port mapping is in the format : 28 | plex: 29 | image: linuxserver/plex:latest 30 | restart: always 31 | container_name: plex 32 | network_mode: host 33 | extra_hosts: *pi 34 | # NOTE: Please delete this entire `devices` section if your device does not have /dev/dri device. If you using something 35 | # like RPi3, you would need to delete this section else you will get an error when trying to run this container. 36 | devices: 37 | # This basically mounts the GPU device on the host to the container, needed for hardware transcoding. 38 | # For a RPi 4 this won't do anything as plex does not support transcoding on anything other than Intel quicksync. 39 | # You can comment or delete this if you want. Leaving it as it is won't do any harm. 40 | - "/dev/dri:/dev/dri" 41 | environment: 42 | # The container is run as the user with this PUID and PGID (user and group id). 43 | - PUID=1001 44 | - PGID=1001 45 | volumes: 46 | # Docker bind mounts are used to store config and media on the host's filesystem. Config for plex will be stored 47 | # in /mnt/media/appdata/plex/config directory and any transcoding data is stored in a transcode directory 48 | - /mnt/media/appdata/plex/config:/config 49 | - /mnt/media/appdata/plex/transcode:/transcode 50 | # Within plex, we are mounting the root of /mnt/media to /all_media directory. So within plex, when you look 51 | # inside /all_media directory you would see the same file structure as /mnt/media on the host 52 | - /mnt/media:/all_media 53 | 54 | transmission-openvpn: 55 | image: haugene/transmission-openvpn:latest 56 | restart: always 57 | container_name: transmission-openvpn 58 | network_mode: host 59 | extra_hosts: *pi 60 | environment: 61 | # The container is run as the user with this PUID and PGID (user and group id). 62 | - PUID=1001 63 | - PGID=1001 64 | # To run this container, you would need an openvpn provider. I use IPVANISH and hence in here that is used as an 65 | # example. Please look at the documentation to understand each of the config variables. 66 | # Documentation: https://haugene.github.io/docker-transmission-openvpn/ 67 | - TRANSMISSION_WEB_UI=transmission-web-control 68 | - OPENVPN_PASSWORD=openvpn_provider_password 69 | - OPENVPN_USERNAME=openvpn_provider_username 70 | - OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60 71 | - LOCAL_NETWORK=192.168.4.0/24 72 | - OPENVPN_PROVIDER=IPVANISH 73 | - CREATE_TUN_DEVICE=true 74 | # Change these to which vpn endpoints you want to connect to. More info in documentation 75 | - OPENVPN_CONFIG=ipvanish-UK-London-lon-a05,ipvanish-UK-London-lon-a33,ipvanish-UK-Manchester-man-c06,ipvanish-NL-Amsterdam-ams-a08 76 | # Below are just some variable to configure transmission. Configure them to whatever is best for your setup 77 | - TRANSMISSION_DOWNLOAD_QUEUE_SIZE=5 78 | - TRANSMISSION_IDLE_SEEDING_LIMIT=30 79 | - TRANSMISSION_IDLE_SEEDING_LIMIT_ENABLED=true 80 | - TRANSMISSION_RATIO_LIMIT=2 81 | - TRANSMISSION_RATIO_LIMIT_ENABLED=true 82 | - TRANSMISSION_SEED_QUEUE_ENABLED=true 83 | - TRANSMISSION_SEED_QUEUE_SIZE=50 84 | cap_add: 85 | - NET_ADMIN 86 | volumes: 87 | # Docker bind mounts used to mount host's filesystem within the container 88 | # Transmission config will be stored in a transmission-openvpn directory 89 | - /mnt/media/appdata/transmission-openvpn:/config 90 | # All the media managed by transmission with be stored in /mnt/media/downloads directory on the host BUT the 91 | # transmission will see that as /data directory 92 | - /mnt/media/downloads:/data 93 | 94 | jackett: 95 | image: linuxserver/jackett:latest 96 | restart: always 97 | container_name: jackett 98 | extra_hosts: *pi 99 | ports: 100 | # Host port 9117 is mapped to container port 9117 101 | - "9117:9117" 102 | environment: 103 | # The container is run as the user with this PUID and PGID (user and group id). 104 | - PUID=1001 105 | - PGID=1001 106 | - TZ=Europe/London 107 | volumes: 108 | - /mnt/media/appdata/jackett:/config 109 | - /mnt/media/downloads:/downloads 110 | 111 | radarr: 112 | image: linuxserver/radarr:latest 113 | restart: always 114 | container_name: radarr 115 | extra_hosts: *pi 116 | ports: 117 | # Host port 7878 is mapped to container port 7878 118 | - "7878:7878" 119 | environment: 120 | # The container is run as the user with this PUID and PGID (user and group id). 121 | - PUID=1001 122 | - PGID=1001 123 | - TZ=Europe/London 124 | volumes: 125 | # Radarr needs to know where the downloaded media is. This is told to radarr by transmission 126 | - /mnt/media/downloads:/downloads 127 | - /mnt/media/downloads:/data 128 | # config directory 129 | - /mnt/media/appdata/radarr:/config 130 | # Movies imported by radarr are stored in /mnt/media/movies directory on the host. Radarr sees this directory 131 | # as /movies. Within radarr make your root folder as /movies 132 | - /mnt/media/movies:/movies 133 | 134 | sonarr: 135 | image: linuxserver/sonarr:latest 136 | restart: always 137 | container_name: sonarr 138 | extra_hosts: *pi 139 | ports: 140 | # Host port 8989 is mapped to container port 8989 141 | - "8989:8989" 142 | environment: 143 | # The container is run as the user with this PUID and PGID (user and group id). 144 | - PUID=1001 145 | - PGID=1001 146 | - TZ=Europe/London 147 | volumes: 148 | # sonarr needs to know where the downloaded media is. This is told to sonarr by transmission 149 | - /mnt/media/downloads:/downloads 150 | - /mnt/media/downloads:/data 151 | # config directory 152 | - /mnt/media/appdata/sonarr:/config 153 | # TV shows imported by sonarr are stored in /mnt/media/tv_shows directory on the host. sonarr sees this directory 154 | # as /tv. Within sonarr make your root folder as /tv 155 | - /mnt/media/tv_shows:/tv 156 | 157 | lidarr: 158 | image: linuxserver/lidarr:latest 159 | restart: always 160 | container_name: lidarr 161 | extra_hosts: *pi 162 | ports: 163 | # Host port 8686 is mapped to container port 8686 164 | - "8686:8686" 165 | environment: 166 | # The container is run as the user with this PUID and PGID (user and group id). 167 | - PUID=1000 168 | - PGID=1000 169 | - TZ=Europe/London 170 | volumes: 171 | # lidarr needs to know where the downloaded media is. This is told to lidarr by transmission 172 | - /mnt/media/downloads:/downloads 173 | - /mnt/media/downloads:/data 174 | # config directory 175 | - /mnt/media/appdata/lidarr:/config 176 | # Music imported by lidarr is stored in /mnt/media/music directory on the host. lidarr sees this directory 177 | # as /music. Within lidarr make your root folder as /music 178 | - /mnt/media/music:/music 179 | 180 | tautulli: 181 | image: linuxserver/tautulli:latest 182 | restart: always 183 | container_name: tautulli 184 | extra_hosts: *pi 185 | ports: 186 | # Host port 8181 is mapped to container port 8181 187 | - "8181:8181" 188 | environment: 189 | # The container is run as the user with this PUID and PGID (user and group id). 190 | - PUID=1001 191 | - PGID=1001 192 | - TZ=Europe/London 193 | volumes: 194 | # config directory 195 | - /mnt/media/appdata/tautulli:/config 196 | # Tautulli needs access to plex logs. In the plex container we mounted /mnt/media/appdata/plex of the host as the 197 | # config directory for plex. Logs are located within this config directory 198 | - /mnt/media/appdata/plex/config/Library/Application Support/Plex Media Server/Logs:/logs 199 | 200 | # Sonarr at present does not support netimport lists like Radarr does. On Radarr you can setup it up to import movies 201 | # from Lists like IMDB lists or themoviedb.org lists. Using these lists, you can just add the movies you want to 202 | # these lists and radarr will sync up with these lists and then start downloading and managing the movies. 203 | # Similar thing is not available for sonarr. So this service can sync the TV shows from TVDB.com list and add them 204 | # to sonarr. So basically you create an account on TVDB.com and then you would get a username and you can create an 205 | # API KEY. You would need these to use this service. Once this service is setup, any TV shows that you add to your 206 | # favourites list will be fetched at the SYNC_INTERVAL and added to sonarr. Sonarr then would start downloading and 207 | # managing this TV show 208 | sonarr_netimport: 209 | image: thundermagic/sonarr_netimport:latest 210 | restart: always 211 | container_name: sonarr_netimport 212 | extra_hosts: *pi 213 | environment: 214 | - TVDB_USERNAME=first.lastb1q 215 | - TVDB_USER_KEY=user_key 216 | - TVDB_API_KEY=tvdb_api_key 217 | # IP address and port number where sonarr can be accessed 218 | - SONARR_IP=192.168.4.4 219 | - SONARR_PORT=8989 220 | # Sonarr app API key. This is on sonarr under settings>general 221 | - SONARR_API_KEY=sonarr_api_key 222 | - SYNC_INTERVAL=3600 # Interval at which to sync with TVDB, in seconds 223 | - SEARCH_MISSING_EPISODES=1 # 1 is True 224 | - QUALITY_PROFILE_ID=1 # 1 is profile any 225 | - MONITORED=1 # 1 is True 226 | - ROOT_FOLDER_PATH=/tv/ # Full path of root folder 227 | # Below variables are for sending error notification emails. If not needed, delete these 228 | - EMAIL_ADDRESS=first.last@gmail.com 229 | - EMAIL_PASSWORD=email_password 230 | - EMAIL_TO_ADDRESS=first.last@gmail.com 231 | - SMTP_SERVER=smtp.gmail.com 232 | - SMTP_SERVER_PORT=587 233 | 234 | # Similar to sonarr_netimport but for radarr. Radarr has this feature built-in but radarr uses TMDB API v3 and 235 | # I have noticed that if using v3 API, TMDB only returns maximum of 500 movies in the list. 236 | # This is resolved if using TMDB API v4. 237 | radarr_netimport: 238 | image: thundermagic/radarr_netimport:latest 239 | restart: on-failure 240 | container_name: radarr_netimport 241 | environment: 242 | - TMDB_ACCESS_TOKEN=sampletoken 243 | - TMDB_API_KEY=tvdb_api_key 244 | - TMDB_LIST_ID=12345 245 | # IP address and port number where radarr can be accessed 246 | - RADARR_IP=192.168.4.4 247 | - RADARR_PORT=7878 248 | # radarr API key. This is on radarr under settings>general 249 | - RADARR_API_KEY=radarr_api_key 250 | - SYNC_INTERVAL=3600 # Interval at which to sync with TMDB, in seconds 251 | - QUALITY_PROFILE_ID=1 # 1 is profile any 252 | - ROOT_FOLDER_PATH=/movies/ # Full path of root folder 253 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Media Centre on Raspberry Pi 2 | This is a bundle of different docker containers to run a media centre. This would let you playback and manage media. 3 | 4 | **DISCLAIMER: NOT ALL THE SERVICES ARE CREATED BY ME. I HAVE JUST PUT THEM TOGETHER.** 5 | 6 | Since this uses docker containers, it can be run on `amd64` platforms as well (i.e your windows or linux machine). 7 | This guide is generic, any platform specific changes would be highlighted with comments. This guide uses commands for `debian` and 8 | debian based systems (like `raspbian`). If you are using a different distro, please use the relevant commands. 9 | 10 | ## Isn't Raspberry Pi under powered to run a media centre? 11 | Raspberry Pi 4 actually makes a good low powered platform to run a home media centre system. It can't really handle video 12 | transcoding (can do couple of 720p transcoding and 1080p in some cases) but if you are using this for home purpose and 13 | all the video clients are under your control, you can choose the clients that would play most of the video content 14 | without transcoding (i.e direct play/stream). 15 | 16 | I have been using a single Raspberry Pi 4 4GB version as a media centre since the day it was launched (actually couple of days after 17 | the release for delivery time). Before that I was using a Raspberry Pi 3B+ and that worked alright as well. 18 | 19 | RPi can direct play few video streams simultaneously without any issue, assuming your home network is good enough. Wired 20 | connectivity between clients and the media server would help. 21 | 22 | My home setup is all on one RPi 4 (overclocked to 2 GHz). For storage I have two HDD connected to the Pi and they are in RAID 1. I am using linux 23 | software raid (mdadm). I am also running monitoring stuff on the same Pi (prometheus, grafana etc etc). There has been no performance 24 | issues with the Raspberry Pi. I have amazon firestick 4K as video clients connected to TVs. This can play most of the video content. 25 | And if there is any content that requires transcoding to play, then I just get the format that would direct play on firestick. 26 | If I am managing video content then I can control which video formats I get. This is quite easy to do using services like 27 | radarr/sonarr/lidarr. You can exclude video/audio formats that you don't want. 28 | 29 | You would need active cooling for RPi 4. It gets HOT! I use [40mm heatsink](https://www.amazon.co.uk/Easycargo-conductive-TEC1-12706-Thermoelectric-40mmx40mmx11mm/dp/B07D4FVC61/ref=sr_1_1?crid=30Z05ERNBH3F7&keywords=40mm+heatsink&qid=1568560208&s=gateway&sprefix=40mm+heat%2Caps%2C259&sr=8-1) 30 | with [noctua 5v fan](https://www.amazon.co.uk/Noctua-NF-A4x20-FLX-Premium-40x20mm/dp/B071J8CZP9/ref=sr_1_3_sspa?keywords=noctua+5v&qid=1568560244&s=gateway&sr=8-3-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUFLUUNSTkU0Vk1DRUYmZW5jcnlwdGVkSWQ9QTEwMTc3MDUxVUtEOVMwQ0FFQlFFJmVuY3J5cHRlZEFkSWQ9QTA2OTY4MjExVEs2N1lVSE00Q0hXJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==) 31 | and this keeps RPi quite cool even under full load. 32 | 33 | Yes, if you want to transcode video and want to serve content over the WAN to friends and family, then you would need something 34 | more powerful. You can still use this guide, it would work regardless if you are using a RPi or something else. 35 | 36 | ## Services used 37 | - Plex*: Main media server 38 | - Transmission: Torrent client 39 | - Openvpn: VPN client 40 | - Radarr: Automated movie management and integration with torrent client 41 | - Sonarr: Same as radarr but for TV shows 42 | - Lidarr: Same as radarr but for Music 43 | - Tautulli: Plex media server monitoring service 44 | - Jackett: Torrent indexers proxy 45 | - sonarr_netimport: A python script to fetch TV shows from tvdb.com and add them to sonarr 46 | - radarr_netimport: Similar to sonarr_netimport but for radarr 47 | 48 | Note: transmission and openvpn are in one container. 49 | *You can change this with other media server like Emby. See `docker-compose.yaml` file for details. 50 | 51 | If you don't want to use a specific service or use something different in its place, you can delete/change that service 52 | in the `docker-compose.yaml` file. Most of the services that you would need for media centre have docker containers 53 | built by [linuxserver.io](https://www.linuxserver.io/) 54 | 55 | ## Prerequisite 56 | - docker 57 | - docker-compose 58 | 59 | Follow this guide if you have to install docker and docker-compose: https://github.com/thundermagic/rpi_media_centre/blob/master/docs/docker_install.md 60 | 61 | ## Quick start 62 | Ok, lets run the media centre 63 | 64 | **NOTE:** You can change where data is stored and use your own directory structure by editing `docker-compose.yaml`. More details are in the yaml file. 65 | 66 | 1.) Create top level directory structure like below. I have my HDD where I store all the config and media mounted at /mnt/media 67 | ```bash 68 | /mnt/media 69 | ├── appdata 70 | ├── downloads 71 | ├── movies 72 | ├── music 73 | ├── pictures 74 | └── tv_shows 75 | ``` 76 |
77 | 78 | 2.) Create config directories for each service like below with in the `appdata` directory 79 | ```bash 80 | /mnt/media/appdata 81 | ├── jackett 82 | ├── lidarr 83 | ├── plex 84 | ├── radarr 85 | ├── sonarr 86 | ├── tautulli 87 | └── transmission-openvpn 88 | ``` 89 | 90 | 3.) Clone this repo 91 | ```bash 92 | git clone https://github.com/thundermagic/rpi_media_centre.git 93 | cd rpi_media_centre 94 | ``` 95 | 96 | 4.) Modify `docker-compose.yaml` 97 | Open this file with your text editor and edit the relevant parts. Comments within the file guide you what needs to be modified. 98 | Please read all the comments. They explain a lot of stuff. Do not skip this step. 99 | 100 | 5.) Run the services 101 | ```bash 102 | docker-compose up -d 103 | ``` 104 | 105 | 6.) Check containers are running 106 | ```bash 107 | docker container ls -a 108 | ``` 109 | All the containers should show as running. If there is any container stuck in a reboot a cycle, check the directory 110 | structure created in previous steps and check container logs for more info. 111 | 112 | ##### How do I check container logs? 113 | ```bash 114 | docker container logs 115 | ``` 116 | Example, if you have to check logs for plex 117 | ```bash 118 | docker container logs plex 119 | ``` 120 | 121 | If you have to follow/tail logs use the `-f` flag, example; 122 | ```bash 123 | docker container logs -f plex 124 | ``` 125 | 126 | Assuming everything went alright, you should have all the servics running now. 127 | You can now access each of the services. 128 | 129 | #### How to check if Openvpn is working? 130 | You would need to check two things, if the tunnel interface is created and if the vpn is up and passing traffic. 131 | 132 | For the first one, tunnel interface, on the host, check if there is a `tun` interface created when transmission-openvpn container is running. 133 | 134 | To check if VPN is up and passing traffic, on the host, just check your public IP by googling `whatsmyip`. If you are using the host headless, then type 135 | `curl www.httpbin.org/get` on the console and check the IP address in the `origin` field in the output. That is the public IP being used my the host. 136 | Now if you check the Public IP being used by your network, that should be different from what you got from the previous step. 137 | 138 | ## Accessing services 139 | Each service have a different port number. Assuming your RPi IP address is 192.168.4.4 and you haven't change the port 140 | numbers in `docker-compose.yaml` file, you can access the service like; 141 | 142 | - Plex: http://192.168.4.4:32400/web/index.html# 143 | - radarr: http://192.168.4.4:7878/ 144 | - sonarr: http://192.168.4.4:8989/ 145 | - lidarr: http://192.168.4.4:8686/ 146 | - transmission: http://192.168.4.4:9091/transmission/web/ 147 | - jackett: http://192.168.4.4:9117 148 | 149 | All the port numbers are listed in the `docker container ls` command under `PORTS` column 150 | 151 | ## How do I configure services? 152 | So you have got all the services up and running but don't know what to do next. 153 | Check out videos from [Techno Dad Life youtube channel](https://www.youtube.com/channel/UCX2Vhc0LIzSS9aMzhGFZ7PA). 154 | These videos show you how to install and configure the service on openmediavault but you can just skip straight to the configuration part. 155 | 156 | ## Services details 157 | #### Plex 158 | This is the main media server. 159 | Website: www.plex.tv 160 | Docker image by: [linuxserver.io](https://www.linuxserver.io/) 161 | Docker image and documentation: https://hub.docker.com/r/linuxserver/plex 162 | 163 | I haven't used the [official plex docker image by plexinc](https://hub.docker.com/r/plexinc/pms-docker) because its not available for `armhf` architecture. 164 | If you are not using this media centre service on raspberry pi (basically on `armhf`), you can use this official image. 165 | You would need to modify `docker-compose.yaml` file accordingly. 166 | 167 | #### Radarr 168 | Manages and monitors movies. 169 | Website: https://radarr.video/ 170 | Docker image by: [linuxserver.io](https://www.linuxserver.io/) 171 | Docker image and documentation: https://hub.docker.com/r/linuxserver/radarr 172 | 173 | #### Sonarr 174 | Manages and monitors TV shows. 175 | Website: https://sonarr.tv/ 176 | Docker image by: [linuxserver.io](https://www.linuxserver.io/) 177 | Docker image and documentation: https://hub.docker.com/r/linuxserver/sonarr 178 | 179 | #### Lidarr 180 | Manages and monitors music. 181 | Website: https://lidarr.audio/ 182 | Docker image by: [linuxserver.io](https://www.linuxserver.io/) 183 | Docker image and documentation: https://hub.docker.com/r/linuxserver/lidarr 184 | 185 | #### Jackett 186 | Indexer proxy. 187 | Website: https://github.com/Jackett/Jackett 188 | Docker image by: [linuxserver.io](https://www.linuxserver.io/) 189 | Docker image and documentation: https://hub.docker.com/r/linuxserver/jackett 190 | 191 | #### Transmission-openvpn 192 | This is a single docker container running transmission and openvpn. Transmission runs only when openvpn is connected. 193 | Website: https://github.com/haugene/docker-transmission-openvpn 194 | Docker image: https://hub.docker.com/r/haugene/transmission-openvpn 195 | Documentation: https://haugene.github.io/docker-transmission-openvpn/ 196 | 197 | #### Tautulli 198 | Monitors plex media server. 199 | Website: https://tautulli.com/ 200 | Docker image by: [linuxserver.io](https://www.linuxserver.io/) 201 | Docker image and documentation: https://hub.docker.com/r/linuxserver/tautulli 202 | 203 | #### sonarr_netimport 204 | Fetches TV shows from a user's list from TVDB.com and add them to sonarr. I created this just because sonarr at present does not 205 | support netimport lists. 206 | Website: https://github.com/thundermagic/sonarr_netimport 207 | Docker image and documentation: https://hub.docker.com/r/thundermagic/sonarr_netimport 208 | 209 | #### radarr_netimport 210 | Similar to sonarr_netimport but for radarr. Radarr has this feature built-in but radarr uses TMDB API v3 and 211 | I have noticed that if using v3 API, TMDB only returns maximum of 500 movies in the list. 212 | This is resolved if using TMDB API v4. 213 | Website: https://github.com/thundermagic/radarr_netimport 214 | Docker image and documentation: https://hub.docker.com/r/thundermagic/radarr_netimport 215 | 216 | ## How to upgrade a service? 217 | When there is a new version of service available, like a newer plex version, you can follow these steps to upgrade 218 | 219 | _**A bit of a side note regarding docker image tags:** Docker images naming conventions is `:`. Usually 220 | images have a `latest` tag that would be pointing to the latest version of the image. In addition to this images could 221 | have a tag for specific versions. Check out documentation for the image to know which tags are supported._ 222 | 223 | Assuming all the services have docker tag of `latest`, to upgrade; 224 | 225 | `cd` into the directory where docker-compose file is. 226 | #### To upgrade all services 227 | ```bash 228 | docker-compose pull 229 | docker-compose down 230 | docker-compose up -d 231 | ``` 232 | 233 | #### To upgrade one specific service 234 | Taking example of the plex service which is using the container name of `plex` 235 | ```bash 236 | docker-compose pull plex 237 | docker container stop plex 238 | docker container rm plex 239 | docker-compose up -d plex 240 | ``` 241 | 242 | If a service is using specific tag, then you would need to need to change the `docker-compose.yaml` file and change the 243 | tag to the newer tag. 244 | For example, assuming we have a tag of `v2` available for a service (lets call the service as `srv1` which uses the 245 | same name as container name) that currently is using the tag `v1`. 246 | Change the tag for the image used by this service to `v2` from `v1` and then run below commands in the shell. You have 247 | to be in the directory which have `docker-compose.yaml` file, unless you want to use the `-f` flag with `docker-compose` command. 248 | ```bash 249 | docker-compose pull srv1 250 | docker container stop srv1 251 | docker container rm srv1 252 | docker-compose up -d srv1 253 | ``` 254 | 255 | ## Do you want to monitor RPi as well? 256 | Check out: [Monitoring Raspberry Pi with Prometheus](https://github.com/thundermagic/rpi_monitoring_with_prometheus) 257 | 258 | ## Some common issues 259 | 260 | These are some of the issues I can think off from top of my mind that you may encounter and how to resolve them 261 | 262 | 1) **`Operation not permitted` or similar errors:** If you get these errors then the issue usually lies with either 263 | the user who is trying to run docker container is not a memeber of `docker` group or the user is trying to create some 264 | files/folder and do not have the required permissions to do so. 265 | To resolve these, make sure the user is a member of the `docker` group. You can check this from the `/etc/group` file. 266 | To make a user member of docker group, type `sudo usermod -aG docker $USER` assuming you are logged in as that user. Else 267 | replace the `$USER` in this command with the username of the user. 268 | 269 | 2) **`Operation not supported` or `port number already used` errors:** You may get these sort of errors if something is already using 270 | port numbers on your host that are specified for the services in the `docker-compose.yaml` file. In that case, you can change the port mappings 271 | for that service in the `docker-compose.yaml` file. 272 | 273 | 3) **`Device not found` or similar when running Plex container:** This error is due to the device mapping in the `docker-compose.yaml` file. 274 | You would most likely encounter this issue if using RPi3. Please check the `docker-compose.yaml` and delete the `devices` section 275 | for plex. 276 | 277 | 4) **`docker-compose not found`:** You may encounter this issue after installing docker-compose because sometimes after the 278 | installation, the docker-compose binary is not copied to one of the paths in the $PATHS. i.e. After installation it would 279 | most likely be in the `$HOME/.local/bin` directory. Copy the docker-compose from here to `/usr/local/bin` directory. 280 | Command: `cp docker-compose /usr/local/bin`. 281 | 282 | 5) **`x-extra_args not supported` or `docker-compose version is wrong` errors:** If you get errors like this, then its an issue with 283 | the docker-compose version. To resolve it, first change the version in the `docker-compose.yaml` file to `3.7`. If that does not 284 | work then change it to `2`. If still it does not work, then delete the entire `x-extra_args` section and within each service definition 285 | change the section `extra_hosts: *pi` to `extra_hosts: "pi:"` where `HOST-IP` is the IP address of the host that you are running 286 | the services on. This just adds an entry to the `hosts` file within the container so you can use the DNS name of `pi` rather than using 287 | ip address to connect to other services. If you are not bothered about it then you can delete this section from the container 288 | definition. 289 | 290 | ## Future iterations 291 | I am planning to run all of this on a cluster of RPis with some shared storage solution. This is something I will be working on in my 292 | free time. Probably would run kubernetes + ceph or nfs. Haven't really thought much about it. --------------------------------------------------------------------------------