To print from a Raspberry Pi, we will first install CUPS to help us to configure our printer. CUPS stands for Common Unix Printing Standard. CUPS use IPP (Internet Printing Protocol) to manage local and network printers.
sudo apt install cups
To install a printer, we need an administrative right on CUPS. To do this, we need to login with a user in the lpadmin group:
sudo usermod -a -G lpadmin pi
Next, open the CUPS web interface:
https://localhost:631
In the top bar menu, click on the “Administration” menu.
Then click on Add printer. CUPS will ask you for a login ID (pi by default) and password (raspberry by default).
CUPS should have already found your printer on the network, or if plugged. Select the printer you want to install and click “Continue”.
In the next step, CUPS asks you to set the printer properties, like name and description. After you are done, click "Continue".
Then, you need to select the corresponding driver for your printer. If the specific driver is not available, take a close one, or upload a PPD file from the manufacturer if you have one.
Finally, click “Add Printer”.
In the last steps, CUPS asks you to configure the printers settings. You may just leave this all by default and come back later if you need to make some changes. Click on “Set Default Options” and that’s it, the printer is installed in CUPS
You can print a test page and see if everything works well. To do this, in the printer page, in the “Maintenance” drop down menu, choose “Print Test Page”. You may need to click on your printer name (under Administration / Manage Printers) to go to the printer page.