Networked printing infrastructure using CUPS on Debian

This article was first written in August 2005 for the BeezNest technical
website (http://glasnost.beeznest.org/articles/286).
In a networked infrastructure, with many workstations needing to print (or generate PDF or PS files, or send faxes), CUPS may help a lot, especially with its automatic network-browsing features. Let's see how to set that up.

CUPS Server

First, you probably want to setup a server to share printers. Those printers may be networked themselves (ie embed a print server or be connected to an external one) or local (parallel, USB or serial) to the server. The print server types that CUPS may use to access its printers are:
  • lpd/lpr
  • IPP
  • SMB/CiFS
  • AppSocket/HP JetDirect
You only need to install CUPS server and printers' definitions in the form of PPD files (which may in turn require some tools to work correctly). Configure the CUPS server to allow browsing in both directions (be careful how you do it though, as it may represent a security risk).

CUPS clients

The CUPS clients, if they don't need to share printers themselves, do not need to host a full-blown CUPS server, but only use libraries and/or client utilities (like lpr and/or lp). To tell the CUPS library to use a remote CUPS server, it suffice to fulfill the CUPS_SERVER environment variable of the machine or the user's profile.

Light print server

If you only need to give access to a local printer on a workstation, maybe a better idea would be to avoid running a full CUPS server on it, and run a light print server simulating an HP JetDirect server. You would avoid at the same time having to install all it's dependencies, which are numerous and may eat a lot of disk space. Hopefully, p910nd exists just for that. It takes almost no memory and is usable from inetd (to load it into memory only when needed) or as daemon. You would lose the auto-detection, but it is not a huge work to create once the printer on the central CUPS server.