This Bash script sets up a CUPS print server with wireless printing support for an HP USB printer on Ubuntu/Debian.
Before using the script check if your printer supports printing via USB on the HPLIP supported devices list.
| Tested Device | OS | Printer |
|---|---|---|
| Raspberry Pi 5 | Ubuntu Server 25.04 | HP Color LaserJet CP2025n |
| Raspberry Pi Zero 2 W | Ubuntu Server 25.04 | HP Color LaserJet CP2025n |
-
Connect your printer to your machine via USB.
-
Download and run the setup script:
wget https://raw.githubusercontent.com/StasGr12/HP-Print-Server-Linux/refs/heads/main/setup.sh chmod +x setup.sh ./setup.sh -
If your printer requires a plug-in driver (check under Driver Plug-in on the official HPLIP supported devices list), run this command:
hp-plugin -i --required -
Enjoy wireless printing!