Newbie question, sorry. Learning Linux. I've installed WSL2 on Windows 11 laptop. Successfully running apps e.g. LibreOffice. Been trying to figure out how to print to my home network HP printer. My printer is currently at (but presumably this changes with dynamic allocation). Is there some way Ubuntu can locate network printers on my local network and install them for use by the apps?

Update: I have got as far as getting to CUPS and trying to ADD PRINTER at localhost:631/admin but there are no "Discovered Network Printers". ps. The printer on my network is HP Photosmart 6520.

Still stuck

2 Answers 2


You need to tell CUPS where the remote printer is. Example:

sudo lpadmin -p {printer_name} -m everywhere -o printer-is-shared=true -E -v http://192.168.x.x:631/printers/{printer_name}
sudo lpoptions -d {printer_name}

where {printer_name} is a unique id for a printer and the x.x is the last part of the URL for your printer; should be available in Windows printer settings (this probably starts with 192.168. I also assumed the port is the default port (631)). "everywhere" is a generic printer driver; if you have a specific one replace that with the driver.

The 2nd command makes it the default printer.

Oh and you should also be able to do this from a browser if you go to http://localhost:631


Succeeded after much trial and error. I added printer using ipp:// on the CUPS admin page. I can't say I understand what I'm doing, but at least I can now print off my mistakes. Presumably, if the router assigns a different ip address to the printer I'll lose it

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .