OR How to Enable Apple AirPrint on Any USB Printer Using Raspberry Pi.
If you are our longtime readers, you will surely remember that in 2017 we reused a Brother laser printer and transformed it into a network printer (here is the article with the link to the tutorial, the CUPS configuration, and the specific PPD file for our Brother HL-2030 since the CUPS one does not work) thanks to the use of a small Raspberry Pi.
Well, now that we are also using Macintosh computers and their macOS system, it made us want to use new Apple technologies as well and then add AirPrint functionality to our network printer.
![A Raspberry Pi (any model with USB and network connectivity)](https://cialu.net/wp-content/uploads/2024/12/A-Raspberry-Pi-any-model-with-USB-and-network-connectivity-1024x790.jpg)
How to Enable Apple AirPrint on Any USB Printer Using Raspberry Pi 🖨️
Introduction
In today’s increasingly wireless world, having a network-enabled printer is almost essential, especially in environments using Apple devices. While newer printers come with AirPrint capabilities built-in, many reliable older USB printers lack this functionality. This guide will show you how to transform any USB printer into an AirPrint-capable device using a Raspberry Pi, making it accessible across your local network.
What is AirPrint?
AirPrint is Apple’s protocol that enables wireless printing without requiring specific printer drivers. As described by Apple, it allows for:
- Direct printing from macOS, iOS, and iPadOS devices
- Automatic printer discovery on the local network
- Automatic media selection
- Enterprise-class finishing options
- Driver-free printing experience
Prerequisites
Before starting, you’ll need:
- A Raspberry Pi (any model with USB and network connectivity)
- SD card (8GB minimum recommended)
- USB printer
- USB cable
- Power supply for Raspberry Pi
- Network connection (Wi-Fi or Ethernet)
Support Our Work 🤝
By using our affiliate links for your purchases, you can support our work (like the How to Enable Apple AirPrint on Any USB Printer Using Raspberry Pi article) at no additional cost to you. Here’s how it works:
- When you make a purchase through our affiliate links, we receive a small commission
- The price you pay remains exactly the same
- Your support helps us maintain the website, create new content, and improve your experience
If you need the products, please buy and support
- Raspberry Pi – https://amzn.to/4fAerVk
- SD card – https://amzn.to/49ZPd1A
- USB printer – https://amzn.to/3Pfw4iw
- USB cable – https://amzn.to/3DIKBR4
- Power supply for Raspberry Pi – https://amzn.to/3DIKDsa
- Network connection – https://amzn.to/49TFZne
This helps keep our content free and accessible to everyone. Thank you for supporting independent content creation! 🙏
Step-by-Step Setup Guide
1. Initial Raspberry Pi Setup
First, we need to prepare the Raspberry Pi:
- Download and install Raspbian on your SD card
- Enable headless operation:
# Create ssh file in boot partition
touch ssh
# If using Wi-Fi, create wpa_supplicant.conf file
nano wpa_supplicant.conf
Add the following to wpa_supplicant.conf
:
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="YOUR_WIFI_NAME"
psk="YOUR_WIFI_PASSWORD"
key_mgmt=WPA-PSK
}
2. CUPS Installation and Configuration
Once your Raspberry Pi is running, connect via SSH and execute these commands:
# Update system
sudo apt-get update
sudo apt-get full-upgrade
# Install CUPS
sudo apt-get install cups
# Add pi user to printer admin group
sudo usermod -a -G lpadmin pi
# Enable remote access
sudo cupsctl --remote-any
# Restart CUPS service
sudo systemctl restart cups
3. Printer Setup in CUPS
- Access CUPS web interface at
http://raspberrypi:631/admin
- Login with Raspberry Pi credentials
- Click “Add Printer”
- Select your USB printer
- Configure sharing settings:
- Enable “Share This Printer”
- Check “Allow Printing from the Internet”
- Save changes
4. Enabling AirPrint Support
Install and configure Avahi daemon for AirPrint service discovery:
# Install Avahi daemon
sudo apt-get install avahi-daemon
# Restart the system
sudo reboot
Verification and Testing
After reboot, your printer should be discoverable on Apple devices:
- Go to any app with printing capability
- Tap share icon → Print
- Your printer should appear in the printer list
- On macOS:
- Open System Preferences → Printers & Scanners
- Click ‘+’ to add printer
- The printer should appear automatically
Troubleshooting
If the printer isn’t appearing:
- Check CUPS service status:
sudo systemctl status cups
- Verify Avahi daemon is running:
sudo systemctl status avahi-daemon
- Ensure printer sharing is enabled in CUPS web interface
- Check firewall settings:
sudo ufw status
💡 Allow ports 631 (CUPS) and 5353 (Avahi) if needed.
Advanced Configuration
Securing Your Print Server
- Change default CUPS admin password:
sudo passwd pi
- Enable HTTPS for CUPS:
sudo cupsctl --ssl
Optimizing Performance
- Adjust CUPS buffer size in
/etc/cups/cupsd.conf
:
RequestRoot 8m
- Enable job compression:
JobCompression yes
References and Further Reading
Updates and Maintenance
Remember to regularly update your Raspberry Pi system:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
This ensures you have the latest security patches and improvements.
Conclusion
By following this guide, you’ve transformed a standard USB printer into an AirPrint-capable device accessible to all Apple devices on your network. This setup provides a cost-effective way to extend the life of older printers while adding modern functionality.
Last updated: How to Enable Apple AirPrint on Any USB Printer Using Raspberry Pi – December 2024