CUPS + AirPrint on Raspberry PI

Install CUPS and Enable Remote Access

apt-get install cups

Add Pi user to lpadmin group

usermod -aG lpadmin pi

Enable Remote Access


Comment out Listen localhost:631 and add Port 631

then Allow access

# Only listen for connections from the local machine
# Listen localhost:631
Port 631

< Location / >
# Restrict access to the server...
Order allow,deny
Allow @local
< /Location >

< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
Allow @local
< /Location >

< Location /admin/conf >
AuthType Default
Require user @SYSTEM

# Restrict access to the configuration files...
Order allow,deny
Allow @local
< /Location >

Restart CUPS

/etc/init.d/cups restart

Now you are able to access remotely x.x.x.x:631 and add the printer

Install AirPrint

apt-get install avahi-discover cups cups-pdf python-cups

apt-get install hplip

Make your old printer AirPrint capable

/etc/init.d/avahi-daemon start
mkdir /opt/airprint
cd /opt/airprint
wget -O --no-check-certificate
chmod +x
./ -d /etc/avahi/services
/etc/init.d/avahi-daemon restart
ls /etc/avahi/services/

Add those files with this content


image/urf application/vnd.cups-postscript 66 pdftops


image/urf urf (0,UNIRAST)


image/urf application/pdf 100 pdftoraster

Open port 631

iptables -A INPUT -i eth0 -p tcp -m tcp --dport 631 -j ACCEPT
iptables -A INPUT -i eth0 -p udp -m udp --dport 631 -j ACCEPT

Disable power saving (optional)

options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1

Connect from windows


seo reseller