[HomeLab] Cups, Print Server on Pi

[HomeLab] Cups, Print Server on Pi

September 9, 2024·Vinay Keshava
Vinay Keshava

Cups

CUPS, Common Unix Printing System manages printing services on linux. Cups uses IPP( Internet Printing Protocol) for managing print jobs. Cups also provides web interface, command line interface to manage printer and print jobs.

I wanted to setup a print server at home on a raspberry pi under local network, instead of connecting the usb to my laptop everytime which is annoying. I have a HP Laserjet M1136 Professional Pro printer at home which requires propreitary drivers to be installed on linux,my printer is not listed in openprinting. HP Laserjet M1136 Printer

hplip

hplip, a utility for hp printers to install drivers and setup the printer on the machine.

Install hplip on raspberry pi,

sudo apt install hplip

hplip depends on cups, not needed to install it externally.

Due to disabled root access issue root password fails, switch to root user using sudo su, and run hp-plugin to download all the proprietary plugins

root@raspberrypi:/home/vinay# hp-plugin

HP Linux Imaging and Printing System (ver. 3.22.10)
Plugin Download and Install Utility ver. 2.1

------------------------------------------
| PLUG-IN INSTALLATION FOR HPLIP 3.22.10 |
------------------------------------------

  Option      Description
  ----------  --------------------------------------------------
  d           Download plug-in from HP (recommended)
  p           Specify a path to the plug-in (advanced)
  q           Quit hp-plugin (skip installation)

Enter option (d=download*, p=specify path, q=quit) ? d

Enter option d to download the required plugin for the printer

Do you accept the license terms for the plug-in (y=yes*, n=no, q=quit) ? y

Input y to accept terms and conditions

Exit the sudo su terminal session and run hp-setup -i as a normal user.

$hp-setup -i

HP Linux Imaging and Printing System (ver. 3.22.10)
Printer/Fax Setup Utility ver. 9.0

Copyright (c) 2001-18 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

(Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)


--------------------------------
| SELECT CONNECTION (I/O) TYPE |
--------------------------------

  Num       Connection  Description
            Type
  --------  ----------  ----------------------------------------------------------
  0*        usb         Universal Serial Bus (USB)
  1         net         Network/Ethernet/Wireless (direct connection or JetDirect)

Enter number 0...1 for connection type (q=quit, enter=usb*) ? 0
Using connection type: usb

Setting up device: hp:/usb/HP_LaserJet_Professional_M1136_MFP?serial=000000000QHBYPM0PR1a

I have my printer connected to Pi via USB, so choosing 0

$ sudo usermod -aG lpadmin <<USER>>
$ sudo cupsctl --remote-any
$ sudo /etc/init.d/cups restart

Add the user to lpadmin and enabling remote printing within the network using cupsctl.

https://192.168.1.100:631/admin/ cups web interface

Add a new printer in CUPS web UI Select HP Laserjet Pro M1136 connected via USB, and then input the root password of raspberrypi. vinay vinay Printer added successfully, you can now manage print jobs via UI also add printers.

Now my sister and dad can print documents from phone too (: Print documents from phone