I am going to be pasting a set of commands to get docker and docker compose set up, but please be wary of people giving commands to run in the terminal. You could use the information I’ve provided to help you find guides to confirm that no weird commands, but I copied this from my guide I use whenever I set up a new VM to use docker.
So the commands below add any dependencies for docker, adds the GPG key to verify and then installs docker and docker compose. I also set up a docker user add them to the docker group so I don’t need to use sudo to run.
I then use docker to create a portainer instance. Portainer allows you to use a webUi to see what you have running and stop start any of your services from there.
After this I have provided a docker compose file which would be named docker-compose.yml. Yaml sucks as it constantly moans about spacing, but essentially you want to use spaces and not tabs and each new line would be indented two spaces unless it’s a sub part of the section above then it would be two more spaces etc.
This docker compose might or might not be what you need, this one first sets up gluetun, which is a VPN layer which I can route other services through as you don’t want to torrent from your IP.
So gluetun is set up using ProtonVPN and you pass the username and password. Username has +pmp for port forwarding.
Then each service under here can choose to use the service:gluetun or bridge network. The former is for the VPN the latter is routed through regular network. Notice how anything routed through the VPN has the ports defined in the VPN service.
The others things you would need to be conscious of is the paths I have used for /mnt/vault/* as these are network attached storage from TrueNAS. Depending on how you want to store things you’ll need to just add the paths to these. The paths look weird but the part before the colon is where it is on your machine and the part after is what it is called inside that container.
You’ll notice that Plex requires a claim key but you can google how to find that.
This isn’t going to get you up and running and you will likely run in to permission errors and other errors along the way. I would suggest coming back here with your errors or giving them to ChatGPT, just don’t blindly copy commands if you don’t know what they do.
Once your docker compose is complete you can run docker compose up -d to spin it up. Then in portainer you can see all the containers and then login to each and do the setup. Docker compose down to stop them all.
When I set this up I did the gluetun and then Radarr. Get that working and then add your next thing and then the next and so on until you have what you want.
As I said this isn’t a complete solution and you will run into roadblocks, but that’s the fun for me and I am happy to help when you get stuck along the way.
Edit: A few more things you should know. The volumes section. The ones starting with ./ means they’re in the directory where the docker compose file is. And as I have perms to 1001 you would need to ensure that is the PUID of the docker user and then for each folder, plex for instance you can run “sudo chown -R 1001:1001 ./plex” and “sudo chmod-R 755 ./plex” which is change ownership and changes permissions for that directory.
## Docker
Install dependencies
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
Add the Docker GPG key to the server's keyring
sudo curl -fsSL https://download.docker.com/%E2%80%8Blinux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
Add the latest Docker repository to the APT sources
echo "deb arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/%E2%80%8Blinux/ubuntu $(. /etc/os-release && echo "$VERSIONCODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Update the server package index.
sudo apt update
Install Docker
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Verify
sudo docker --version
Enable the Docker system service to start automatically at boot time.
sudo systemctl enable docker
View the Docker service status and verify that it's running
sudo systemctl status docker
### Install docker compose
sudo apt install docker-compose-plugin -y
Verifiy the installation
docker compose version
### Portainer
Create a Volume for Portainer Data
docker volume create portainerdata
Deploy Portainer as a Container
docker run -d
--name=portainer
--restart=always
-p 8000:8000
-p 9443:9443
-v /var/run/docker.sock:/var/run/docker.sock
-v portainerdata:/data
portainer/portainer-ce:latest
Acess Portainer
https//your-server-ip:9443
### Running Docker without Sudo
Add your user to the docker group:
sudo usermod -aG docker $USER
Log out and log back in, or restart your system.
Verify by running:
docker ps
Below is the docker-compose.yml file.
services:
\
gluetun:
\
image: qmcgaw/gluetun
\
containername: protonvpn
\
capadd:
\
- NETADMIN
\
devices:
\
- /dev/net/tun:/dev/net/tun
\
ports: # These are the qBittorrent ports, I like to use random ports and not the default ports 49152
\
- 49893:49893 # This is for the qBittorrent WebUI Port
\
- 6881:6881 # Listening port for TCP
\
- 6881:6881/udp # Listening port for UDP
\
- 7878:7878 # Listening port for Radarr
\
- 8989:8989 # Listening port for Sonarr
\
- 9696:9696 # Listening port for Proxlarr
\
environment:
\
- VPNSERVICEPROVIDER=protonvpn
\
- OPENVPNUSER=USERNAME+pmp # REPLACE with your OpenVPN username (+pmp for port forwarding)
\
- OPENVPNPASSWORD=PASSWORD # REPLACE with your OpenVPN password
\
- VPNPORTFORWARDING=on
\
- SERVERCOUNTRIES=France # These countries must support P2P
\
volumes:
\
- ./gluetun:/gluetun
\
restart: unless-stopped
\
\
qbittorrent:
\
image: lscr.io/linuxserver/qbittorrent:latest
\
containername: qbittorrent
\
environment:
\
- PUID=1001 # to find your current ID just type "id" in the terminal
\
- PGID=1001 # to find your current group ID just type "id" in the terminal
\
- TZ=Europe/London
\
- WEBUIPORT=49893 # Must match the port used on gluetun for the WebUI
\
- TORRENTINGPORT=6881
\
volumes:
\
- ./qbittorent/config:/config # this will create the config folder in the same folder as the yml file
\
- /mnt/vault/Downloads/downloads # adjust to your desired download directory
\
networkmode: "service:gluetun" # must match the container name of gluetun
\
restart: unless-stopped
\
\
prowlarr:
\
image: lscr.io/linuxserver/prowlarr:latest
\
containername: prowlarr
\
dependson:
\
- gluetun
\
environment:
\
- PUID=1001
\
- PGID=1001
\
- TZ=Europe/London
\
user: "1001:1001"
\
volumes:
\
- ./prowlarr/config:/config
\
networkmode: "service:gluetun"
\
restart: unless-stopped
\
\
radarr:
\
image: lscr.io/linuxserver/radarr
\
containername: radarr
\
dependson:
\
- gluetun
\
environment:
\
- PUID=1001
\
- PGID=1001
\
- TZ=Europe/London
\
user: "1001:1001"
\
volumes:
\
- ./radarr/config:/config
\
- /mnt/vault/Downloads/downloads
\
- /mnt/vault/Movies/movies
\
networkmode: "service:gluetun"
\
restart: unless-stopped
\
\
sonarr:
\
image: lscr.io/linuxserver/sonarr
\
containername: sonarr
\
dependson:
\
- gluetun
\
environment:
\
- PUID=1001
\
- PGID=1001
\
- TZ=Europe/London
\
user: "1001:1001"
\
volumes:
\
- ./sonarr/config:/config
\
- /mnt/vault/Downloads/downloads
\
- /mnt/vault/TV:/tv
\
networkmode: "service:gluetun"
\
restart: unless-stopped
\
\
jellyfin:
\
image: jellyfin/jellyfin
\
containername: jellyfin
\
environment:
\
- PUID=1001
\
- PGID=1001
\
- TZ=Europe/London
\
volumes:
\
- ./jellyfin/config:/config
\
- /mnt/vault/Movies/movies
\
- /mnt/vault/TV:/tv
\
restart: unless-stopped
\
ports:
\
- 8096:8096
\
networkmode: "bridge"
\
\
plex:
\
image: lscr.io/linuxserver/plex:latest
\
containername: plex
\
networkmode: host
\
environment:
\
- PUID=1001
\
- PGID=1001
\
- TZ=Europe/London
\
- VERSION=docker
\
- PLEXCLAIM=CLAIMKEY
\
- NVIDIAVISIBLEDEVICES=all
\
volumes:
\
- ./plex:/config
\
- /mnt/vault/Movies/movies
\
- /mnt/vault/TV:/tv
\
deploy:
\
resources:
\
reservations:
\
devices:
\
- driver: nvidia
\
count: all
\
capabilities: gpu]
\
runtime: nvidia
\
restart: unless-stopped