I thought I’d share how I deployed CUPS via Portainer alongside hassio. I am a beginner using docker and it wasn’t clear how I would start, so hopefully this helps someone.
I am using the Portainer addon, so make sure you have that (Supervisor > Add-on Store > Portainer).
*and for the advanced users, please let me know if I am mis-configuring something!
Add container
Input a name
I am using “rpi-cups”
Input name of docker image from hub (*this is just the name; it will pull the image)
I am using “lemariva/rpi-cups:latest” but probably any CUPS docker with a raspberry-pi implementation would work
Make sure “Always pull the image” is enabled
Click on “publish a new network port” and set it from 631 to 631
Go to “Volumes”
“map additional volume” then set to “Bind”
/var/run/dbus:/var/run/dbus
“map additional volume” then set to “Bind”
/dev/bus/usb:/dev/bus/usb
Go to “Restart policy”
Choose “Unless stopped”
Go to “Runtime & Resources”
Enable “Privileged mode”
Go back up top and “Deploy the container”
After that, you should be able to access CUPS via http://localhassip:631 and setup your printer.
Thank you so much for this. I have been googling for hours trying to find a portainer or docker option for cups. Honestly I never heard of this site, but I needed to install CUPS on my OMV5 (OpenMediaVault 5) server, and your instructions were great.
My setup is not a RPi, but on an old HP server so I used olbat/cupsd from the site below, and now cups is up & running in my portainer.
Hi, i configured cup using Portainer on my pi 4 with Hassos… The problem now is that using Hassos 4.20 it works fine, but upgrading to Hassos 5.9 the server still works, but no printer is shown on the net. Which is the problem? What I have to do to share the printer added in cups docker? please help me, thanks.
I successfully set up this but what is the default password for cups? when I try to add printer it asks for a username and password. I have tried root and root, Root and my homeassistant password combination but still no luck
Thank you for this. While I didn’t set up a USB printer on my Home Assistant box, I did on my NAS/Media server running docker/portainer & found your instructions very helpful. Thank you again.
got the same problem. some how the 631 is used from the home assistant container. I tried 49631 for the host port, and I can access to the page via localhost:49631 and add my Canon printer. haven’t find a way to see the printer from port 49631.
Thanks for your great guide, managed to install it successfully but now fail to install the printer.
Found PPD file for my printer, it istals. But when trying to print get the error:
Idle - “File “/usr/lib/cups/filter/RICOH_SP_150Filter.app” not available: No such file or directory”
Do have this file on my local PC but have no idea how to upload it to this directory - ha file browser do not see it, FTP as well. Any advice?
To everyone who came here to learn how to add CUPS functionality to HASS: The portainer add-on has been discontinued and is no longer available in the add-on store.
Whilst this is true, I managed to get it working by forking the home assistant community addon repo and reverting it to before it was removed. I then added it as a custom repo in home assistant and managed to install it.
That’s exactly what I was looking for! I did everything from your Tutorial but somehow I can’t connect to the http://localhassip:631 adress. It just says that the URL isn’t reachable… I did everything from my Desktop PC. Do I have to do the setup from the Pi directly? Or did I something other wrong.
I got here from another post about automations.
It looks like you don’t have any published ports in your container.
Try the following using portainer:
Click on the Container Name (rpi-cups)
Then click on Duplicate/Edit
Under Port Mapping, click on + Map Additional Port and add 631 to Host and 631 to Container
I had the correct settings already applied but the port doesnt show as published. So i tried it again and somehow the port was shown as published…for a few seconds and then it disappeared again oO Not sure what this means ><
I’m not sure what is happening with the ports.
Can you check the container logs? (Under Quick Actions, click on the 1st option in the left)
if there is nothing there, maybe the port 631 is already being used and the container cannot bind to the port.
Try changing in Host Port to something like 6631 (and keep the same port 631 under Container)