Skip to content

Instantly share code, notes, and snippets.

@davidtwco
Last active May 14, 2021 08:39
Show Gist options
  • Save davidtwco/7a1a7e2df2df640aaae4ccf8c2884901 to your computer and use it in GitHub Desktop.
Save davidtwco/7a1a7e2df2df640aaae4ccf8c2884901 to your computer and use it in GitHub Desktop.
Systemd units for running Deluge (w/ VPN), Jackett, SABnzbd, Sonarr, Radarr, Plex in Docker containers; superseded by https://github.com/davidtwco/veritas.
[Unit]
Description=Deluge
After=docker.service
Requires=docker.service
Requires=jackett.docker.service
[Service]
ExecStartPre=/usr/bin/docker pull linuxserver/deluge
ExecStart=/usr/bin/docker run --rm --name %n \
--network media \
--publish 8112:8112 \
--volume media_downloads:/downloads \
--volume media_deluge_config:/config \
--env PUID=112 \
--env GUID=117 \
--env TZ='Europe/London' \
linuxserver/deluge
Restart=always
RestartSec=10s
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
[Unit]
Description=Deluge
After=docker.service
Requires=docker.service
Requires=jackett.docker.service
[Service]
ExecStartPre=/usr/bin/docker pull binhex/arch-delugevpn
ExecStart=/usr/bin/docker run --rm --name %n \
--network media \
--cap-add NET_ADMIN \
--publish 8112:8112 \
--publish 8118:8118 \
--volume media_downloads:/downloads \
--volume media_delugevpn_config:/config \
--volume /etc/localtime:/etc/localtime:ro \
--env VPN_ENABLED=yes \
--env VPN_REMOTE=nl.proxy.sh \
--env VPN_PORT=1443 \
--env VPN_PROTOCOL=udp \
--env VPN_DEVICE_TYPE=tun \
--env VPN_PROV=custom \
--env STRONG_CERTS=yes \
--env ENABLE_PRIVOXY=yes \
--env LAN_NETWORK=192.168.0.0/24 \
--env NAME_SERVERS=8.8.8.8,8.8.4.4 \
--env DEBUG=false \
--env UMASK=000 \
--env PUID=112 \
--env GUID=117 \
--env PYTHON_EGG_CACHE=/config/plugins \
binhex/arch-delugevpn
Restart=always
RestartSec=10s
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
[Unit]
Description=Jackett
After=docker.service
Requires=docker.service
[Service]
ExecStartPre=/usr/bin/docker pull linuxserver/jackett
ExecStart=/usr/bin/docker run --rm --name %n \
--network media \
--publish 9117:9117 \
--volume media_downloads:/downloads \
--volume media_jackett_config:/config \
--volume /dev/rtc:/dev/rtc:ro \
--env PUID=112 \
--env GUID=117 \
--env TZ='Europe/London' \
linuxserver/jackett
Restart=always
RestartSec=10s
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
[Unit]
Description=Plex Media Server
After=docker.service
Requires=docker.service
[Service]
ExecStartPre=/usr/bin/docker pull linuxserver/plex
ExecStart=/usr/bin/docker run --rm --name %n \
--net host \
--publish 32400:32400/udp \
--publish 32469:32469 \
--publish 32469:32469/udp \
--publish 5353:5353/udp \
--publish 1900:1900/udp \
--publish 32400:32400 \
--volume media_movies:/data/movies \
--volume media_tv_shows:/data/tv_shows \
--volume media_music:/data/music \
--volume media_photos:/data/photos \
--volume media_plex_library:/config \
--volume media_plex_transcode:/transcode \
--env VERSION='public' \
--env PUID=112 \
--env GUID=117 \
--env TZ='Europe/London' \
linuxserver/plex
Restart=always
RestartSec=10s
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
[Unit]
Description=Radarr
After=docker.service
Requires=docker.service
Requires=deluge.docker.service
[Service]
ExecStartPre=/usr/bin/docker pull linuxserver/radarr
ExecStart=/usr/bin/docker run --rm --name %n \
--network media \
--publish 7878:7878 \
--volume media_downloads:/downloads \
--volume media_movies:/movies \
--volume media_radarr_config:/config \
--env PUID=112 \
--env GUID=117 \
--env TZ='Europe/London' \
linuxserver/radarr
Restart=always
RestartSec=10s
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
[Unit]
Description=SABnzbd
After=docker.service
Requires=docker.service
[Service]
ExecStartPre=/usr/bin/docker pull linuxserver/sabnzbd
ExecStart=/usr/bin/docker run --rm --name %n \
--env PUID=112 \
--env GUID=117 \
--env TZ='Europe/London' \
--network media \
--volume media_sabnzbd_config:/config \
--volume media_downloads:/downloads \
--publish 8080:8080 \
--publish 9090:9090 \
linuxserver/sabnzbd
Restart=always
RestartSec=10s
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
[Unit]
Description=Sonarr
After=docker.service
Requires=docker.service
Requires=deluge.docker.service
[Service]
ExecStartPre=/usr/bin/docker pull linuxserver/sonarr
ExecStart=/usr/bin/docker run --rm --name %n \
--network media \
--publish 8989:8989 \
--volume media_downloads:/downloads \
--volume media_tv_shows:/tv \
--volume media_sonarr_config:/config \
--volume /dev/rtc:/dev/rtc:ro \
--env PUID=112 \
--env GUID=117 \
--env TZ='Europe/London' \
linuxserver/sonarr
Restart=always
RestartSec=10s
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
@davidtwco
Copy link
Author

davidtwco commented Apr 14, 2017

This does not include the commands that will create the named volumes. You can create those as below:

docker volume create --opt type=none --opt device=<path on host> --opt o=bind media_<media folder>

@davidtwco
Copy link
Author

Using the delugevpn.docker.service service instead of deluge.docker.service requires adding a ovpn configuration file to the openvpn folder inside the configuration volume.

@davidtwco
Copy link
Author

It is important to remember that Sonarr and Radarr look for the downloads paths that Deluge supplies. So if Deluge has the downloads volume at /data and Radarr and Sonarr have the volume at /downloads then they won't be able to get to the files.

@davidtwco
Copy link
Author

Each service will need logged into and configured. The settings from this guide can be used for that (see all the relevant parts) with the following exceptions:

  • Use plex.docker.service, deluge.docker.service, etc. as hostnames.
  • Don't use the Drone Factory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment