CUPS is the standards-based, open source printing system developed by Apple Inc. for OS X® and other UNIX®-like operating systems.
- 1 Installation
- 2 Configuration
- 3 Usage
- 4 Troubleshooting
- 5 See also
Install the , , and packages.
If the system is connected to a networked printer using the Samba protocol, or if the system is to be a print server for Windows clients, also install the package.
If you intend to "print" into a PDF document, also install the
/var/spool/cups-pdf/$USER. The location can be changed in
Start and enable
org.cups.cupsd.service. Optionally, CUPS can use Avahi browsing to discover unknown shared printers in your network. This can be useful in large setups where the server is unknown. To use this feature, start
Before CUPS can attempt to use a printer, it must be able to detect the printer. Additional steps for printer detection are listed below for various connection interfaces.
To see if your USB printer is detected:
(...) Bus 001 Device 007: ID 03f0:1004 Hewlett-Packard DeskJet 970c/970cse
To use a parallel port printer, the
parport_pc kernel modules are required.
dmesg | grep -i print
parport0: Printer, Hewlett-Packard HP LaserJet 2100 Series lp0: using parport0 (polling)
If you are using a USB to parallel port adapter, add the printer using a different connection type and then change DeviceID in
DeviceID = parallel:/dev/usb/lp0
Newer versions of CUPS tend to be good at detecting printers, and tend to pick the right hostname, but unless you have added the printer to your /etc/hosts, CUPS will fail to resolve for normal printer activities. Unless you want to make your printer ip static, Avahi can help autoresolve your printer hostname. Set up Avahi and .local hostname resolution then restart CUPS by restarting the
org.cups.cupsd.service systemd unit.
You can use
avahi-discover find the name of your printer and its address (ex. Address: BRN30055C6B4C7A.local/10.10.0.155:631) or just add .local to the hostname CUPS was using (ex. BRN30055C6B4C7A.local). Double check that everything is working with ping:
should work, if it doesn't go back and make sure that Avahi is running and that you have the right hostname. After this, make sure that the hostname in the CUPS web interface is the .local hostname.
The drivers for a printer may come from any of the sources shown below. See CUPS/Printer-specific problems for a non-comprehensive list of drivers that others have gotten to work.
Usually CUPS requires either a prebuilt PPD file including the driver or some XML data files + a PPD file generating engine to work. Even when a PPD file is provided to CUPS, the CUPS server will install its own regenerated PPD file into
- CUPS Native Drivers
CUPS already includes a few printer drivers. In that case you can just select it in the list and your printer will likely work.
+ or are database-driven systems for integrating software printer drivers with common spoolers under Unix.
or provide prebuilt PPD files from manufacturers.
The, , drivers are high-quality, open source printer drivers for various Canon, Epson, HP, Lexmark, Sony, Olympus and PCL printers supporting CUPS. They also support ghostscript, The GIMP, and other applications.
There might be a PPD available at the OpenPrinting Printer List. Usually these driver files are included in the above foomatic packages. But searching for your printer model might help you decide which driver to chose from the list.
Select the brand and type/model of the printer to find out what driver the site recommends. Download the PPD file from the site. When the CUPS web interface asks for a printer driver/PPD, select "Or Provide a PPD File: Choose file".
The website will also suggest a driver. For instance, for the HP LaserJet 5P, the site recommends the
ljet4 driver. It is possible that this driver is already included with CUPS, otherwise you will need to install it through another source listed in this section.
- Manufacturer-specific drivers
Many printer manufacturers supply their own Linux drivers. These are often available in the official Arch repositories or in the AUR.
The CUPS server configuration located in
/etc/cups/cupsd.conf. After editing, restart
org.cups.cupsd.service to apply any changes. The default configuration is sufficient for most users.
Groups with printer administration privileges are defined in
SystemGroup in the
sys group is used by default.
To have the printer installed on the system, fire up a browser and point it to http://localhost:631. The CUPS web interface should be displayed from which all administrative tasks can be performed.
Go to Administration and enter the root login and password information your GNU/Linux system. Then, when the administrative interface has been reached, click on Add Printer. A new screen will be displayed allowing the following information to be entered:
- The spooler name, a short but descriptive name used on the system to identify the printer. This name should not contain spaces or any special characters. For instance, for the HP LaserJet 5P could be titled
- The location, a description where the printer is physically located (for instance "bedroom", or "in the kitchen right next to the dish washer", etc.). This is to aid in maintaining several printers.
- The description should contain a full description of the printer. A common use is the full printer name (like "HP LaserJet 5P").
The next screen requests the device the printer listens to. The choice of several devices will be presented. The next table covers a few possible devices, but the list is not exhaustive.
|AppSocket/HP JetDirect||This special device allows for network printers to be accessible through a HP JetDirect socket. Only specific printers include support for this option.|
|Internet Printing Protocol (IPP or HTTP)||Used reach the remote printer through the IPP protocol either directly (IPP) or through HTTP.|
|LPD/LPR Host or Printer||Select this option if the printer is remote and attached to a LPD/LPR server.|
|Parallel Port #1||Select when the printer is locally attached to a parallel port (LPT). When the printer is automatically detected its name will be appended to the device.|
|USB Printer #1||Select when the printer is locally attached to a USB port. The printer name should automatically be appended to the device name.|
If installing a remote printer, the URL to the printer will be queried:
- An LPD printer server requires a
- An HP JetDirect printer requires a
- An IPP printer requires a
On the next screen, you can select the printer manufacturer along with the model type and number. Remember that you need to have downloaded/installed the correct printer driver in order to see your printer type among the others in the list. See the previous section on "Printer Drivers" to do this.
Once the driver is selected, CUPS will inform that the printer has been added successfully to the system. Navigate to the printer management page on the administration interface and select Configure Printer to change the printer's settings (resolution, page format, ...).
Local CUPS server
Remote print servers can be accessed by adding an IPP "printer" to the local CUPS server, with a URI of
See CUPS/Printer sharing#Between GNU/Linux systems for details on setting up the remote print server.
Without a local CUPS server
Install. To print from some applications, you will also need to install .
There are currently two methods for accessing a remote print server.
The first method involves setting
CUPS_SERVER for each application, for instance for Firefox:
# (Substitute printserver.mydomain with your print server name) CUPS_SERVER=printserver.mydomain:port firefox
The second method involves editing
/etc/cups/client.conf and setting the
# (Substitute printserver.mydomain with your print server name) ServerName printserver.mydomain
The remote system's default printer setting will be used by default.
See CUPS/Printer sharing.
Once the server is set up as described in CUPS/Printer sharing#Between GNU/Linux systems, it can also be configured so that it can be remotely administered. If this is needed, then access to the CUPS administration will need to be granted from more systems than the localhost. Add the allowed hosts to the
<Location /admin> block in
/etc/cups/cupsd.conf, using the same syntax as described in CUPS/Printer sharing#Manual setup. Note that three levels of access can be granted:
<Location /> #access to the server <Location /admin> #access to the admin pages <Location /admin/conf> #access to configuration files
To give remote hosts access to one of these levels, add an
Allow statement to that level's section. An
Allow statement can take one or more of the forms listed below:
Allow from all Allow from host.domain.com Allow from *.domain.com Allow from ip-address Allow from ip-address/netmask Allow from @LOCAL
Deny statements can also be used. For example, if wanting to give full access to all hosts on your local network interfaces, file
/etc/cups/cupsd.conf would include this:
# Restrict access to the server... # By default only localhost connections are possible <Location /> Order allow,deny Allow from @LOCAL </Location> # Restrict access to the admin pages... <Location /admin> Order allow,deny Allow from @LOCAL </Location> # Restrict access to configuration files... <Location /admin/conf> AuthType Basic Require user @SYSTEM Order allow,deny Allow from @LOCAL </Location>
You might also need to add:
This should avoid the error: 426 - Upgrade Required when using the CUPS web interface from a remote machine.
Test the printer
To verify if the printer is working correctly, go to the printer administration page, select the printer and click on Print Test Page.
If the printer does not work, see CUPS/Troubleshooting.
CUPS can be fully controlled using the lp* and cups* command-line tools. Alternatively, several GUI applications exist.
See CUPS local documentation for more tips on the command-line tools.
- List the devices
# lpinfo -v
- List the drivers
# lpinfo -m
- Add a new printer
# lpadmin -p printer_name -E -v device -P ppd
The printer_name is up to you. The device can be retrieved from the 'lpinfo -v' command. Example:
# lpadmin -p HP_DESKJET_940C -E -v "usb://HP/DESKJET%20940C?serial=CN16E6C364BH" -P /usr/share/ppd/HP/hp-deskjet_940c.ppd.gz
- Make the printer use the raw driver
# lpadmin -p printer_name -m raw
- Set the default printer
$ lpoptions -d printer_name
- Check the status
$ lpstat -s $ lpstat -p printer_name
- Deactivate a printer
# cupsdisable printer_name
- Activate a printer
# cupsenable printer_name
- Remove a printer
First set it to reject all incoming entries:
# cupsreject printer_name
Then disable it.
# cupsdisable printer_name
Finally remove it.
# lpadmin -x printer_name
- Print a file
$ lpr file $ lpr -# 17 file # print the file 17 times $ echo "Hello, world!" | lpr -p # print the result of a command. The -p switch adds a header.
- Check the printing queue
$ lpq $ lpq -a # on all printers
- Clear the printing queue
# lprm # remove last entry only # lprm - # remove all entries
If your user does not have sufficient privileges to administer CUPS, the applications will request the root passwords when they start. To give users administrative privileges without needing root access, see #Configuration.
- print-manager — A tool for managing print jobs and printers (KDE).
- system-config-printer — A CUPS printer configuration tool and status applet (GNOME and others)
- gtklp — GTK+ interface to CUPS.