January 14th 2013

Wireless Printing/AirPrint Server via the Raspberry Pi

NOTICE: Please read the entire post (and the comments) before proceeding.  This post was originally written at the end of 2012 and some of you have left comments noting fewer steps are required nowadays.  This guide should still work though. Updated guide (no Windows section) available at http://www.lynsayshepherd.com/blog/2015/10/18/wireless-printingairprint-server-via-the-raspberry-pi-updated-guide/.

NOTICE 2: Thank you for all of your emails regarding this post. Unfortunately, I can’t answer every one. If you’re struggling with printing, it might be worth reading through the comment section.

One of the first projects I wanted to attempt when I got my Raspberry Pi was to turn my wired Canon printer into a wireless printer. I managed to get it working so I thought I’d share the steps I went through.

Right, first things first, update the packages on your Pi:

sudo apt-get update

Next up, install all the packages required for printing. The following commands could be put on one line but I took the longer option of installing one package at a time.

sudo apt-get install avahi-daemon
sudo apt-get install avahi-discover
sudo apt-get install libnss-mdns
sudo apt-get install cups
sudo apt-get install cups-pdf
sudo apt-get install python-cups

It takes a while for the packages to install, so grab a cup of tea while you wait. Once everything has finished, you’ll need to add your username to the CUPS server so you’re able to add printers etc later on.

sudo usermod -aG lpadmin pi

Now, check that CUPS has installed correctly and that the service works (it stands for Common Unix Printing System and will let the Raspberry Pi act as a print server):

sudo /etc/init.d/cups start

You’ll need to check the Avahi service works too (it finds various devices on the network which are discoverable):

sudo /etc/init.d/avahi-daemon start

Next, you’ll need to edit the CUPS config file:

sudo nano /etc/cups/cupsd.conf

You’ll need to set-up the port we’re going to be listening on. Comment out the line that reads “Listen localhost:631”. Add in “Port 631”. It should look something like this:

#Listen localhost:631
Port 631

CUPS will need to be told to be used with any hostname, so it can work with AirPrint. The ServerAlias * directive needs to be added before the first occurence of <Location />

The config file will also need to be edited to control access to the server by adding “Allow @Local” in several places e.g.:

# Restrict access to the server...
Order allow,deny
Allow @Local

You need to include it in these areas of the config file:

# Restrict access to the server...
# Restrict access to the admin pages...
# Restrict access to configuration files...

Save the config file and restart the CUPS service:

sudo /etc/init.d/cups restart

Now, find the IP address of your Pi. It’ll be something like 192.168.1.x


Navigate to the CUPS configuration page by typing the IP address you just retrieved and the port number CUPS uses (so it’ll be an address like 192.168.1.x:631). A security exception message may pop up but that’s ok. Continue onwards!

Click on the Admin tab and view the server settings which are towards the right-hand side of the screen. Tick the box that says “share printers connected to this system”. At this stage, you’ll be asked for the username and password of the Raspberry Pi.

Plug your printer into one of the USB ports on the Pi. Click “add printer” in the CUPS web interface and it should appear under local printers. You’ll have to fill in details for the printer, such as name and location. You can enter whatever you want in here but the important part is ensuring you tick the “share this printer” box. Following this, you’ll have to select the appropriate printer driver from a (large) list that appears. Enter print and paper settings too. You’re now ready to click on maintenance > print test page. If everything has gone to plan, the test page will print successfully. You’re not done yet though….

You now need to set-up the Avahi service which will allow you to discover wireless printers on Apple devices. First, navigate to the opt directory, make a directory called airprint and move to it:

cd ../../opt
sudo mkdir airprint
cd airprint

Now, download the Python file which will help us generate the services we need (all one line):

sudo wget -O airprint-generate.py --no-check-certificate 

The permissions of the script need to be edited so it can be executed:

sudo chmod 755 airprint-generate.py

Generate the Avahi service and place the script in the appropriate folder:

sudo ./airprint-generate.py -d /etc/avahi/services

On generating the service I got the error shown below. This is fine if you don’t have any Apple devices running iOS6 but I’m willing to bet that most people with capable devices are running it.

image/urf is not in mime types, what_the_printer_is_called may not be available on ios6
(see https://github.com/tjfontaine/airprint-generate/issues/5)

To fix this issue, you’ll have to create 2 files in the /usr/share/cups/mime directory. These files will be called airprint.types and airprint.convs. Let’s start with airprint.types.

Use nano to create a new file and edit it:

sudo nano airprint.types

Insert the following into the airprint.types file:

# "$Id: $"
# AirPrint type
image/urf urf string(0,UNIRAST)
# End of "$Id: $".

Again, use nano to create the second file:

sudo nano airprint.convs

Insert the following into airprint.convs

# "$Id: $"
# AirPrint
# Updated list with minimal set 25 Sept
image/urf application/pdf 100 pdftoraster
# End of "$Id: $".

Restart the CUPS service now that changes have been made:

sudo service cups restart

The Python file which helped us generate services earlier needs to be re-downloaded to the opt/airprint directory

sudo wget https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py

Ensure that you’re in the airprint directory and regenerate the Avahi service (like before):

sudo ./airprint-generate.py -d /etc/avahi/services

Various files have been edited so I’d recommend that you reboot the Raspberry Pi around now. If you only have Apple devices, that’s it, you’re done- hopefully, everything should work. In my experience, I’ve found that the printer can be a little laggy and sometimes, it just doesn’t bother printing certain jobs from my iPhone. Don’t let that put you off though- most of the time it works as expected. I’ve had no problems printing from my laptop or iPad.




Now, I’m aware some of you will want to use the Raspberry Pi to print from Windows machine. If you want to do this, you’ve got a few more steps to go. Before I go any further, I’ll say that I tested this with Windows XP only- things might be easier with Windows Vista/7/8. Maybe things will need to be done slightly differently, I don’t know.

Install Samba on the Raspberry Pi which allows cross-platform file/printer sharing (basically allows Linux and Windows file systems to connect to each other)

sudo apt-get install samba

Navigate to the samba config file which can be found at- /etc/samba/smb.conf. Ensure it contains the following data:

	# CUPS printing.  See also the cupsaddsmb(8) manpage in the
	# cupsys-client package.
	   printing = cups
	   printcap name = cups
	   comment = All Printers
	   browseable = no
	   path = /var/spool/samba
	   printable = yes
	   guest ok = yes
	   read only = yes
	   create mask = 0700
	# Windows clients look for this share name as a source of downloadable
	# printer drivers
	   comment = Printer Drivers
	   path = /usr/share/cups/drivers
	   browseable = yes
	   read only = yes
	   guest ok = no




You’re now finished with the Raspberry Pi. Again, I’d reboot it anyway, just to ensure that all appropriate files are running with the configuration that you’ve entered.

So, you want to print in Windows, eh? Here it goes-

I’ll reiterate, I used Windows XP. Things might be different in Vista/7/8

Install the drivers for your printer

Navigate to My Computer > View workgroup computers > Raspberrypi server > Printername

A few dialogue boxes may appear but they should be ok

Select the appropriate driver from the list of printer drivers that appears and click ok

The printer attached to the Raspberry Pi will now appear in the control panel under printers and faxes

My printer constantly displays “access denied, unable to connect” but it still works anyway (I’ve got no idea why)

Finally, try and print something- the new printer will appear in the list of available printers. Fingers crossed, you should now be able to print from Windows too!

This tutorial is based on content from a few other sources:
Configuring the Raspberry Pi as an AirPrint Server
iOS6 Doesn’t Recognise CUPS Print Shares
Printserver for Windows Clients

Edit- I’ve noticed this tutorial was ripped to shreds by a user on Reddit earlier in the year, so I thought I’d clarify a few things. The distro I used was Raspbian (my previous posts about my Raspberry Pi show the version I used). Technically the tutorial is not Raspberry Pi specific and should work on other Debian distros too however, the Pi is neat wee computer to turn into a print server. Yes, I typed “sudo apt-get install” multiple times, instead of installing packages using just the one line, but I’ve mentioned in previous posts that I was a Linux n00b at the time.

On the positive side, thank you to everyone who has posted comments about the guide on my blog :). I must have done something right if so many of you got wireless printing to work! A few of you have mentioned that some of the packages are no longer necessary when setting up the printer- I’m considering putting an updated guide together to make it easier for folks.


  1. thnx!! :)

    I’ll try that tonight

    Comment by yupsolo — January 16, 2013 @ 3:35 pm

  2. I works. Oh happy day! Thanks for the hard work in putting instructions of that level of detail together.

    One issues. I have an Canon IP5000 I can see it and print fine. I added my aging HP IV Plus and I still see only the one printer. do I have to add more statements to airprint.types to see the other printer?

    Comment by Bil Webb — January 27, 2013 @ 5:26 pm

  3. very nice. ill give it a go

    Comment by richard dunne — January 31, 2013 @ 3:05 pm

  4. You might have to add more types to AirPrint- at the moment, can you see the older printer under Linux (just to prove the issue is with AirPrint)?

    Comment by Lynsay — February 2, 2013 @ 7:21 pm

  5. Thanks for the instructions. Very useful. A couple of points:

    One line states:
    The ServerAlias * directive needs to be added before the first occurence of…
    But finishes without saying where. I put the server alias at the top, and that seemed to work.

    On the latest iOS 6 patch I had to make one other change. The .service file needs to have URF=none changed to become URF=DM3. No idea why, but it’s recommended in other forums and once I’d done that, my iPhone 5 worked happily.

    Comment by Dan Towner — February 14, 2013 @ 11:53 pm

  6. Thanks for that Dan!

    Comment by Lynsay — February 15, 2013 @ 10:13 am

  7. Well, it’s not a complete bible on the subject but you have well written this brief article and i am sure many will enjoy reading it.

    Comment by Rasberry Pi — February 20, 2013 @ 5:24 pm

  8. Useful info about Samba. I got CUPS up and running and can print from Windows using the RasPi’s IP address (which I’ve set up to be static). But Samba discovery would be cleaner.

    Comment by Mike Alexander — February 21, 2013 @ 4:33 pm

  9. hello,

    It is actually much simpler than that!
    I did it this morning, and all you have to do is install cups.
    Current cups version support airprint out-of-the-box, so you don’t need asahi or any script…
    So you can follow these steps, installing only cups package (I installed also cups-pdf), and configuring only cups, and it works…

    Comment by Maxime — March 7, 2013 @ 3:15 pm

  10. Well done! I’m a Linux novice and usually have to spend lots of time resolving unexpected issues following tutorials. Following this one presented the rare exception – it worked exactly as described on my Pi. Thanks very much.

    Comment by Marc Kline — March 23, 2013 @ 4:14 am

  11. Hi Lynsay,

    In the line that says: “CUPS will need to be told to be used with any hostname, so it can work with AirPrint. The ServerAlias * directive needs to be added before the first occurence of”…

    .. there’s nothing at the end of that line.

    Should there be?



    Comment by Mark Berthelemy — March 23, 2013 @ 5:00 pm

  12. You’re right Mark! is supposed to be at the end of that line. Have updated the post :)

    Comment by Lynsay — March 23, 2013 @ 5:08 pm

  13. I’m running RaspBMC and wanted my Rasp PI to double up as an Airprint server as well as an XBMC box so I’ve tried following your guide but when I try to browse to the CUPS web page I get a Forbidden error in the browser page.

    Any ideas what may be causing that?

    Comment by John O'Connell — April 1, 2013 @ 1:56 pm

  14. Managed to solve the issue using the second answer from http://ubuntuforums.org/showthread.php?t=1446262

    Comment by John O'Connell — April 1, 2013 @ 5:42 pm

  15. My printer is directly attached with raspberry pi with usb, it is discoverable and all(even printing), but not printing pdf files from my windows machine.

    I have already tried installing the cups-pdf package but no luck. Any idea how to make that work ?


    Comment by Manasvi Sareen — April 7, 2013 @ 7:43 am

  16. Hi Lynsay – thanks for a great guide – I will be doing this as my next project… just wandering if you think that the Model A Pi with half the RAM would be upto the same job? It’s about £12 cheaper now, so I am tempted to save cash as I will be buying it just as a print server.

    I guess it would just add a little more lag to the print jobs, right?



    Comment by Andrew — April 11, 2013 @ 8:37 am

  17. I think it would lag a bit more. I have the model B version and sometimes, I’ve noticed the print jobs can be a little bit slow. I guess you could always overclock it to speed things up a little (I’ve now set mine to the first overclocking setting in the Raspbian config)?

    Comment by Lynsay — April 19, 2013 @ 9:31 am

  18. […] http://www.lynsayshepherd.com/blog/?p=1340 […]

    Pingback by Wireless printing for Raspberry Pi | 0ddn1x: tricks with *nix — April 19, 2013 @ 6:58 pm

  19. Thanks for a very clear guide. Just a couple of questions:

    1. My printer is already on my LAN, via its Ethernet interface, and it will stay that way. Would any of the steps be substantially different for a networked printer as opposed to a USB-connected printer?

    2. Somebody commented here that it’s not necessary to install half of the stuff you did – what’s your response to that?



    Comment by FreeHD — April 20, 2013 @ 9:27 am

  20. I have an old “B” board with 256 MB of RAM and it’s happily serving a cheap Samsung ML-2010 following this post. It does seem to choke on big complicated PDF files, but prints receipts and other web stuff just fine.

    Comment by Chris — April 27, 2013 @ 2:13 am

  21. It’s worth restarting any recalcitrant tablets as well as the CUPS server if any difficulty in printing is found.Originally tested the server install with my Ipad1 on iOS 5.1.1 then did the iOS6 additional config whereupon my new Ipad4 on iOS 6.1.3 worked straightaway but an Ipad mini also on 6.1.3 didn’t, solution found on another blog was restarting the tablet – doh !, if the mini had been some Windows client I would have rebooted as a matter of course

    Comment by neil — April 27, 2013 @ 11:55 am

  22. Fantastic tutorial, worked flawlessly! We are now printing via the raspberry Pi from Windows 7 machines. Thanks!

    Comment by RB — April 29, 2013 @ 1:41 pm

  23. Simon- I’m imagining it would be easier to connect the printer if it was already on the network- just a case of letting the Pi access it. I noticed the comment saying that it wasn’t necessary to install some of the components I’ve mentioned. To be honest, I haven’t tried installing it with fewer packages.

    Neil- I wouldn’t have thought of restarting a tablet either 😉

    Comment by Lynsay — April 30, 2013 @ 2:54 pm

  24. Really love this post! Excellent work! Based on your
    instructions I’ve created a plug and play image which can be
    download from my public dropbox.
    https://www.dropbox.com/sh/cjrcfw49sfc7h8b/U6N_69Ll7b/Images I’ve
    included it in my Blog as well.

    Comment by racer993 — May 3, 2013 @ 4:25 pm

  25. […] I used the instructions from this website.

    Pingback by How to use your Raspberry Pi as Airprint Server. | raspberrypi4dummies — May 3, 2013 @ 7:55 pm

  26. Perfect tutorial! thanks! To get rid of the “access denied,
    unable to connect” error in windows, you should set following
    variable in the smb.conf file: section: [printers] use client
    driver = yes

    Comment by Peter — May 24, 2013 @ 1:43 pm

  27. What about wireless printing for Android devices? Will it work? Do we have to use apps/special protocols?

    Comment by Filippo — July 22, 2013 @ 10:04 am

  28. It’s true. CUPS has been updated and one only needs to install “sudo apt-get install cups” and follow the CUPS specific configuration steps in this note. All the other packages aren’t required or are included int he CUPS install already.

    I just confirmed this on my Model B Pi. Great write up!

    Comment by CMB — August 30, 2013 @ 5:33 am

  29. Also, it worked for me using a HP Photosmart 4700 wifi printer. So, one doesn’t have to be connected to USB for this to work.

    Comment by CMB — August 30, 2013 @ 5:34 am

  30. Would this work with Brother MFC-6490CW? I know it has wifi but it doesn’t have AirPrint.

    Comment by D — September 8, 2013 @ 7:42 pm

  31. It would be worth a shot to see if it works!

    Thanks for all the comments folks- good to know that CUPS makes things easier now.

    Comment by Lynsay — September 15, 2013 @ 12:15 am

  32. Great help to a newbie mature user, got wifi printer working from pi first time, Windows 7 also connects as before, will pluck up courage to have a go at connecting ipad soon!

    Comment by Rob — October 24, 2013 @ 5:03 pm

  33. Printed from i-pad with great success, once airprint was installed it gave me the option of going straight to the printer or through the pi, did both with ease, thanks once again.

    Comment by Rob — October 25, 2013 @ 10:35 am

  34. I been adding to a cut down Ubuntu (xbmcuntu xbmc.org)
    Into a virtual machine, works great in the sites, I installed 10 or more times now,
    Also adding tightvnc for remote admin,
    But only need the cups page :631 really.
    Konica works on generic pcl6 driver.

    Love this easy guide,
    Can also add things like timemachine and plex servers to the same box.

    Image zips to 2.5gig. Export hyperv


    Comment by Thanks great job. — November 21, 2013 @ 7:19 pm

  35. Thanks folks :)

    Comment by Lynsay — November 24, 2013 @ 1:48 pm

  36. […] Now down to business. Here are the steps I followed using this tutorial: […]

    Pingback by Setting up My Raspberry Pi as a Print Server with AirPrint Support / Journal — March 30, 2014 @ 3:36 pm

  37. Hi, excellent article. Got it up and running in no-time. You saved me a lot of newbie issues. Thanks, Robert

    Comment by Robert Mosbach — March 31, 2014 @ 12:53 pm

  38. It worked straight out of the box, as it were, after following your instruction, but it’s slooooooooowwwwwww to print.

    I will cut down Raspbian and redo it using only CUPS and see how that works out.

    Comment by Mike — April 7, 2014 @ 11:13 am

  39. Can you explain how to connect via windows 7? I’m a little bit confused.

    Comment by Theo — May 6, 2014 @ 2:22 pm

  40. Just Brilliant! Went off without a hitch – Bravo Lynsay, thanks!

    Comment by Tony — May 12, 2014 @ 12:27 pm

  41. Thanks for the guide. I’ve tried and read several pages concerning CUPS and Airprint on the Pi.

    On my recent install i found that Airprint worked right out of the “box”, when i made a default cups (v1.5.3) install. Only changes made in cupsd.conf was ‘Allow @Local’ and ‘Port 631’. I then added the printer via webinterface and airprint worked right away.

    Concerning Windows print, i would recommend skipping samba, and just install the printer in windows with the IPP protocol. Run the Windows Add Printer wizard, select Network Printer and then enter the URL in the following syntax:


    This works on XP and newer.

    Comment by Brian — May 15, 2014 @ 9:59 pm

  42. I’ve been using Windows recently and I used it as a network printer. Definitely the easiest way :)

    Comment by Lynsay — May 16, 2014 @ 10:38 am

  43. Thanks for the tutorial. Worked first time for a canon i850 and an Epson CX6900F (DX7000F driver). Host is an old dell laptop with Debian Wheezy. Now to get a Raspberry Pi to reduce power usage and size

    Comment by BrianAus — June 30, 2014 @ 1:22 pm

  44. The easiest way to install the printer on Windows would be to install Bonjour Print Services on the Win machine. Once that’s installed, it will discover and walk you through the install. It works on XP and newer.


    Comment by Paul — August 13, 2014 @ 9:51 am

  45. Hi

    Tx for a great tutorial :-)
    I got the Rasp and cubs server to work…

    BUT I seem unable to print !!
    I have a Xerox 6010N – and the driver do not show up in the list in cubs admin.
    I have tried to download the ppl file..
    but nothing comes out of the printer :-(

    In admin. it says:
    Idle – “File “/usr/lib/cups/filter/Xerox_Phaser_6000_6010/XRM_MF” not available: No such file or directory”

    Any help ??
    Thanks in advance

    Comment by Steen — August 23, 2014 @ 4:24 pm

  46. Brilliant – thanks for the great instructions. This worked for me with a new B+, an HP ColorLaserjet and my iOS devices.

    Comment by Tadeusz F Letocha — September 14, 2014 @ 5:39 pm

  47. Dear Lyndsay,

    *Great* tutorial. Thank you so much.

    I followed the above steps for RPi setup and this worked without a single issue.

    When setting up printing from Windows 7, the process was:

    1) Open “Devices and Printers”.
    2) Click “Add a printer”.
    3) Select “Add a network, wireless or Bluetooth printer”.
    4) Select “The printer that I want isn’t listed”
    5) Select a shared printer by name”. I entered \\RASPBERRYPI\MyPrinterName
    6) Select Next. and manually selected printer driver name.
    7) Printed test page – worked!

    All the best

    Comment by Roy — September 16, 2014 @ 3:58 am

  48. Hi, thanks for this guide, it is fantastic !

    Comment by Gee — October 23, 2014 @ 7:19 pm

  49. […] Lynsay's Little World » Wireless Printing/AirPrint Server via the Raspberry Pi. […]

    Pingback by Lynsay’s Little World » Wireless Printing/AirPrint Server via the Raspberry Pi | Vogt Network Solutions — November 2, 2014 @ 7:22 pm

  50. Hey Linsay

    Great work just had problems with my pi not printing from cups… Your little blog guide sorted it I am a very happy bunny well done


    Comment by Martin — January 7, 2015 @ 7:11 pm

  51. Many thanks, worked for me….

    It did not work just with CUPS for some reason i.e. not out of the box as someone said, for some reason! I would love to know why…

    Comment by terryw — May 18, 2015 @ 11:49 am

  52. does this support only printing or it just creates a network interface to the USB endpoints already known by an “all-in-one” printer’s windows drivers for scanner and Fax functions, too?

    I assume that if the printers drivers are installed on my Window’s PC, the R-Pi is just making the now-networked printer just look like it’s connected and the driver doesn’t care.

    so scanning and Fax and all other supported functions work the same? right?

    or this is a one-way print service only?

    Comment by PeteT — June 2, 2015 @ 8:23 pm

  53. Scanning won’t work I’m afraid- CUPS only handles printing.

    Comment by Lynsay — June 8, 2015 @ 11:47 am

  54. HI,

    I have setup an environment using pi (and CUPS) at home and it prints perfectly well (docx, xlsx etc) except for PDF format.

    I tried printing PDF formats and there are no errors nor response from printer. BTW, I am using a brother MFC.

    I have tried tried CUPS-PDF and it is not printing too.

    May I know if anyone encountered such issues and how to go about resolving it.


    Comment by cal — August 27, 2015 @ 1:00 pm

  55. […] NOTICE: This blog post is based on my original post from 2012 which you can find here- http://www.lynsayshepherd.com/blog/2013/01/14/wireless-printingairprint-server-via-the-raspberry-pi/. […]

    Pingback by Lynsay's Little World » Wireless Printing/AirPrint Server via the Raspberry Pi [updated guide] — October 18, 2015 @ 2:07 pm

  56. Thank you so much! This guide was very easy to follow and it even found my antiquated printer automatically over wireless :) No more having to pull the laptop out just to print something- Straight from phone! 😉

    Comment by Ben Gillam — November 8, 2015 @ 9:24 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

Note: Comments will not appear on the website until they have been moderated.