[HOW-TO] Docker Sonarr

First make sure Docker is installed.
https://docs.docker.com/engine/installation/linux/docker-ce/debian/

It’s also useful to add the current user to Docker group to avoid having to use sudo in front of every Docker command.

sudo usermod -aG docker $USER
Now reboot for changes to take affect.

Once you’re up and running again SSH back in and we simply need to run the Docker parameters to get it up and running. It’s sometimes handy to put them in a wee script for future reference.

Check out the config here; https://hub.docker.com/r/lsioarmhf/sonarr/

I like to keep my config files in /opt in the host (OSMC) but it’s really up to you, (avoiding critical system folders obviously)
To do this I need to create and change permissions on the folders.
sudo mkdir /opt/sonarr
sudo chown -R $USER:USER /opt/sonarr

We’ll also need the PUID and GUID of the user running Docker.
id $USER

uid=1000(osmc) gid=1000(osmc) groups=1000(osmc),4(adm),6(disk),7(lp),20(dialout),24(cdrom),29(audio),44(video),999(docker)

So it’s 1000 for both here

Now for the script, this can go anywhere that’s handy to run so /home/osmc works pretty well
sudo vim start_sonarr_docker.sh

#!/bin/bash
docker run -d \
--restart=unless-stopped \
--name sonarr \
-p 8989:8989 \
-e PUID=1000 \
-e PGID=1000 \
-v /opt/sonarr:/config \
-v /mnt/TV:/tv \
-v /mnt/Downloads/tv:/downloads \
lsioarmhf/sonarr

Save & exit

This isn’t a tricky as it looks. The basic rule of thumb is;
The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side. So really it’s up to you. I have a HDD mounted at /mnt hence my choice on the left of the colon.

Now make the file executable chmod +x start_sonarr_docker.sh
Run it with the dot slash command
./start_sonarr_docker.sh

Just open a browser on any device in your network, type in the IP address of OSMC with port 8989

e.g. 192.168.1.100:8989

To keep Docker containers up to date I like to use watchtower Google it and you’ll see. It basically keeps things up to date automatically. So again I create a file and make it executable as above;

vim start_watchtower_docker.sh

#!/bin/bash
docker run -d \
--restart=unless-stopped \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
armhfbuild/watchtower

Save & exit and chmod +x start_watchtower_docker.sh

SImply run docker ps to see all running containers and docker ps -a to see all containers stopped and started.
docker stop <container name>
docker start <container name>
docker restart <container name>
docker rm <container name>

All do exactly as you’d expect with rm meaning remove.

Hi,
out of curiosity, in this scenario the docker pull sonarr in not needed?

by,
den

No, it does it all from the systemd service

Why use docker? What is it good for? Why not just install sonarr without docker?

It has been my experience that Sonarr randomly crashes on OSMC when installed normally. Updates to Sonarr have also crashed the entire system to an unrecoverable state more than once. I figured containerising it would stop this. It has.

Also I find that real world solutions to problems help me learn new things way better as it’s not just an academic exercise. Once I have learned it I try to share my experience to help others as I’m always on forums asking for help.

One thing to be wary of is Docker ‘layers’ can take up a lot of space.

Also check if aufs is being used instead of Device Mapper. This can make a big difference too.

1 Like

Does this method also work with the other lsioarmhf versions of other docker containers?
I was thinking of also doing this with Radarr, Jackett, Mylar, Headphones, LazyLibrarian and Deluge. Not sure how to do all of that though.

I just tried with Radarr and all I get is website cannot be reached.

I managed to install radarr on my pi 2 , not in docker
and runs ok, no issues there.
On the other hand radarr without jackett is useless for me…
Jackett doesn t star cause of mono version been to old, it seams mono 4 and higher is needed.
I didn’t find a way to install a newer version of mono on the rpi.
Any advice would be more then welcome :slight_smile:

There’s no reason you can’t use Docker. Or just install Mono as per the instructions here
http://www.mono-project.com/docs/getting-started/install/linux/

1 Like

Can you send your setup and I’ll try to help?

Bumping an old thread I know but trying to get this working with a newer version of sonarr as the instructions above pull v2, I think. Is there a way to use v4, ideally, in docker? Ta

Sonarr container from LinuxServer released 4 days ago.

search for “develop” on page ctrl+f in most browsers, that refers to v4

Thanks, again, Joakim. I need the help :slight_smile:
So I have pasted the following into a .sh script, and have tried to run it using the command in op but ./ doesn’t seem to work. How would I get it to pull the image, please?


version: “2.1”
services:
sonarr:
image: lscr.io/linuxserver/sonarr:develop
container_name: sonarr
environment:
- PUID=1000
- PGID=1000
volumes:
- /path/to/data:/config
ports:
- 8989:8989
restart: unless-stopped

So after further reading, it seems the above should be in a .yml file which I have tried to run using ‘docker compose up -d’ but I get: no configuration file provided: not found

Further edit, renamed to compose.yml and all ran okay! progress :slight_smile:

After running a compose.yml, I see it has a restart policy: unless stopped. Am I right in thinking that I should not delete this compose yml, and should create new compose.yml in a new location for other apps I wish to run?

Make a folder for every compse.yml, example sonarr/compose.yml and radarr/compose.yml etc etc.

Be on the lookout for .env files, often how you can change variables in side the composed docker.

1 Like

Another idea, try out portainer or yacht, gui for doing setup and manageing. Here is a video comparing those two.

I’ve turned to Portainer myself, but it annoys me, that they are lowering their limits constatly. CE version was 5 simultaneous installation on diffrent hardware, now down to 3. And more and more spam as time passes.

Thanks got all working, bar Radarr. Was reasonably straightforward once I got the process.
Radarr won’t run seemingly as corrupt .db file, which i believe is in /var/lib/docker/config but I can’t gain access to this folder via filezilla or putty. Any ideas? (and thanks for the continued help!)

You would need to use sudo

Getting: No such file or directory

root@osmc:/home/osmc/yml/radarr# cd /var/lib/docker/config/
bash: cd: /var/lib/docker/config/: No such file or directory
root@osmc:/home/osmc/yml/radarr# cd /var/lib/docker/.config/
bash: cd: /var/lib/docker/.config/: No such file or directory
root@osmc:/home/osmc/yml/radarr# cd /var/lib/docker/Config/
bash: cd: /var/lib/docker/Config/: No such file or directory


Me being stupid as not had edited config path in file. seems okay now