How to configure & take print on Linux?
Tags: linux, linuxforbeginners, printer, cups
Published: 2022-11-17 07:32:09


![4 Simple Steps to take print on your Linux (Ubuntu) machine](https://cdn-images-1.medium.com/max/2160/1*j0MOlKHlJNvJ4rOfHLPbdg.png)

Modern printers manufactured nowadays comes with a compact disk (CD) to install the driver. But, most vendors provide support only for Windows machines. This means, the driver that comes with CD can be installed only on Windows machine.

In this article, let’s explore an easy way to configure a printer on your Linux machine and take a quick print out.

Before getting into the configuration steps, let’s understand about CUPS API.

## CUPS API

CUPS stands for **Common Unix Printing System**

From Source ([https://github.com/apple/cups](https://github.com/apple/cups))
>  CUPS is a standards-based, open source printing system developed by Apple Inc. for macOS® and other UNIX®-like operating systems. CUPS uses the Internet Printing Protocol (“IPP”) and provides System V and Berkeley command-line interfaces, a web interface, and a C API to manage printers and print jobs. It supports printing to both local (parallel, serial, USB) and networked printers, and printers can be shared from one computer to another, even over the Internet!

CUPS was originally developed by **Michael R Sweet** at **Easy Software Products** starting in **1997**, with the first beta release on **May 14, 1999**. **Apple** licensed CUPS for macOS in **2002**, and in **February 2007 Apple purchased CUPS and hired Michael** to continue its development as an open source project.

In December 2019, Michael left Apple to start [Lakeside Robotics](https://www.lakesiderobotics.ca). In September 2020 he teamed up with the OpenPrinting developers to fork Apple CUPS to continue its development. Today [Apple CUPS](https://github.com/apple/cups) is the version of CUPS that is provided with macOS® and iOS® while [OpenPrinting CUPS](https://github.com/OpenPrinting/cups) is the version of CUPS being further developed by OpenPrinting for all operating systems.

So, CUPS was adopted by more than 99% of the modern printers. Almost all the printers released now supports CUPS API.

We need to install CUPS in our Linux machine. Let’s explore the 4 step process to setup and take print out.
>  Before proceeding, ensure you turned on your printer and connect it with your computer / laptop via USB

## Configure CUPS on Linux Machine

### Step 1 — Install CUPS

Install CUPS using a simple command from Snap Store

    sudo snap install cups

This command will install the latest stable version of CUPS on your machine

![Install CUPS from Snap Store](https://cdn-images-1.medium.com/max/2000/1*9ZFNVOgE4fRDH8MtsDCTGw.png)

If you’re a debian based user and don’t wish to install CUPS via Snap store, download the latest CUPS release from [https://github.com/apple/cups/releases](https://github.com/apple/cups/releases) (*.tar.gz file) and install on your machine

Navigate to [http://localhost:631/](http://localhost:631/) on your browser to quickly verify your CUPS installtion. This will land you in home page of CUPS.
>  CUPS can be configured and monitored using a web interface, which by default is available at [http://localhost:631/admin](http://localhost:631/admin) . The web interface can be used to perform all printer management tasks.

![CUPS Home Page](https://cdn-images-1.medium.com/max/3832/1*B5Lyl4v3mq82eyuR8TE3AA.png)

### Step 2 — Find Available Printers

Find the available printers by running the following command

    lpstat -p -d

This command will list the available printers connected with your computer both via USB and Network.

![List printers connected with your computer](https://cdn-images-1.medium.com/max/2000/1*MgFvPYSGmI0yvD9nqESbzA.png)

### Step 3 — Setup default Printer

Select the printer you want to set default to and run the following command (In my case it is **HLB2000D**)

    lpoptions -d HLB2000D

This command will set the mentioned printer (**HLB2000D**) as default printer. All your future print requests will be sent to this printer unless you explicitly mention a different printer.

![Set a default printer](https://cdn-images-1.medium.com/max/3810/1*OTSH2SkTS3SKjSaVmLnIEA.png)

All the configuration steps are done. Let’s take a print out

### Step 4 — Take a Print

Navigate to the folder (use cd command) where you have your PDF of Image files via terminal and run the following command to take print.

![](https://cdn-images-1.medium.com/max/3020/1*3Jwautj1lVe1ETZQXFmLFA.png)

    lp sample.pdf

Enter your file name next to lp command to take print of the file. In my case, it’s **sample.pdf **file.

![Command to take print](https://cdn-images-1.medium.com/max/2000/1*hX-ZT9rVq4ody_RFPS_Cqw.png)

My Print job is done and I got the print of my files.

![Print of my file (P. S. Ignore the shadow on the paper)](https://cdn-images-1.medium.com/max/2076/1*CQkU9-uetL0ER5auwJhSiQ.png)

That’s all. Your laptop is configured with the printer. Use the lp command or print button to take print from next time.

Subscribe to our [newsletter](https://5minslearn.gogosoon.com/?ref=devdotto_take_print_on_linux) to receive more such insightful articles that get delivered straight to your inbox.