This guide walks you through how to install Sonarr on Docker so you can run the popular TV show tracking and automation tool as a lightweight, self-contained container on your home server or NAS. It suits anyone who already runs Docker for other apps and wants Sonarr managing episode downloads without cluttering the host system with dependencies.
Running Sonarr in a container keeps it isolated from other software, makes updates simple, and lets you back up or move the whole setup by copying a single configuration folder. The steps below apply whether you are running Docker on a regular Linux server, a NAS with Docker support, or a small home lab box.
What you’ll need
- A machine with Docker installed and running (Linux, a NAS with Docker support, or a Docker-capable home server).
- Basic comfort using a terminal or your NAS’s Docker management interface.
- A folder structure already in mind for your media and downloads, ideally on the same volume or drive to avoid slow file copies.
- Your user ID (PUID) and group ID (PGID) if you want Sonarr to write files with the correct permissions.
Step 1: Prepare your folders
- Create a folder for Sonarr’s configuration data, for example a directory named something like sonarr-config in your Docker apps location.
- Create or identify a folder for your TV library, and a separate folder where your download client saves completed files.
- Keep these folders on the same top-level volume where possible. Sonarr moves and renames files after import, and cross-volume moves are slower and can cause permission headaches.
- Note the full paths to each folder. You will map these into the container in the next steps.
Step 2: Pull the Sonarr image
- Open a terminal on the host running Docker, or the Docker app section of your NAS interface.
- Search for the Sonarr image from a trusted maintainer. The most widely used community image is maintained by LinuxServer.io and is available on the official Sonarr Docker image page on Docker Hub.
- Pull the image to your host, or let your NAS interface download it automatically when you create the container.
Step 3: Configure the container
When creating the container, you’ll need to set a handful of environment variables, map the ports Sonarr uses, and mount your folders as volumes. The table below summarises the key settings you will typically configure.
| Setting | Typical value | Purpose |
|---|---|---|
| PUID | Your user’s numeric ID | Ensures files Sonarr creates are owned by the correct user |
| PGID | Your group’s numeric ID | Ensures files Sonarr creates use the correct group permissions |
| TZ | Your local timezone | Keeps scheduling and logs aligned with your local time |
| Port 8989 | Mapped to host port 8989 (or another free port) | Access to the Sonarr web interface |
| Config volume | Host config folder mapped to /config | Stores Sonarr’s settings, database and logs |
| TV volume | Host TV folder mapped to /tv | Where Sonarr organises and stores your show library |
| Downloads volume | Host downloads folder mapped to /downloads | Shared folder Sonarr and your download client both use |
- Set the PUID and PGID values to match the user account that already owns your media folders, so Sonarr does not create files with mismatched permissions.
- Set the container’s timezone environment variable so scheduled searches and the calendar match your local time.
- Map port 8989 on the container to a free port on your host, keeping 8989 unless it conflicts with another app.
- Mount your configuration folder to the container’s config path, your TV library folder to the TV path, and your downloads folder to the downloads path.
- If you use a graphical Docker manager on a NAS, enter these same values into the corresponding fields rather than typing a command.
Step 4: Start the container
- Launch the container using either a docker run command with the flags above, or a docker-compose file listing the same image, environment variables, ports and volumes.
- Give the container a clear name, such as sonarr, so it’s easy to identify later.
- Set the container to restart automatically unless stopped, so Sonarr comes back up after a reboot or Docker restart.
- Start the container and check the logs briefly to confirm it started without errors.
Step 5: Complete setup in the browser
- Open a web browser and go to your host’s IP address followed by port 8989, for example http://192.168.1.10:8989.
- Confirm the Sonarr interface loads and walk through any initial prompts.
- Go into the settings area and check that the Media Management paths match the volumes you mounted, such as /tv for your library.
- Add your download client (torrent or Usenet client) under settings so Sonarr can send releases to it automatically.
- Add an indexer so Sonarr has somewhere to search for episodes, then add your first series to confirm everything works end to end.
Tips and troubleshooting
- If Sonarr can’t rename or move files after download, double-check the PUID and PGID match the account that owns your media folders on the host.
- Keep the downloads folder and TV library folder on the same volume so Sonarr can move files instantly instead of copying them across drives.
- If the web interface won’t load, confirm the port mapping is correct and that no firewall on the host is blocking the port.
- Always back up the config folder before updating the image, since it contains your entire Sonarr database and settings.
- To update Sonarr, pull the latest image tag and recreate the container. Because your data lives in the mounted config volume, none of your settings or history are lost.
Frequently asked questions
Do I need a separate download client container?
Yes. Sonarr itself only manages searching, deciding what to grab and organising files. It does not download anything on its own, so you’ll need a separate torrent or Usenet client container that Sonarr can send releases to.
Why does Sonarr need PUID and PGID?
Docker containers run as a specific user internally. Setting PUID and PGID to match your own user account ensures files Sonarr creates or renames on your host have the correct ownership, which prevents permission errors when other apps or your file manager try to access them.
Can I run Sonarr on a NAS instead of a Linux server?
Yes, many NAS platforms support Docker containers directly through their own app or container manager interface. The same environment variables, ports and volume mappings apply, though you’ll usually enter them through a form rather than a terminal command.
How do I update Sonarr once it’s running in Docker?
Pull the newer image version and recreate the container using the same volume mappings. Since your configuration and database live in the mounted config folder rather than inside the container itself, updating won’t affect your existing library or settings. Check the official Sonarr site for release notes before major version jumps.

