How to Add a Printer to Your Raspberry Pi (or Other Linux Computer)

how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 1

Unlike a typical Windows machine, the little Raspberry Pi running Rasbian doesn’t exactly come with plug-‘n-play printer support. Read on as we show you how to add full-fledged print capabilities to your Pi unit.

Why Do I Want to Do This?

If you’re experimenting with the Pi as a desktop replacement, want to enable a physical print output for a program or application suite you’re using, or otherwise want to enable traditional printing on your Pi, this tutorial is a straight shot from printerless to happy printing; there’s no previous printer-wrangling under Linux experience required.

RELATED ARTICLEShow-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 2Everything You Need to Know About Getting Started with the Raspberry Pihow-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 3Build an LED Indicator with a Raspberry Pi (for Email, Weather, or Anything)

What Do I Need?

For this tutorial you’ll need the following things:

  • 1 Raspberry Pi unit with Rasbian installed
  • 1 USB-based or network-accessible printer

If you haven’t yet configured your Raspberry Pi with a Rasbian image, we highly suggest starting with our introduction to the Raspberry Pi.

Installing CUPS on the Pi and Enabling Remote Access

In order to link a printer with the Raspberry Pi, we first need to install Common Unix Printing System (CUPS). It’s time to fire up your Pi and navigate to the terminal (either on the Pi itself of via SSH).

At the terminal, enter the following command to begin installing CUPS:

sudo apt-get install cups

When prompted to continue, type Y and press enter. CUPS is a fairly beefy install, so feel free to go grab a cup of coffee. Once the base installation is complete, we need to make a few small administrative changes. The first order of business is to add ourselves to the usergroup that has access to the printers/printer queue. The usergroup created by CUPS is “lpadmin”. The default Rasbian user (and the user we’re logged into) is “pi” (adjust the following command accordingly if you want a different user to have access to the printer).

At the terminal enter the following command:

sudo usermod -a -G lpadmin pi

For the curious, the “-a” switch allows us to add an existing user (pi) to an existing group (lpadmin), specified by the “-G” switch.

Our final bit of pre-configuration work is to enable remote editing of the CUPS configuration. The rest of the configuration can be completed via the web browser on the Pi, but if you’re not actually sitting right at the Pi and would prefer to use, say, the browser on your Windows desktop to complete the configuration, you’ll need to toggle a small value in /etc/cups/cupsd.conf. At the terminal, enter the following command:

sudo nano /etc/cups/cupsd.conf

Inside the file, look for this section:

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

Comment out the “Listen localhost:631” line and replace it with the following:

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

This instructs CUPS to listen for any contact on any networking interface as long as it is directed at port 631.

Scroll further down in the config file until you see the “location” sections. In the block below, we’ve bolded the lines you need to add to the config:

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

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

< Location /admin/conf >
AuthType Default
Require user @SYSTEM

# Restrict access to the configuration files...
Order allow,deny
Allow @local
< /Location >

The addition of the “allow @local” line allows access to CUPS from any computer on your local network. Anytime you make changes to the CUPS configuration file, you’ll need to restart the CUPS server. Do so with the following command:

sudo /etc/init.d/cups restart

After restarting CUPS, you should be able to access the administration panel via any computer on your local network by pointing its web browser at http://[the Pi’s IP or hostname]:631.

Adding a Printer to CUPS

how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 4

When you first navigate to http://[the Pi’s IP or hostname]:631, you’ll see the default CUPS homepage, as seen in the screenshot above. The section we’re interested in is the “Administration” tab. Click on it now.

how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 5

Within the Administration panel, click add printer. If you receive a warning about the site’s security certificate, go ahead and click proceed anyway to ignore it. You’ll be prompted to enter a username and password.

how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 6

Go ahead and enter the username and password of the account you added to the “lpadmin” group earlier in the tutorial (e.g. if you’re using a default Raspbian install, the login/password is “pi”/”raspberry”). Click “Log In”.

After logging in, you’ll be presented with a list of discovered printers (both local and networked). Select the printer you wish to add to the system:

how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 7

After selecting the printer, you’ll be offered an opportunity to edit the name, description, and location of the printer, as well as enable network sharing. Since our printer is already a network printer, we left “Share This Printer” unchecked:

how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 8

After editing the printer name and adding a location, you’ll be prompted to select the specific driver you want to use for your printer. Despite the fact that it automatically discovered the printer and the printer name, CUPS makes no attempt to pick the right driver for you. Scroll until you see a model number that matches yours. Alternatively, if you have a PPD file for the printer that you have downloaded from the manufacturer, you can load that with the “Choose File” button:

how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 9

The last configuration step is to look over some general print settings like what you want the default printer mode to be, the default paper source/size, etc. It should default to the correct presets, but it never hurts to check:

how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 10

After you click “Set Default Options”, you’ll be presented with the default administration page for the printer you just added to the CUPS system:

how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 11

Everything looks good. The real test, however, is actually printing something. Let’s fire up Leafpad, Rasbian’s default text editor, and send a message:

how-to-add-a-printer-to-your-raspberry-pi-or-other-linux-computer photo 12

While we realize it’s a bit premature to write “huge success” on our test print before, you know, it’s actually printed, we were that confident. Fifteen seconds or so later, the document came rolling out of the printer and dropped into the tray. Success!


At this point, if you’ve added the only user that needs access to the printer to the “lpadmin” group and you’ve added the only printer you want to access to the CUPS system, you’re done. If you have any other users you would like to add or additional printers, simply run through the respective steps in the tutorial again to do so.

Article How to Add a Printer to Your Raspberry Pi (or Other Linux Computer) compiled by Original article here

More stories

How to Customize the New Tab Page in Chrome

For most people, the default New Tab Page in Chrome works perfectly well for their purposes. But if you would prefer to choose what opens in a new tab for yourself, then we have some alternative solutions for you.

How to Disable Cortana on the Windows 10 Lock Screen

With the Windows 10 Anniversary Update, Cortana is now enabled by default on your lock screen–assuming you haven’t disabled her entirely. If you’d rather not have Cortana answering questions when your PC is locked, it’s an easy enough feature to disable.

How to Install Extensions in Microsoft Edge

Microsoft Edge finally supports browser extensions thanks to Windows 10’s Anniversary Update. Edge extensions are now available in the Windows Store, although only a few are initially available.

12 of the Biggest PC Myths That Just Won’t Die

Computers are like anything else. Myths and urban legends have built up over time, passed from person to person. Some myths once had a grain of truth, but are no longer true thanks to technological progress.

Forget Chromebooks: Chrome OS is Coming to Windows

Google didn’t announce any shiny new Chromebooks at Google I/O. Instead, they highlighted their two big “platforms” — Chrome and Android. Whether you’re using Windows, Linux, or Mac, Google will be bringing the Chrome OS experience to you.