Print from your iPhone, iPad and Mac to the old network printer that still works perfectly.
Legacy Printer AirPrint Relay is a small Docker container (CUPS + Avahi) that makes an older network printer show up as an AirPrint-compatible printer on iPhone, iPad and Mac. Your devices need no drivers or apps, and nothing goes through the cloud.
Free and MIT-licensed. Runs on a Synology NAS, a Raspberry Pi or any always-on Linux machine on the same network as your devices.
Why this one
Plenty of solid laser printers were built before AirPrint existed. The relay keeps them in use, and it handles the things that usually go wrong with a do-it-yourself print server.
- Jobs wait while the printer is off
- Print while the printer is switched off and the job waits, then prints when the printer comes back (up to 7 days with
socket://). It is not cancelled after the usual CUPS limit of 3 hours. How jobs are kept. - iOS offers only the paper you load
- Set
PAPER_SIZE=Letter(orA4) and that is the only size the iPhone print sheet offers, instead of A4, A5 and A6 on a Letter printer. Paper size and iOS. - Configured by environment variables
- There is no CUPS web console step and no manual
lpadmin. The queue, driver and AirPrint advertisement are rebuilt from your settings every time the container starts. Every setting. - Checks itself at start
- Before it advertises the printer, the relay asks its own queue over IPP whether it offers the paper size and PDF support you configured. A bad setting stops the container with a readable
[lpar] ERRORmessage. - Safe defaults
- It is built for your LAN only, remote administration is off, and no secrets are written to the logs. Security.
- Multi-arch image, rebuilt weekly
- Built on Debian
trixie-slimforlinux/amd64andlinux/arm64, and rebuilt every week (while the repository is active) to pick up Debian security fixes. - MIT-licensed, written from scratch
- The image bundles unmodified Debian packages under their own licences, some of them GPL or AGPL (for example Ghostscript). See the third-party notices.
- Run on real hardware and by automated tests
- It runs on Synology DSM 7.4 with Portainer, driving a Xerox DocuPrint N17b, and an end-to-end suite covers printer off and on, container re-creation during an outage, real multicast mDNS and more.
How it works
Your devices talk to the relay as they would to any AirPrint printer. The relay talks to the printer in the language it already understands.
- iPhone, iPad, Mac Print as to any AirPrint printer
- mDNS to discover, IPP to print
-
Relay container
On your NAS, Raspberry Pi or Linux host
- Avahi advertises the AirPrint printer
- CUPS converts the job for the printer
- Spool holds jobs while the printer is off
- Port 9100, LPD or IPP
- Legacy network printer PostScript or PCL
Avahi announces the CUPS queue on your network with the Bonjour records iOS and macOS look for. The phone sends the job to CUPS over IPP. CUPS converts it for the printer’s language and delivers it over raw socket (JetDirect, port 9100), LPD or IPP. If the printer is off, the job waits in the spool until the printer is back.
The details are in How It Works.
Quick start
You need Docker with Compose v2 or later on an always-on Linux host in the same network (subnet or VLAN) as your iPhone, and a fixed IP address for the printer. Nothing else on the host may use TCP port 631: stop the host’s own CUPS, or set CUPS_PORT.
mkdir airprint-relay && cd airprint-relay
curl -fsSLO https://raw.githubusercontent.com/jmoore2333/legacy-printer-airprint-relay/main/compose.yaml
curl -fsSL -o .env https://raw.githubusercontent.com/jmoore2333/legacy-printer-airprint-relay/main/.env.example
nano .env # REQUIRED: set PRINTER_URI to your printer, e.g. socket://192.0.2.10:9100
docker compose up -d
docker compose logs -f # wait for "[lpar] ready: queue 'legacy-printer' -> ..."
Then print. On an iPhone or iPad, open Share › Print and select Legacy Printer. On a Mac, the printer is listed under System Settings › Printers & Scanners when you add a printer.
The Quick Start guide has the checks for each step. There are separate guides for Synology with Portainer, Synology Container Manager, Raspberry Pi, Unraid, TrueNAS SCALE, QNAP and Proxmox.
What it has been run on
The project uses three status words and never claims more than has been checked. A status changes only with a real test report.
- Tested
-
Printers and client devices: run on real hardware. Software and platform behaviour: exercised by the automated end-to-end suite or on real hardware.
- Synology DSM 7.2+ with Portainer (run on DSM 7.4, x86_64)
- The image on
linux/amd64andlinux/arm64, by the end-to-end suite - iPhone and iPad (AirPrint), and Mac
- Xerox DocuPrint N17b with duplex unit, over port 9100
- Expected
-
Should work by design, but not validated yet. Reports are welcome.
- Synology Container Manager, Raspberry Pi OS 64-bit, Unraid, TrueNAS SCALE 24.10+, QNAP Container Station 3, Proxmox VE, and Docker Compose on your own Linux distribution
- Windows (Microsoft IPP Class Driver), Android (Default Print Service or Mopria) and Linux (driverless IPP) clients
- Other PostScript printers with the
generic-postscriptprofile, PCL printers throughPPD_MODEL, and thelpd://andipp://connections - Xerox DocuPrint N17 without the duplex unit
- Experimental
-
Known caveats, needs extra setup, or not validated.
- macOS or Windows as the relay host
- macvlan or ipvlan networking
- Devices on another VLAN or subnet, with a unicast configuration profile
The full tables are in the Compatibility List (printers), the Quick Start guide (hosts) and Clients. If your printer works, send a printer report so it can be listed.
Questions
Do I need drivers or an app on my iPhone, iPad or Mac?
No. The relay looks like a native AirPrint printer, so iOS and macOS use their built-in printing. The only driver is inside the container.
Will my printer work?
It very likely will if it is a network printer that accepts PostScript, or PCL with PPD_MODEL, over port 9100, LPD or IPP. Check the Compatibility List, and add your printer once it works.
Does it work with USB printers?
No. USB printers are out of scope: the relay is built and tested for network printers. Alternatives include a small network print server box, or sharing the printer from the computer it is plugged into.
Does it need internet access?
No. Discovery, printing and conversion all happen on your LAN. The host needs internet only to pull or update the image.
Why does it need host networking?
iPhones find printers with multicast DNS, and multicast doesn’t pass through Docker’s default bridge network. macvlan or ipvlan networking also works and gives the container its own IP address; it is Experimental. See Host vs macvlan networking.
Can I print from another VLAN, or over the internet?
Printing over the internet isn’t supported: the relay is LAN-only by design. To print from another VLAN, add that VLAN’s subnet to ALLOWED_NETWORKS and let mDNS reach it (for example, with an mDNS reflector on your router). An Apple configuration profile that points at the relay’s address is an Experimental alternative. See Clients.
Does it work with Windows or Android?
That’s Expected, but not validated yet. Windows can add the relay by URL with the Microsoft IPP Class Driver, and Android discovers it through its Default Print Service or Mopria. The steps are on Clients.
I already use another CUPS AirPrint container. Why switch?
This relay adds three things: jobs wait while the printer is off, iOS offers the correct paper sizes, and the whole configuration lives in environment variables. Moving over takes a few minutes; see Migrating from synology-airprint.
Is this made by Apple or Xerox?
No. It’s an independent MIT-licensed project. AirPrint is a trademark of Apple Inc., and the relay is “AirPrint-compatible” because it speaks the same open standards (IPP and DNS-SD).
More answers are in the FAQ and the Troubleshooting guide.