Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

RPI CUPS server for mini print server

From Thibble Wiki
Revision as of 00:54, 9 September 2024 by T20A02 (talk | contribs) (Created page with "== CUPS server on RPI == ==== Overview ==== I started this projects as I have recently been using two separate desktop PC's instead of one, and conjunction with this I have always had to have others email me files to be printed, as my trust Brother printer, is a usb only device. From this I decided to install CUPS on a RPI3 I had lying around to provide a print server for the network. === Installing Dependancies === The first thing we are going to do is install a few...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

CUPS server on RPI

Overview

I started this projects as I have recently been using two separate desktop PC's instead of one, and conjunction with this I have always had to have others email me files to be printed, as my trust Brother printer, is a usb only device. From this I decided to install CUPS on a RPI3 I had lying around to provide a print server for the network.

Installing Dependancies

The first thing we are going to do is install a few dependencies for the CUPS server, as well as CUPS itself. This is assuming we are starting off in the terminal of a fresh RPI install. II used Raspbian Lite 32bit for this device, but as long as it runs on the device, and is Debian based these instructions should work perfectly fine.

Start off by updating your OS

sudo apt update

sudo apt upgrade

Now that we have updated the system, and pro's install the cups service

sudo apt install cups

Now that CUPS is installed we are going to add our local user to the "lpadmin" group to allow it to have access to the local instillation of CUPSS. To do this run

sudo user mod -aG lpadmin user

Now we are going to allow all local network devices to access the CUPS server and reboot the service to apply the change

sudo cupsctl --remote-any

sudo systemctl restart cups

Now you should be able to navigate the the devices IP on the local network with port 631

Example

http://192.168.1.20:631

Samba

Now before we continue we also ant to instal samba to the device and configure it to allow MacOS Bojour and Windows devices to access the service, and print to the device using network discovery.

To do this first install samba with

sudo apt install samba 

Once Samba is installed we just have to make a few changes to its config to support the actions we want. Open the config file

sudo nano /etc/samba/smb.conf

and then scroll to the bottom of the file and edit its "[printers]" and "[print$]" section to match the below settings

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = yes
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = no
   guest ok = no

Now save the file, close it, and reload the samba service to apply the change she made

sudo systemctl restart smbd

Now we have samba and cups installed and configured on the device.

Adding printer to CUPS

Now we must add the printer to our cups server from the web UI.

Navigate the the IP like you did earlier to test CUPS resolution, and go to the Administration Tab

Once you are in the Administration page, select "Add printer""

Then on the next page select your printer, which should show as its name and model, and click continue.

Verify the settings on this page and then click next, to apply driver.

Finally you will need to find the driver file for your printer. I like to use a resource called OpenPrinting. You can find the download page for the specific Device I used here

Once you have searched up and found your .ppd file, download it and upload it to the second option on the page.

Note: If the ppd file is hpijs based please run the following install command to add dependencies needed after you finish the setup in the web page.

sudo apt install hpijs-ppds printer-driver-hpijs

Finally click next, make sure "Share this printer" is checked to allow the device to be shared on the network.

You should now be able to discover the printer on the network from Windows or MacOS.