# SABnzbd

> The Usenet download client. Receives NZBs from Sonarr and Radarr, downloads from your provider, and unpacks completed downloads.

# SABnzbd

SABnzbd is the download client in this stack. Sonarr and Radarr send it NZB files, and SABnzbd handles the actual download from your Usenet provider, verifies the files, and unpacks them. Once a download is complete, it notifies Sonarr or Radarr to begin the import.

## Docker Compose

```yaml
sabnzbd:
  image: lscr.io/linuxserver/sabnzbd:latest
  container_name: sabnzbd
  environment:
    - PUID=1000
    - PGID=1000
    - TZ=Europe/Zurich
  volumes:
    - /srv/media-stack/config/sabnzbd:/config
    - /mnt/media/downloads:/downloads
  ports:
    - "8080:8080"
  networks:
    - media_net
  restart: unless-stopped
```

## Initial Configuration

Open `http://<docker-vm-ip>:8080`.

### 1. Add your Usenet provider

Go to **Config → Servers → Add Server**:

| Field | Value |
|-------|-------|
| Host | `news.newshosting.com` |
| Port | `563` |
| SSL | Yes |
| Username | Your Newshosting username |
| Password | Your Newshosting password |
| Connections | 10–20 (check your plan limit) |

See [Providers](/docs/home-server/media-automation/automation-download/providers) for more detail on Newshosting.

### 2. Set up categories

Categories tell SABnzbd where to put completed downloads, and they let Sonarr and Radarr identify their own jobs.

Go to **Config → Categories** and add:

| Category | Folder |
|----------|--------|
| `movies` | `/downloads/movies` |
| `tv` | `/downloads/tv` |

In Sonarr and Radarr, set the SABnzbd category to match (`tv` for Sonarr, `movies` for Radarr) when configuring the download client.

### 3. Get the API key

Go to **Config → General** and copy the API key. You need this when adding SABnzbd as a download client in Sonarr and Radarr.

## Completed download handling

SABnzbd moves finished downloads to the category folder and notifies the requesting app. Sonarr or Radarr then picks up the file and imports it into the media library.

Do not delete files from `/downloads` manually. Sonarr and Radarr clean up after a successful import.

## Performance: keep the incomplete directory local

SABnzbd's hottest I/O happens during download, PAR2 verification, and unpack. These involve writing and reading many large files in rapid succession. If the incomplete directory lives on an NFS share, this phase runs across a network protocol layer and is slower than it needs to be.

The fix: mount a local disk inside the Docker VM and point SABnzbd's incomplete directory at it. Only the finished, unpacked file moves to NFS (your ZFS media library). That move is a single large sequential write, which NFS handles well.

In practice, 150–200 GB of local SSD scratch space is enough for most home setups. A single 4K movie download (50–80 GB compressed) needs roughly double its size during unpack, so 150 GB gives comfortable headroom for one or two concurrent jobs.

See the agent task file at `agents/sabnzbd-local-scratch.md` for step-by-step instructions to add the local disk and reconfigure SABnzbd.

## Security: unwanted extensions and cleanup

Usenet releases occasionally include executables, scripts, or junk metadata alongside the actual content. SABnzbd has two settings to deal with this:

**Unwanted extensions** (Config → Switches): aborts the job if the archive contains files like `.exe`, `.bat`, `.js`, or `.lnk`. Catches fake releases and anything potentially malicious before it reaches your library.

**Cleanup list** (Config → Switches): silently deletes metadata files (`.nfo`, `.sfv`, `.txt`) after a successful download. Keeps your completed folders clean.

Full configuration is in the [Configure SABnzbd](/docs/home-server/media-automation/installation/configure-sabnzbd) installation step.

## Ports

| Port | Purpose |
|------|---------|
| 8080 | SABnzbd web UI |
