How to Set Up an AirPrint Server on Your Raspberry Pi

How to Set Up an AirPrint Server on Your Raspberry Pi

AirPrint: Wireless Printing from iOS Devices


First introduced in 2010 along with iOS 4.2, AirPrint allows you to wirelessly print from an iPhone, iPad, iPod Touch, or other iOS device to any AirPrint-enabled printer. No drivers, software, or setup is required – just connect to the printer over your Wi-Fi network and print away!

Step 1: Installing and Configuring CUPS

The first package we need to install on the Raspberry Pi is CUPS, the Common UNIX Printing System. CUPS is the standard printing system on Linux and macOS responsible for managing printers, queues, and sharing printers on the network.

We‘ll use CUPS to manage our attached USB printer and share it out as a network printer:

sudo apt update
sudo apt install cups

Tip: Run apt update first to refresh the package lists before installing anything new.
Once CUPS is installed, we need to configure it to accept print jobs from other computers on the network:

sudo cupsctl --remote-any 
sudo systemctl restart cups

Step 2: Configuring Samba for Printer Sharing

In order for AirPrint to function properly, our Raspberry Pi needs the ability to share printers using the SMB protocol. This is handled by Samba, a free software implementation of SMB that allows file and print sharing between Linux, Windows, and MacOS.

Let‘s install Samba:

sudo apt install samba

Once installed, we need to configure Samba to share our CUPS managed printers. Edit the Samba config file at /etc/samba/smb.conf and add the following:

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

This defines a print$ share that will make CUPS printer drivers available to Windows and macOS clients.

Finally, restart the Samba service for the new configuration to take effect:

sudo systemctl restart smbd

At this point your Raspberry Pi is sharing its CUPS managed printers via SMB to other devices on the network!

Pro Tip: For better security, create a Samba admin user and require SMB authentication to access printers.

Now that our print server is accessible on the network, we need to enable AirPrint specific technologies.

Secincom Avatar

Leave a Reply