How To: Using Your Raspberry Pi as a CUPS Print Server

Yes!  I did it!  I finally found a use for my Raspberry Pi!  All joking aside, I found it cumbersome to always have the laptop on so I can print to my shared printer over an existing CUPS configuration.  Enter: Mr. Raspberry Pi.  Read on for the helpful steps on setting this all up, step by step.  Be sure to check out the resources listed at the bottom of the article.

Recommended Items:

  • Power suppy
  • Keyboard (wired)
  • Mouse (wired)
  • USB Wireless module (optional)
  • SD Card (preferably class 10 and at least 4GB in size)
  • You can buy kits for the Raspberry Pi by searching “Raspberry Pi” on Amazon or any popular e-commerce site

Installing Raspbian

First, you will want to install Raspbian to an SD card for use in this project.  Why Raspbian and not any other?  I personally find it the most stable out of the images out there, and has been a staple of the Rasperry Pi community for quite some time.  Download the latest NOOBS zip file from  Make sure you have a common brand SD card laying around, preferably at least 4 GB in size, and a class 10 card (although a class 4 will do the trick).  Pop that sucker into an available computer.

Now you will want to fire up gparted and select the card you inserted into your computer.  The picture below is for graphical reference only.  Delete any “slices” or partitions on the card.  Select the large chunk you are left with and create one FAT32 partition, labeled “raspbian.”  Apply all the changes and exit.


Installing Raspbian

The next thing up is to open up your file manager.  Find the zip file you saved earlier and unzip its contents into a fresh folder.  With the contents at hand, copy all of them onto the SD card we were working with earlier.  Connect up all the necessary cables and SD card to the Raspberry pi, and power it on.  Give the process some time to boot up and you will see the OS Installation box.  Select “Raspbian,” and follow through the prompts until installed.

You will be presented with an initial configuration screen.  Of note here are two options.  First, select the option to expand the storage space to the rest of the SD card so we can use all that is on the card.  Second, select the startup selection option to “Enable boot to desktop” and ensure the Pi will boot to the main GUI screen, rather than a text based shell prompt.  Confirm with OK, and reboot.


We have a desktop!  Very simple, right? 🙂  Fire up the LX Terminal application and enter ‘ifconfig’ to check out your ip address.  We will want to hard code this into the Pi, in case the Pi is rebooted so we have the same IP Address.  Below is some sample output:

enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
inet  netmask  broadcast
inet6 fe80::52e5:49ff:fec9:6829  prefixlen 64  scopeid 0x20<link>
ether 50:e5:49:c9:68:29  txqueuelen 1000  (Ethernet)
RX packets 774830  bytes 506344298 (482.8 MiB)
RX errors 0  dropped 26  overruns 0  frame 0
TX packets 1086278  bytes 168086586 (160.2 MiB)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Great, now let’s set the static address.  Enter ‘sudo su’ to gain administrative privileges.  Now enter ‘nano /etc/network/interfaces’.  You will see a line that looks as such:

iface eth0 inet dhcp

Replace that line with the following format, including your IP Address we looked up earlier with ‘ifconfig’  We will be commenting out the line I just showed you:

#iface default inet dhcpiface eth0 inet static

With that in place, reboot your Raspberry Pi with ‘reboot’.  Once back at the desktop, we will configure the Pi for CUPS Print Administration.

Configuring Your Pi As The Print Server

Now, connect your printer via USB.  It is optional, but helps to install ‘xrdp’ with the command ‘apt-get install xrdp’ to configure things with the RDP protocol from another computer at this point.  Once the printer is connected, we can begin.  Let’s update the system first.  From LX Terminal, type:

sudo su
aptitude update
aptitude install avahi-daemon cups cups-pdf python-cups

This will update your package list, and install the packages we need.  The avahi-daemon is a free zeroconf implementation (open source Bonjour replacement).  CUPS stands for “Common Unix Printing System,” which manages the printers for you.  Next, edit “/etc/cups/cupsd.conf”  Comment out the line just below “# Only listen for connections from the local machine.” with an #, and add the new “Allow @Local” lines, like this :

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

Port 631

# Restrict access to the server...
<Location />
Order allow,deny
Allow @Local

# Restrict access to the admin pages...
<Location /admin>
Order allow,deny
Allow @Local

# Restrict access to configuration files...
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow @Local

This will allow access to the CUPS web interface from other machines than your Raspberry Pi itself (on the local network)..  You can change the port from the default 631 to something else if you wish, but I recommend staying with the default.  Next, we will restart the cups service and add our “pi” user to the lpadmin group.  We need that user part of that group to perform administration tasks.

service cups restart
adduser pi lpadmin

Enough of that Terminal stuff right?  We can now open up the Midori browser from the Pi and add the printer.  Head on over to , or the IP Address you set.  The browser may warn you that the site is unsafe, and an exception needs made, which is perfectly normal.   After connecting, you will see the following page:



After this, we will need to add printer.  Click on the Administration Tab, and check “Share printers connected to this system”. Click on “Change Settings”.  Allow the CUPS Server to restart.  Next, click “Add Printer.”  The next screen will let you pick your printer connected via USB:

In the above example, we would pick the “HP Deskjet F4100 series ISB CN74B2S3PT04TJHPLIP (HP deskjet F4100 series)” entry.  After you add your printer, you will have the option to share it, as well as pick the printer driver (example below):


You should see the same series driver within the list after picking your manufacture, in this case HP.  After this , under the printer’s administration page, you can print a test page.


When successful, move on to the next step.

Adding Your Printer From Another Computer

So we have the print server up and running, but how do we add this networked printer to our laptop?  Next, open up the trusty, commonly found ‘system-config-printer’ program found on most distributions.  If it is not installed, make sure it is installed beforehand.   Your distribution may include another utility, but for common purposes, we are using the most widely known GUI configuration utility.   The main window looks as such:

5Click the Add button expand the Network Printer option.  Click on Find Network printer.  Enter your Raspberry Pi’s hostname (on your Pi, the command “hostname” will show you what you need), which is typically “raspberrypi” by default.  Click Find, and your shared Pi printer should show up.  Continue on, adding the device driver as before, as well as printing your test page.


Also, through this application, you can set your various default printer options, which also depend on which driver you are using.  For now, apply the changes and exit.

Questions or comments?  I’ll be more than happy to help. Please see the source link below if you need to add your printer to a Windows machine.


Raspberry Pi Quick Start Guide
Raspbian Download Page
How to setup xrdp for remote viewing your Raspberry Pi
Setting a static IP Address
CUPS Administration Guide
CUPS Administrative Guide for Fedora/RHEL Users



About professorkaos64

Posted on 20131201, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s