|Added Docker Compose details|
Added new folder mappings to ensure atomic moves and Hard-linking
This is the first part of a series showing you how to setup Usenet Automation using Docker on a Synology NAS.
Setting up a Docker User and Obtaining the PGID and PUID
In previous versions of this guide we used your default admin account for each container, this is not very secure so please now follow the separate setup guide and then head back here
Downloading the Container
In the majority of my guides I use the containers made by Linux|Server, these have very good documentation and are very well maintained so should any issues arise there is a group of people to ask, plus these work really well on Synology.
Open up Docker within DSM and navigate to the ‘Registry’ section and search for sabnzbd in the search box. Right click and download the Linux|Server version.
When it asks which version number you want to use just choose latest
Setting up SABnzbd
Head into the Image tab of the left of the window, select the Sabnzbd image and click on ‘Launch’ in the section at the top of the window.
The initial screen you are greeted with allows you to change the container name and resource restrictions, In this case I am leaving this all at its default.
Click on Advanced Settings, on the first screen you see enable auto restart as this will mean SABNZBD will automatically start up if you ever reboot your NAS.
Volumes / Mounts
We are now going to set up the shares we want to mount. SABNzbd only needs access to two folders.
Under the ‘Docker’ share on your Diskstation create a folder called ‘sabnzbd’ this is important as your configuration files will be stored here.
You will notice there is a consistent mount path for each of the folders across all my guides this is important as Docker will see all of your individual folders as one consistent filesystem rather than separate volumes. This will mean you should see much faster file moves (aka Atomic Moves) and also if you are using torrents it means you can enable hard-links
The port settings are extremely important, do not leave them to Auto as you will have to look up the port number every single time the container is restarted and it will screw with all your other containers as they will not be able to talk to each other.
Local Port = 8080
Container Port = 8080 (SAB’s Non SSL Port)
Local Port = 9090
Container Port = 9090 (SAB’s SSL Port)
Environment Variables (PGID, PUID and Timezone)
Next we are going to setup a couple of Environment variables this is the user details we took note of earlier in the guide, this allows the Docker image to have the right access to the shares we just added. In addition we are also required to set the timezone for the container you can find a list of zones on wikipedia https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
In the environment tab enter the details as shown in the screenshot, but change them to whatever yours were noted as.
Click OK and this will take you back to the summary screen we saw earlier.
Now the container has started head to you NAS IP address and port you provided earlier in the guide, in this case 8080. You will need to start the config of SAB.
After entering your service providers details you must change the completed and temporary download folders the following.
If you skip this step your downloads will end up being stored within the container rather than your downloads directory we mounted to /media/downloads.
You can use the below code saved as sabnzbd.yml to do the entire process above in one quick command via SSH. Ensuring you change the variables to your own media paths.
version: "3.2" services: linuxserver-sabnzbd: image: linuxserver/sabnzbd:latest container_name: sabnzbd environment: - PUID=YOURPUID - PGID=YOURPGID - TZ=Europe/London volumes: - /volume1/docker/sabnzbd:/config - /volume1/downloads:/media/downloads ports: - 8080:8080/tcp - 9090:9090/tcp restart: unless-stopped
sudo docker-compose -f /volume1/docker/sabnzbd.yml up -d --remove-orphans