Set Up a Printer and Scanner on Linux
Set up printing and scanning on Linux using CUPS, IPP Everywhere driverless printing, and SANE with network/eSCL scanner support across Ubuntu, Fedora, and Arch.
Before you start
- ▸A printer or scanner connected via USB or reachable on the local network
- ▸sudo / administrative access on the Linux system
- ▸cups-browsed available in your distro's repositories (standard for all listed distros)
Linux printing and scanning have improved dramatically. Most modern printers speak IPP Everywhere (driverless printing), meaning CUPS can configure them with zero extra packages. Scanners use SANE (Scanner Access Now Easy), which covers USB and network devices. This guide walks through both, from installing CUPS to verifying a network scan, with cross-distro commands throughout.
Install and Enable CUPS
CUPS is the standard print server on every major desktop Linux distro. On many systems it is already installed; verify before adding packages.
Debian / Ubuntu
sudo apt update
sudo apt install cups cups-browsed
Fedora / RHEL / Rocky
sudo dnf install cups cups-browsed
Arch Linux
sudo pacman -S cups cups-browsed
Once installed, enable and start the CUPS daemon with systemd:
sudo systemctl enable --now cups
sudo systemctl enable --now cups-browsed
cups-browsed handles automatic discovery of network printers via DNS-SD/mDNS. If your printer is on the local network, it will usually appear in the CUPS web UI and your desktop print dialog within seconds.
Add Your User to the lpadmin Group
Without group membership, non-root users cannot manage printers through the web UI or command line.
sudo usermod -aG lpadmin $USER
Log out and back in (or run newgrp lpadmin in the current shell) for the change to take effect.
Use the CUPS Web Interface
CUPS ships a built-in web UI at http://localhost:631. Open it in any browser. The main tabs are Home, Administration, Classes, Jobs, and Printers.
Add a Network Printer (IPP Everywhere / Driverless)
- Go to Administration → Add Printer. You will be prompted for your Linux username and password.
- Under Discovered Network Printers, your printer should appear listed as IPP Everywhere or driverless. Select it.
- Give it a name (no spaces), a description, and a location. Click Continue.
- CUPS will auto-select the IPP Everywhere or driverless model—accept it and click Add Printer.
- Set default options (paper size, colour mode) on the next screen and click Set Default Options.
If the printer does not appear automatically, choose Internet Printing Protocol (ipp) or AppSocket/HP JetDirect from the manual list and enter the printer's IP address in the form ipp://192.168.1.50/ipp/print.
Add a USB Printer
Plug in the printer. It will appear under Local Printers in the Add Printer wizard. Most USB printers also support driverless IPP; select that model when offered. If not, CUPS will suggest a PPD from its database or from the foomatic collection.
Manufacturer Drivers (When You Need Them)
Older HP printers work best with hplip. Canon and Epson ship proprietary PPD packages from their websites. Only install these if driverless printing produces incorrect output.
# HP printers (Debian/Ubuntu)
sudo apt install hplip
# HP printers (Fedora)
sudo dnf install hplip
# HP printers (Arch)
sudo pacman -S hplip
After installing hplip, run hp-setup as your regular user to configure the device.
Verify Printing from the Command Line
List available printers, then send a test page:
lpstat -p -d
Output will show printer names and which is the default—it varies by setup. Then:
lp -d PrinterName /usr/share/cups/data/testprint
Replace PrinterName with the name you assigned. A job ID is returned; track it with lpstat -W completed.
Install and Configure SANE for Scanning
SANE provides the backend drivers. sane-utils gives you the scanimage command-line tool. For a GUI, Simple Scan (GNOME) or Skanlite (KDE) sit on top of SANE.
Debian / Ubuntu
sudo apt install sane-utils libsane-extras simple-scan
Fedora / RHEL / Rocky
sudo dnf install sane-backends sane-backends-drivers-scanners simple-scan
Arch Linux
sudo pacman -S sane simple-scan
Add Your User to the scanner Group
sudo usermod -aG scanner $USER
On some distros the group is called lp instead. Check with grep -i scan /etc/group.
Detect Devices
scanimage -L
A detected USB or network scanner appears as a device string like device `hpaio:/usb/OfficeJet' is a HP OfficeJet flatbed scanner. If nothing appears, see Troubleshooting below.
Network Scanners
Network-attached scanners (those connected to a router or accessed over LAN) need an extra step. SANE's net backend lets a client machine reach a scanner shared by a server, or you can use the airscan backend for modern eSCL/WSD devices.
eSCL / AirScan (Most Modern Printers)
Install the sane-airscan backend—it supports Apple AirScan (eSCL) and WSD, used by most current multi-function printers:
# Debian/Ubuntu
sudo apt install sane-airscan
# Fedora
sudo dnf install sane-airscan
# Arch
sudo pacman -S sane-airscan
No configuration is required. Run scanimage -L again; the printer's scanner will appear. Simple Scan and Skanlite also pick it up automatically.
SANE Network Backend (Older Setups)
If the scanner is shared via a SANE server on another Linux box, edit /etc/sane.d/net.conf on the client and add the server's IP:
echo "192.168.1.20" | sudo tee -a /etc/sane.d/net.conf
On the server, add the client IP to /etc/sane.d/saned.conf and enable the saned socket:
sudo systemctl enable --now saned.socket
Verify Scanning from the Command Line
scanimage --device="" --format=png --output-file=test-scan.png
Open test-scan.png to confirm the image. Omit --device if only one scanner is present; SANE uses the first found.
Firewall Considerations
For network printing and scanning, mDNS (port 5353/UDP) must be allowed. Most desktop firewall profiles permit this by default. If you use firewalld:
sudo firewall-cmd --add-service=mdns --permanent
sudo firewall-cmd --reload
For ufw:
sudo ufw allow 5353/udp
Troubleshooting
Printer Not Discovered Automatically
- Confirm
cups-browsedis running:systemctl status cups-browsed. - Check that printer and PC are on the same subnet—VLANs block mDNS.
- Ping the printer's IP, then try adding it manually via the CUPS web UI using an explicit
ipp://URI.
Jobs Stuck in Queue
- Check
sudo journalctl -u cups -n 50for errors. - Cancel stuck jobs:
cancel -a PrinterName. - Restart CUPS:
sudo systemctl restart cups.
Scanner Not Found by scanimage -L
- Unplug and replug the USB cable; run
lsusbto confirm the device appears. - Verify group membership:
groups $USERshould listscannerorlp. - Check whether a firmware upload is needed: some scanners (Epson, Canon) require
iscanor proprietary packages from the manufacturer's Linux download page. - For network scanners, confirm
sane-airscanis installed and that no firewall blocks port 8612/UDP (WSD) or 9100/TCP.
Poor Print Quality with Driverless Printing
Some printers render better with a manufacturer PPD. Install the vendor package, then in the CUPS web UI go to Printers → Modify Printer and switch the model to the vendor-specific one.
Frequently asked questions
- Do I need to install proprietary drivers for my printer?
- Most printers made in the last five years support IPP Everywhere and work without any extra drivers. Older HP models benefit from hplip; Canon and Epson sometimes need manufacturer PPD packages for full functionality.
- Why does my network printer disappear from the print dialog after a while?
- This usually means cups-browsed stopped running or mDNS traffic is blocked. Check systemctl status cups-browsed and ensure UDP port 5353 is allowed in your firewall.
- My scanner is part of an all-in-one printer. Why isn't it detected?
- Install sane-airscan for eSCL/WSD network scanning, or confirm USB group membership (scanner or lp). Run scanimage -L after each fix. Some Canon and Epson models need proprietary iscan or scangearmp2 packages.
- Can I share a USB printer on my network through Linux?
- Yes. CUPS can share any local printer over IPP. In the CUPS web UI go to Administration → Sharing and tick 'Share printers connected to this system', then ensure your firewall allows TCP port 631 from your LAN.
- The CUPS web UI asks for a username and password. What do I enter?
- Enter your Linux username and password. The account must be in the lpadmin group. Root credentials also work, but using a regular lpadmin account is safer.
Related guides
Linux Clipboards Explained (+ Clipboard Managers)
Learn the difference between Linux's PRIMARY and CLIPBOARD selections, use xclip, xsel, and wl-clipboard from the terminal, and manage history with GPaste or Klipper.
Configure LibreOffice for Daily Use
Configure LibreOffice for daily use: set default save formats for MS Office interop, tune autosave, install fonts, and add productivity extensions.
Configure the Touchpad and Multitouch Gestures
Configure Linux touchpad behavior and multitouch gestures using libinput, libinput-gestures, and native GNOME and KDE Plasma settings on both Wayland and X11.
Wayland vs X11: How to Choose and Configure Each
Know when to run Wayland or X11, how to check your current session, switch at login with GDM/SDDM/LightDM, and handle NVIDIA and XWayland edge cases.