Printer sharing using CUPS
Introduction to CUPS
CUPS is the standards-based, open source printing system for UNIX Based operating systems. CUPS stands for Common Unix Print System. It serves as the default print server for almost all the linux distributions. It consists of the following components
- Print spooler.
- A filter that converts print data to printer’s format.
- A system that send the data to the printer.
CUPS uses IPP (Internet Printing Protocol) for managing the print queues and jobs.
CUPS can serve the following purposes
- Provide local print system.
- Act as print server.
- Act as network printer
Installation on Server
CUPS is installed in almost all the distributions of Linux by default. In not, it can be installed using the following command for Debian based distribution.
$ sudo apt-get install cups
For a Red-hat based distribution like Fedora and Cent-OS, you can use the following command.
$ yum install cups
If you want to install it from source packages, you can download it from the link http://www.cups.org/software.php
If the driver for the printer connected to the server is already installed, you can proceed to the next step. If the driver is not present in cups, you need to install the printer’s driver manually.
For manual installation of drivers for HP printers you can download the driver from the following link.
For manual installation drivers for EPSON printers, you can download the drivers from the following link.
Configuration on Server
For setting up a print server after CUPS has been installed, You need to use the following steps on the server.
To enable the remote administration of cups using web interface, you need to use the following command:
$ sudo cupsctl --remote-admin
You can now use the browser from a remote machine to configure cups through web interface. The link can be accessed using the url http://<ip-address>:631.
Finding the link you need to use for configuring the printer in other operating systems:
You can goto the url http://<ip-address>:631 in a remote machine. Goto Administration in the web page and click Manage printers. It will be showing the printers as links. Right click on the relevant link and click copy link location and note down the URL, because it is needed while configuring this printer in clients.
Configuring Samba to share CUPS printers
To share CUPS printer using Samba, edit the file /etc/samba/smb.conf and add the following lines.
printing = cups
printcap = cups
Configuring a Linux desktop client
- Goto Gnome menu-> System-> Administration-> Printing. A window will open.
- Click on ‘New’, A window will open
- At the ‘Device url’ you can paste the URL that is already noted down.
- Now it ask for driver installation.
- You can install appropriate driver and you can now try printing from the Ubuntu machine
Configuring a Windows client
- Goto start menu -> Printers and faxes -> Add a printer
- Select “A network printer, or a printer attached to another computer” and click next
- Select “Connect to a printer on the Internet or on a home or office network”
- Enter the URL you have noted down in the windows system and click next
- It will be showing a window to install the drivers either by selecting in the list or from a disk (you can choose your option)
- After installing the drivers you can select between setting this printer as default or not
- Click finish