Runbook for setting up AirPrint on a Synology NAS so iOS/macOS devices can print to a USB or network printer over the local network. Uses a Docker CUPS container and Synology’s built-in avahi (mDNS) daemon for service discovery.
Architecture#
| |
Key design decisions:
- Container uses
network_mode: host— required for mDNS broadcast to work - Container mounts
/etc/avahi/servicesdirectly so Synology’s avahi picks up its service files - Synology’s own CUPS must be disabled to free port 631
Prerequisites#
- Synology DSM with Docker (Container Manager) installed
- SSH access to NAS
- Printer reachable from NAS (USB or network socket)
- Disable Synology’s built-in CUPS print server (via DSM package or
synoservicectl)
Setup#
1. Create directory structure#
| |
2. docker-compose.yaml#
Create /volume1/docker/cups/docker-compose.yaml:
| |
3. Start the container#
| |
4. Add your printer via CUPS web UI#
Open http://<nas-ip>:631 in a browser, log in with the admin credentials, and add your printer:
- Administration → Add Printer
- For a network printer:
socket://10.0.x.x:9100 - Set Shared: Yes
- Choose the appropriate PPD/driver (Gutenprint works well for most Brother/HP printers)
The container’s printer-update.sh watches for CUPS printer changes and automatically
regenerates the avahi service file in /etc/avahi/services/.
5. Verify mDNS broadcast#
| |
6. Verify CUPS is accessible#
| |
Debugging Notes#
Container uses wrong volume mount after yaml edit#
If you edit docker-compose.yaml to change the /services mount, you must
recreate (not just restart) the container for it to take effect:
| |
Verify the active mounts:
| |
Printer not showing on iOS#
Check in order:
avahi-browse -a -t | grep ipp— is the service being advertised?curl http://nas-ip:631/printers/— is CUPS serving the printer?- Firewall — DSM firewall may block port 631 from device subnets
docker inspect cups-airprint— confirmnetwork_modeishost- Force iOS to re-scan: toggle Wi-Fi off/on, or open an app’s print dialog
avahi only broadcasts on one interface#
Check /etc/avahi/avahi-daemon.conf — Synology locks avahi to allow-interfaces=eth4
(the main LAN port). This is correct for a single-NIC setup. If your LAN is on a
different interface, update that line (but DSM may reset it on upgrade).
Port 631 already in use#
Synology’s CUPS may still be running. Stop it:
| |
My Setup#
| Item | Value |
|---|---|
| NAS | Synology DS1621+ |
| NAS IP | 10.0.10.10 |
| Printer | Brother HL-2270DW |
| Printer IP | socket://10.0.20.50:9100 |
| Driver | Brother HL-2250DN - CUPS+Gutenprint v5.2.11 |
| Docker image | tigerj/cups-airprint:latest |
| avahi interface | eth4 |
Notes#
- The
URF=noneTXT record in the avahi service file is expected for older printers using traditional CUPS drivers — iOS will still discover and use the printer - The avahi service file is auto-regenerated on container start and on any CUPS printer state change, so no manual editing is needed
docker-compose.yamlis the source of truth — always recreate (not restart) after volume changes