AirPrint for Mac on Linux

Apple is finally offering printing services from your iOS device, they are marketing this capability as AirPrint and it is in fact an amalgam of a number of existing network technologies. There are some HP printers already configured for AirPrint, but the list is rather short. Wouldn’t it be nice if you could use your existing printers to do this?

Thanks to Ryan Finnie for his research and TJ Fontaine for a fabulous script that automates the services configuration for your AirPrint printers.

Before proceeding, this tutorial assumes you are running CUPS on a Linux (Ubuntu) server to share out one or more printers on your network. In my configuration, an HP PSC 500 provides printing and scanning services and a Brother 2820 is our general purpose laser printer with fax. After settings things up for AirPrint using CUPS and Avahi, I am now able to print successfully to both devices from my iPhone 3GS.

  1. Configure CUPS. Get your CUPS server properly configured. This is going to require the following entries included in your cupsd.conf:
    Listen 631
    Browsing on
    BrowseOrder allow,deny
    BrowseAllow all
    BrowseLocalProtocols CUPS dnssd
    BrowseAddress @LOCAL
    ServerAlias *
    It will need to be have the option to share printers connected to the system (Browsing On), as a general rule of thumb if you can print to your CUPS server from another computer on your network then it’s probably configured correctly.
  2. Install Avahi. You need this to broadcast your printer services, if you’re running Ubuntu server this can be done as follows:
    sudo apt-get install avahi-daemon
  3. Download TJ’s Script. It will make your next step much easier:
    https://github.com/tjfontaine/airprint-generate
  4. Run the airprint-generate script. This produces services files for Avahi. Copy the resulting files to:
    /etc/avahi/services
  5. Restart Services. Restart your avahi service:
    /etc/init.d/avahi-daemon restart

Now browse to your printers on your favorite iOS device running 4.2.1 or later, when selecting Print from any of the standard applications (Mail, Safari, etc.) your printers should appear available.

AirPrint from iPhone to HP PSC 500

If you made it this far and are on iOS 6, then your journey is not yet complete. Visit AirPrint on Linux with iOS 6 for a rundown on how to get your server setup to support the changes Apple made in this release.

  • http://topsy.com/www.micromux.com/2010/11/22/airprint-for-mac-on-linux/?utm_source=pingback&utm_campaign=L2

    […] This post was mentioned on Twitter by Ilia Lobsanov and Gordon Turner, Pradeesh. Pradeesh said: http://www.micromux.com/2010/11/22/airprint-for-mac-on-linux/ configure your printer for airprint (linux/ubuntu) […]

  • steve

    Thanks for the pointers. It’s working beautifully on Fedora 14.

  • http://ispey.com/iphone/iphone/airprint-using-linux-server/ Airprint using Linux Server | IPhone
  • http://www.macnotes.de/2010/11/25/airprint-freischalten-ohne-download-auch-unter-linux-und-windows-prinzipiell-moglich/

    […] 26. November 10:42 Uhr: Auch für Linux gibt es einen Hack, den wir bisher noch nicht selbst testen konnten. Sollte es jemand bereits ausprobiert haben, […]

  • http://revanmj.pl/2010/12/airprint-nieobslugiwana-drukarka/ AirPrint + nieobs?ugiwana drukarka

    […] systemu nie b?d? t?umaczy? instrukcji, ?eby nic przekr?ci?. Zamiast tego zamieszczam tutaj link do strony, na której znajduje si? instrukcja jak uruchomi? AirPrint w systemach spod znaku pingwina. […]

  • hanij

    i have CentOS 5. To get the script in step 3 to work with python 2.4 (which is what ships with CentOS 5) you need to modify line 43 to be:

    from cElementTree import Element, ElementTree, tostring

    assuming you also have “python-elementtree” and “libxml2-python” installed

  • http://riviera.org.uk/2011/03/21/airprint-for-ios-on-linux/ AirPrint for iOS on Linux | riviera.org.uk

    […] on the internet who took the time to figure out how it works and have since published a nice simple guide about how to setup a Linux box as a AirPrint server. Mainly thanks to Cups and some Avahi […]

  • http://dmnet.bitacoras.com/archivos/linux/compartir-impresoras-desde-linux-con-ios-ipadiphone.php Compartir impresoras desde Linux con iOS (iPad/iPhone) « Delirios de un Informático

    […] un poco para ver si era posible configurarlo para que funcione del mismo modo y me topĂ© con estas instrucciones pero en mi caso el proceso fuĂ© muchĂ­simo más […]

  • http://justindwalker.com/blog/2012/05/setup-airprint-on-ubuntu-sever-8-04/ Install AirPrint On Ubuntu Sever 8.04 – Justin Walker
  • Harry

    Hi, does this still work with iOS6? One of my Devices, i updated to iOS6, does not work? Do you have a solution?