Adding a Printer to CUPS

Turn on your USB printer now; Otherwise CUPS won't recognize it and you'll be in for plenty of headaches. In this sequence we will copy the example file to our regular one (we don't need to edit it though) and then restart CUPS:

/usr/local/etc/rc.d/cupsd restart

CUPS uses a web based administration interface. So open up your browser and enter the URL http://localhost:631/.

Now click on Administration.

A dialogue will pop up prompting you for your User Name and Password. Enter root as your User Name and your root password for Password. You probably don't want to have Firefox remember this information for security reasons.

Click on Add Printer.

Type in the name you want your printer to show up as under Name. Note that you cannot use spaces in the name. I named my HP DeskJet 940c something descriptive: DeskJet940c. The other two fields are optional if you want to provide additional information about your printer. When you're finished with this step, click Continue.

Choose your printer device from the drop-down menu. For most of us this will be USB Printer #1.

Next choose your printer maker. In my case, this would be HP. Note that instead of doing this you could also Browse for a .ppd file. You might do this if your printer manufacturer was nice enough to provide a CUPS driver for your printer.

You might need to do some research at www.linuxprinting.org to see what drivers are compatible with your printer model. In my case, the HP DeskJet 900 series driver works for the HP DeskJet 940c.

A confirmation message appears telling us that our printer has been added. A few seconds later, we'll be taken to this next screen:

This screen allows us to set some options for our printer. One important option to note is Media Size, i.e. what size paper you're using. Note that my default is Letter. If I were somewhere other than the US, I'd probably want to change that to A4. You can also set things like whether you want to print in color or in grayscale, the printing resolution, etc.

When you're done messing around with your printer options, click on the Printers tab near the top of the CUPS web interface.

This will bring up a list of our installed printers (and shared printers connected to other computers on our LAN). Find the printer we just added, then click on Print Test Page. If all goes well, you should see this:

Now that we have a fully functional printer there is just one thing to note. Many programs will be able to use your printer correctly. However, some such as xpdf will ask for a printing command. It is lpr. When in doubt, you can try the default of the program, and if it doesn't work, you can use lpr.