How to Set Up a Print Server with CUPS (Share a USB Printer with Windows, Mac, iPhone and Android)

An old USB printer becomes a network printer: CUPS on the server, AirPrint for the phones, every device in the house prints.

A perfectly good USB printer, plugged into one PC that has to be on for anyone to print. Plug it into the server instead and CUPS — the print system behind macOS and most of Linux — shares it to the whole house: Windows and Macs see it as a network printer, and with Avahi advertising it, iPhones print via AirPrint and Androids via Mopria with no apps or drivers. Works for network printers too, as a central queue that adds AirPrint to printers that never had it.

Quick reference

TaskWhat
Installsudo apt install cups cups-filters printer-driver-all avahi-daemon -y
Admin pagehttps://server-ip:631 (allow remote admin first)
Add a printerAdministration → Add Printer → the USB device → driver (or IPP Everywhere)
Sharetick Share this printer; Server settings → Share printers connected to this system
PhonesAirPrint/Mopria appear automatically via Avahi
WindowsAdd printer → http://server-ip:631/printers/NAME (IPP)

1. Install

sudo apt install cups cups-filters printer-driver-all avahi-daemon -y
sudo usermod -aG lpadmin $USER
sudo ufw allow from 192.168.1.0/24 to any port 631
sudo ufw allow 5353/udp

printer-driver-all pulls in the open-source drivers (HP via HPLIP, Brother, Epson, Canon, Gutenprint). Many modern printers need none — they're driverless (IPP Everywhere / AirPrint-capable) and CUPS talks to them directly.

2. Allow remote admin

CUPS only listens on localhost by default:

sudo cupsctl --remote-admin --remote-any --share-printers
sudo systemctl restart cups

Open https://192.168.1.50:631 (accept the self-signed certificate), Administration, log in with your server username (you're in lpadmin).

3. Add the printer

Plug the printer into the server's USB. Administration → Add Printer: it's listed under Local Printers (e.g. HP LaserJet 1020 (USB)). Continue, give it a short name (laserjet), tick Share This Printer, then pick the driver — the model from the list, or IPP Everywhere if the printer supports it (newer ones). Set defaults (A4, duplex). Print Test Page.

For a printer already on the network that you want to centralise: Add Printer → Discovered Network Printers, or Other → Internet Printing Protocol with ipp://printer-ip/ipp/print, driver IPP Everywhere.

4. Phones: AirPrint and Mopria

With Avahi running and the printer shared, CUPS advertises it as _ipp._tcp with AirPrint's attributes. On an iPhone, Share → Print lists it; on Android, the built-in print service (Mopria) finds it. Nothing to install.

If it doesn't appear, the printer may lack a PDF/URF filter — cups-filters provides it; check lpoptions -p laserjet -l | grep -i urf. Across VLANs (tutorial 143), you need the mDNS reflector.

5. Windows and Mac

Mac: System Settings → Printers → + → it's listed (Bonjour). Done.

Windows: Settings → Printers → Add → The printer I want isn't listed → Select a shared printer by name → http://192.168.1.50:631/printers/laserjet → driver: pick the model, or Microsoft IPP Class Driver (driverless). Windows 11 also discovers AirPrint/IPP printers automatically in many cases.

Linux desktops: they see it via Avahi immediately.

6. Manage it

The Jobs page shows the queue; cancel stuck jobs there or cancel -a. lpstat -p -d on the server for status. Logs in /var/log/cups/error_log. Set Policies → Error policy: retry-job on the printer so a paper jam doesn't lose everyone's work.

Scanners

A multifunction's scanner isn't shared by CUPS — that's tutorial 152 (SANE and scanservjs).

Troubleshooting

Printer not listed under Local Printers. lsusb shows it? Then sudo systemctl restart cups. USB permissions: lpadmin group, and the lp group owns the device.

Prints garbage or blank pages. Wrong driver. Try the model's exact PPD, or IPP Everywhere, or for HP: hp-setup -i from HPLIP (some models need the proprietary plugin).

AirPrint not appearing on the phone. Avahi not running, port 5353 blocked, or phone on a different VLAN/SSID (guest networks isolate clients).

Windows asks for a driver repeatedly. Use the IPP Class Driver, or install the manufacturer's driver and point it at the IPP URL.

Printer sleeps and jobs fail. Some USB printers power-save; CUPS's retry policy, or a smart plug schedule to wake it.

Wrapping up

Install CUPS, allow remote admin, add the USB printer, tick share. Macs and phones find it by themselves, Windows gets an IPP URL, and the old printer serves the whole house from the server that's already on — AirPrint included, for a printer that never had it.

Call us