CUPS Refresher

I previously made a post about setting up CUPS on a Ubuntu Server. I decided to make a quick refresher here so anyone looking for it would not have to hunt through the walkthrough to find out how to setup CUPS.

Lets just get right down to it. There are a number of packages you may want to install. Their package names are all pretty self-explanatory. Drivers are drivers, pdf is a pdf print driver, etc.

apt-get update
apt-get install cups cups-core-drivers cups-driver-gutenprint cups-pdf

If you happen to have an HP printer, there is a good source for all their drivers here.

If you’re really feeling daring, you could always install all the cups packages available, but for 99% of us out there, this is vast overkill.

apt-get install cups*

Before you start, backup the configuration file.

cp -v /etc/cups/cupsd.conf{,.orig}

The first thing to edit is the line that specifies the address the server listens on. This should be, preferably, the static ip address of your server ( in this case).

# Original lines:
# Only listen for connections from the local machine.
Listen localhost:631
# New lines:
# Only listen for connections from the local machine.
Listen localhost:631

Next up, allow access to the server and admin pages, and configuration pages, which makes configuring, maintaining, and administering the CUPS server vastly easier.

# Original lines
# Restrict access to the server pages...
<Location /admin>
 Order allow,deny
# New lines:
# Restrict access to the server / admin / configuration pages...
<Location /admin>

# The following line allows access from the local subnet only (i.e. the /24 octet)
Allow from

# The following line allows access from everywhere (not recommended unless you need it for testing or something)
Allow all

# The following line allows access only from the localhost
Allow localhost

 Order allow,deny

Save your changes and restart the server

service cups start|stop|restart|status
/etc/init.d/cups start|stop|restart|status

The last step before you can start setting up your printers is to add the admin user (whoever you want that to be) to the group lpadmin.

usermod -aG lpadmin username

You can now access the web admin pages.

If you allowed access only to localhost, you’ll need to be on the server itself and then access it via:

If you allowed access from the local subnet, you can be on any computer on the subnet and then access it via:

From there, go to the Administration tab and start adding your printers. The web interface is nice and easy to use, just read what is on the screen and click the applicable options. Easy isn’t it!

Tagged , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.

Protected by WP Anti Spam