AirPrint, Ubuntu and a Brother Printer

Hello again,

If you read my last post about using an Ubuntu server as a Time Capsule then you already have most of the key elements to get AirPrint up and running in place. If you don’t need Time Capsule then the pre-requisites are:

  • Avahi
  • CUPS

That’s it. So once you have them installed run through the following steps.

Step 1: Create an Avahi Service File

 sudo nano /etc/avahi/services/printer.service

Step 2: Paste the following into the file

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
  <name>My Printer</name>
    <txt-record>ty=My Printer</txt-record>
    <txt-record>note=My Printer</txt-record>
    <txt-record>product=virtual Printer</txt-record>

The text in blue above can be whatever name you want for your printer, those in red have to be exactly as assigned to your printer by CUPS which you can verify from System > Administration > Printing or by navigating to the CUPS admin page (http://computername:631/printers). Everything else should be changed based on your printers settings.

Save and exit the file (CTRL+O then CTRL+X).

Step 3: Ensure the printer you want to use with AirPrint is shared (System > Administration > Printing) and published

Step 4: Edit CUPS config

 sudo pico /etc/cups/cupsd.conf

Step 5: Ensure you have the following settings

ServerAlias *
Port 631
Listen /var/run/cups/cups.sock

Step 6: Restart Avahi and CUPS

sudo restart cups
sudo restart avahi-daemon

And that’s it, you should be able to print from your iPhone or iPad running iOS 4.2.1