Apple Airprint is a technology (a zeroconf implementation under the bonnet) which allows apple devices to detect, configure and print without any overt configuration on the part of the user.

The bad news is that in only works for a handful of airprint printers natively. But never fear, Linux to the rescue!

At this point I’m going to assume that you have a Linux box somewhere on your network acting as a file and print server (pretty regular kit in most geek homes).

Set up your printer

The first step is to set up CUPS on your linux server and then installing the appropriate printer driver for your printer.

I won’t go into detail here as there are numerous guides out there on the wider web, but mostly this is a matter of installing cups and foomatic and then visiting the cups configuration website on the server (localhost:631 usually) and adding your printer.

Make sure that the printer is shared. Print a test page.

One gotcha I found is that my default configuration only allowed connections from the local machine, even though the printer was marked as shared (although frankly I was cheating since most of my computers printed to my server over a Samba relay, but that’s by the by).

Take a look at /etc/cups/cupsd.conf and make sure that has an Allow From from your local network. E.g.

<Location />
Order Deny,Allow
Deny From All
Allow From
Allow From

Export the printer

The next step is to install the zeroconf demon, which is called Avahi. This varies from system to system, but on debian this is pretty much a matter of apt-getting avahi-daemon. You may also want avahi-discover so you can browse the exported devices on your network.

Assuming you’ve correctly set up and shared your printers in CUPS the next step is to generate an avahi configuration for it. Thankfully, there’s a handy Python script called airprint-generate, available on github which does much of the donkey work.

Copy the resultant file to /etc/avahi/services and restart the avahi demon.

If your printer is password protected, you will want to add a <txt-record>air=username,password</txt-record> field to the file before doing so. Where username and password is the literal cleartext strings sent.


Theoretically that should be it. After the configuration, and restarting the various demons involved your printer should be available to the various iOS devices kicking around your network.

Let me know if you have any questions!

Update for IOS6 users

If you are using IOS6 and are seeing a “no airprint printers found” when you try and print (even when ios5 devices can print fine), you must make a small configuration change to CUPS.

Create two extra files in /usr/share/cups/mime:


image/urf urf string(0,UNIRAST<00>)


image/urf application/pdf 100 pdftoraster

Then restart CUPS before regenerating the avahi configuration file for your printer using airprint-generate as documented in the steps above. Replace your existing avahi printer configuration with this new one and restart avahi.

You printer should now be visible again to both ios5 and ios6 devices via airprint.

11 thoughts on “Howto: Printing to any printer with an iPad/iPhone and Apple Airprint

  1. A few items for people who are following these instructions:
    1. I had to point a browser to http://localhost:631
    2. Under server settings, I checked “Share printers connected to this System”.
    3. I also modified the existing printer to make sure sharing was enabled (fedora’s printer config was lacking).
    4. I don’t know if #2 would have done it by itself without doing #3. Now it works! Profit!

  2. Ubuntu 10.LTS linux 2.6.35 backport delivers the printer name to iOS7 but no job appears in /var/spool/cups … found that pdftoraster was in /usr/share so I’ve copied it to /etc/cups.. still trying

  3. Great stuff.
    Debian wheezy CUPS package already contained the Avahi package (and foomatic) and even without configuring the avahi part the iPad here prints now.

    I haven’t looked into CUPS for some years and was surprised to see the progress there with the easy printer ppd selection and my printer already being predeteced. Where is the fun in that …


  4. 3 Feb 2015,

    Your description provided some details I didn’t see on either the programmer’s GitHub site on the Linux magazine article about this. They involved simple but important items like regenerating the python Airprint file after restarting CUPS and following this with restarting avahi.

    I was dubious it was going to work with my wife’s iPad, because it is up to iOS 8 and it seems with upgrades/updates of the iOS, many outside things get broken.

    A valuable and appreciated post.

  5. I could not get this working on ubunut 14.04 through ios7. I can see the printer on the my iphone but unable to print. Trying upgrade on cups!

  6. Yes. Got it working. Though the printer was shared on the settings, it was not actually shared. I had to visit http://localhost:631/admin and then enable “Share printers connected to this system”. Now it is all good. Thanks a ton for the steps 🙂

Leave a Reply