Raspberry Pi as a print server - Share your printer thanks to a Linux server

We've already published several handy how-tos about useful applications for the Raspberry Pi, the compact motherboard computer that you can get for around 35 euros. We will now pick up the thread again, and show you how to use the thing as a print server.

In previous how-tos, we took a closer look at the Raspberry Pi as the ultimate crafting and downloading computer. Creating a cloud server was also discussed in detail.

In the new workshop we connect a printer to the Raspberry Pi and use the computer as a print server. That way you can print from any computer, tablet or smartphone in the house or even when you're out of the house. For this we configure Cloudprint from Google and AirPrint from Apple.

01 Up to date Raspbian

We use Raspbian as the operating system for our Raspberry Pi. For the installation and initial configuration thereof, we refer to our course from last year. Before we proceed, make sure the software is up to date. You can do that with the assignments sudo apt-get update and after that sudo apt-get upgrade (to get the updates). Then we install the necessary print server software with:

sudo apt-get install avahi-daemon cups cups-pdf cups-driver-gutenprint openprinting-ppds python-cups python-daemon python-pkg-resources

02 Access from outside

After installation, run the command sudo nano /etc/cups/cupsd.conf from. Add in front of the line Listen localhost:631 An # (pound) and create a new line with Port 631. This also gives us access to the CUPS (Common Unix Printing System) print server from other computers. Then we add in the sections , and just before the line each time the line Allow @Local to restrict access to Raspberry Pi users. Save your changes with Ctrl+O and exit nano with Ctrl+X.

03 Administrator

Now restart the CUPS server so that it reads the changed configuration file again: sudo service cups restart. Since we want to manage the print server via the web interface from the following steps, we also add the user 'pi' to the group of administrators of the print server: sudo adduser pi lpadmin. Also change the password if you haven't already done so: passwd. Now visit the url in your web browser //IP:631/, at which IP is the IP address of your Raspberry Pi. If you get a warning about the security certificate, ignore it.

3 additional steps

Serial console 01

If you find it inconvenient to connect a keyboard and display to your Raspberry Pi to configure Raspbian or solve network problems, a USB-to-TTL serial cable will come in handy (see the article '15 Raspberry Pi Accessories '). Connect the four wires correctly to the GPIO pins of the Pi: on the top row from left to right red, nothing, black, white and green.

Serial console 02

On a Windows PC, download the PL2303 drivers. Unzip the file and install the program. After this, connect the USB side of the USB-to-TTL serial cable to your PC. Note: that cable also supplies power to the Raspberry Pi, so don't connect the Pi's micro USB cable to power at the same time! If you want that, remove the red wire from the GPIO pins. Windows is now looking for new hardware.

Serial console 03

Look in the message that the driver is installed which port is used, for example COM5. Now open the program PuTTY, choose as connection type serial, fill in serial line into the gate and near speed 115200. Click Open and press Enter to start the connection. Then log in to the PuTTY terminal window with the username pi and default password raspberry.

04 Add printer

Now connect your printer to one of the USB ports of the Raspberry Pi and switch it on. Click at the top of the CUPS web interface Administration and click on the button Add Printer. You will then be asked to enter the username and password of a printer administrator. Then you get next to Local Printers to see all connected USB printers and next to Discovered Network Printers all discovered network printers. After all, if your printer already has a network connection, you can also have it managed by your Pi.

Recent Posts

$config[zx-auto] not found$config[zx-overlay] not found