How to share any printer in your smarthome using Raspberry Pi and CUPS
TechBytes with Ron Nutter
Have a printer you want to share between multiple computers? Looking for another way to use a Raspberry Pi in your smarthome? Stay tuned and I will show you how to do this ⏱️TIMESTAMPS⏱️ 0:00 - Intro 0:49 - What we will be covering 1:06 - Required items 1:49 - Creating a SD card for RPI 3:53 - Enabling SSH 4:32 - Updating RPI OS 6:02 - Installing CUPS 13:15 - Adding printer to CUPS 15:57 - Configuring workstation to use CUPS based printer
Update RPI
sudo apt-get update sudo apt-get upgrade sudo reboot
Install CUPS
sudo apt-get install cups
Add user pi to lpadmin group
sudo usermod -a -G lpadmin pi
Make a backup of cups confi file
Cd /etc/cups sudo cp cupsd.conf cupsd.conf.back
Start cups service before making any changes to make sure it would start at this point
sudo /etc/init.d/cups restart sudo /etc/init.d/cups status - should show as started sudo /etc/init.d/cups stop
Configure CUPS
sudo nano /etc/cups/cupsd.conf
listen on all interfaces
#Listen localhost:631
Restrict access to the server...
Location / Order allow,deny Allow @Local /Location
Restrict access to the admin pages...
Location /admin Order allow,deny Allow @Local /Location
Restrict access to configuration files...
Location /admin/conf AuthType Default Require user @SYSTEM Order allow,deny Allow @Local /Location
You can allow all domains to access the interface
ServerAlias *
or provide a specific name.
ServerAlias one.example.com two.example.com
Allow CUPS to be available everywhere on the network
sudo cupsctl --remote-any ** Note if error restart, use the restart cmd below and the retry this cmd
Restart CUPS to make these changes active
sudo /etc/init.d/cups restart
Check for CUPS admin page to respond
http://x.x.x.x:631 (replace x.x.x.x with ip address of CUPS RPI) If printer is HP and not showing under “Local Printers”, may need to install hplip from this URL https://developers.hp.com/hp-linux-imaging-and-printing
If the printer only prints X number of jobs and then quits, try the following-
Replace PRINTERNAME with the name used in step 7. Eg: m1136
lpadmin -p PRINTERNAME -o usb-no-reattach-default=true
Restart your Pi
sudo reboot
================================================ *** Show Notes, Links and Resources **** Here are the items mentioned in this video -
CanaKit Raspberry Pi 4 2GB Basic Starter Kit with Fan (2GB RAM) https://amzn.to/35QBB8I
Click on this link to get the SmartHome Account Creation Checklist
➥➥➥ SUBSCRIBE FOR MORE VIDEOS ➥➥➥ Never miss a video about creating your own smart home Subscribe ⇢ http://ronaldnutter.com/subscribe
To listen to an audio version of this episode while driving, Tec ... https://www.youtube.com/watch?v=go8ENrD5A4Q
122193112 Bytes