Set up a print server on Ubuntu with CUPS

Ubuntu can turn a spare computer, a small office machine, or even a network-attached storage device into a shared print server using CUPS, the Common Unix Printing System. Clients send jobs over the Internet Printing Protocol, while CUPS handles drivers, queues, spooling, and printer status. One Ubuntu system can administer printers for several Ubuntu computers, Windows machines, and Macs.

For Australian users, the useful starting point is usually an A4-capable laser or inkjet from the local market, such as an HP, Canon, Epson, or Brother model. A wired server on the same home or office LAN is more dependable than crowded Wi-Fi, especially when NBN broadband is shared by family members or remote workers. People in Sydney, Melbourne, Brisbane, and regional offices can print school packets, invoices, and work documents without moving a USB cable.

A dependable server needs a stable address, a supported Ubuntu release such as 24.04 LTS, and enough storage for temporary spool files. Work through installation, queue setup, LAN access, client connections, and hardening in that order. Native IPP is the best foundation because it works across operating systems and avoids installing a separate driver on every computer.

Check the printer and local network

First, identify how the printer connects. Record the exact model, its IP address from the printer's network settings screen, and whether it supports AirPrint, IPP Everywhere, or only a vendor-specific protocol. A USB printer can work through CUPS, although a model with its own Ethernet or Wi-Fi connection is easier to share and survives a server restart. Check the ink or toner level and confirm that A4 is supported before moving anything.

Place the Ubuntu server on the same private LAN as the clients, preferably with Ethernet. Give it a DHCP reservation in the router so its address does not change; hostname -I shows the current addresses. Guest Wi-Fi often blocks device-to-device traffic, and some NBN-supplied routers have small address pools or disabled USB sharing. If staff are in different sites, print over a VPN rather than exposing CUPS directly to the internet.

Install CUPS and the required drivers

Install CUPS, its command-line client, and the common filters. Enable the service at boot and confirm that the print scheduler is ready:

sudo apt update
sudo apt install cups cups-client cups-filters
sudo systemctl enable --now cups
lpstat -r

Manufacturer support can be added with packages such as printer-driver-gutenprint for many generic PostScript printers, printer-driver-escpr for Epson inkjets, and hplip for HP devices. Install only the package that matches the hardware. Some multifunction scanners and advanced colour or duplex settings still require software downloaded from the manufacturer. Restart CUPS after changing its configuration or installing a driver.

For browser administration, add the local account to the lpadmin group:

sudo usermod -aG lpadmin "$USER"

Log out and back in for the group change to take effect. Open http://localhost:631 in a browser and confirm that the CUPS administration pages load. If the browser reports a certificate warning, check that the address is genuinely localhost before accepting it.

Configure the first printer queue

From the CUPS web interface, choose Add Printer and let Ubuntu discover a USB or network printer. For a network model, enter its address or hostname if it does not appear automatically. Driverless IPP devices usually create a usable queue with little configuration; a conventional printer may require the closest available match or a vendor driver.

Give the queue a clear name such as Office or Reception, add a location, and set A4 as the default media. Enable duplex printing only when the model supports it, then print a test page. The queue name becomes the destination used by lp and appears in print dialogues, so avoid model numbers that would be confusing on a shared system.

For a driverless IPP printer, an administrator can create a queue from the terminal:

lpadmin -p Office -E -v ipp://192.168.1.60/ipp/print -m everywhere
lpadmin -p Office -d
lpoptions -p Office -o media=A4 -o sides=one-sided

The URI must match the printer's advertised path; not every device uses /ipp/print. Use lpstat -v to view the discovered URI and lpstat -p -d to confirm the queues and default printer.

Share the server across the LAN

By default, CUPS is cautious about remote access. Edit /etc/cups/cupsd.conf, retain the existing loopback listener, and add the server's LAN address at global scope, outside any <Location> block:

Listen 192.168.1.50:631
Browsing On
BrowseLocalOptions On

In both the <Location /> and <Location /admin> blocks, retain Allow localhost and add Allow 192.168.1.0/24. Replace that range with the actual home or office subnet. Restart CUPS with sudo systemctl restart cups, then visit http://SERVER_IP:631 from another computer and sign in with a user in the lpadmin group.

If UFW is active, permit only the trusted subnet to reach the printing port:

sudo ufw allow from 192.168.1.0/24 to any port 631 proto tcp
sudo ufw allow from 192.168.1.0/24 to any port 631 proto udp

Automatic discovery uses mDNS. Install avahi-daemon and cups-browsed on the server and on clients that should browse for printers. If a router filters mDNS, add the printer by IP instead of weakening the firewall. Keep the temporary HTTP connection on a trusted LAN until TLS is enabled.

Connect Ubuntu, Windows, and macOS

On Ubuntu 24.04, open Settings and select Printers from the System panel, then choose Add Printer. Choose the network option, enter the CUPS server address, select the shared queue, and apply it as the default if required. The GNOME print dialogue will then include the queue in its printer list. The lpstat -p -d command remains useful for checking the server-side result.

On Windows 10 or 11, open Bluetooth and devices, then Printers and scanners and choose Add device. If the printer is not advertised, add it manually with the server's IP address and let Windows use its IPP class driver. A self-signed server certificate may produce a warning, so install the certificate as trusted on managed clients or use one issued by the organisation's certificate authority.

On macOS, open System Settings, select Printers and scanners, and add the server or queue by address. Choose the IPP or generic PostScript driver when macOS cannot identify the model. Phones and tablets can print through AirPrint on iOS or the manufacturer's Android print service, provided they use the same non-isolated network.

Handle AirPrint, scanners, and legacy sharing

A printer with native AirPrint support can be added directly by an iPhone or Mac, which is convenient for occasional users. For centrally managed jobs, create the equivalent IPP queue in CUPS and expose it through the server. The server then supplies one A4 default, shared duplex settings, and a consistent queue name throughout the office.

Printing and scanning are separate services. CUPS does not automatically publish the scanner function of a multifunction device. Use the manufacturer's Linux scanner package, scanner.linux, or a dedicated SANE network daemon when several people need to scan. Review access carefully because saved scans can contain personal or commercial information.

Old Windows installations that cannot add an IPP queue can use Samba as a compatibility bridge. Create a restricted group and Samba account, replacing alice with an existing Linux username:

sudo apt install samba
sudo groupadd -f printusers
sudo usermod -aG printusers alice
sudo smbpasswd -a alice

Add a [printers] share to /etc/samba/smb.conf:

[printers]
comment = Legacy CUPS queues
path = /var/spool/cups
browseable = no
read only = no
guest ok = no
create mask = 0700
valid users = @printusers

Windows can then map a queue such as \\SERVER\Office using a vendor driver. Keep guest access disabled and use Samba only for legacy clients. Modern Windows, macOS, and Ubuntu systems should stay with IPP because it needs fewer drivers and exposes fewer administrative controls.

Secure, test, and maintain the finished server

CUPS can encrypt printer traffic with a trusted certificate. On Ubuntu 24.04, run sudo cupsctl --enable-tls, install the generated certificate on client devices, and use https://SERVER_IP:631 for administration. Replace the default certificate with one covering the server's DNS name when possible. Keep port 631 restricted to the trusted LAN, apply Ubuntu security updates, and do not expose CUPS directly to the internet.

Test the complete printing path rather than only the administration page:

lpstat -p -d
lpstat -v
lp -d Office /path/to/test.pdf
lpstat -W completed -o

The first command checks queues and the default printer, the second shows printer back ends, the third sends a PDF, and the last lists completed jobs. Repeat the test from each operating system, then inspect /var/log/cups/ for rejected jobs, permission errors, or authentication failures.

In an Australian organisation, queue names, job names, and logs can identify a client or document. Where the Privacy Act 1988 and Australian Privacy Principles apply, retain only necessary records and restrict access to administrative logs. Back up /etc/cups/, document each queue's URI and driver, and record the server address and recovery steps. The practical takeaway is simple: keep a fixed LAN address, A4 defaults, tested IPP queues, narrow firewall rules, and a saved configuration backup; those five checks make the print server dependable after a reboot and straightforward to support.