Print Wirelessly from iOS (AirPrint), Android, macOS, Linux, Windows on an Old USB Printer


For this setup we will need the following


  • Old computer on which we’ll install Ubuntu 22.04 / 20.04 (In this seup we’ll be using a 12 year old, headless PC with a dual core processor, 4GB RAM, 128GB SSD, 100Mbps NIC)
  • n

  • A Working USB Printer from any leading brand (HP, Epson, Samsung, Canon etc) as drivers are easily available for them (In this setup we’ll be using HP MFP 1005)
  • n

  • Basic knowlege of Command Line Interface
  • n



We’ll start with setting up CUPS. CUPS (Common Unix Printing System) is the default printing system on Linux, FreeBSD, and macOS. Your Linux / macOS environment may have a dedicated printer configuration utility, but they all use CUPS under the hood.

Michael Sweet, started developing CUPS in the year 1997. In Feb 2007, Apple Inc hired him and purchased CUPS Source Code.


We’ll be sharing CUPS Printer on the network via the following protocols


  • Bonjour + IPP: Bonjour, also known as mDNS/DNS-SD (multicast DNS/DNS service discovery), allows a computer to find services on the local network. IPP (Internet Printing Protocol) is the transport protocol.
  • n

  • SMB: aka Samba, mainly used to share files and printers with Windows clients.
  • n

  • AirPrint: Allows iPhone, iPad, and macOS clients to print over Wi-Fi.
  • n

These 3 protocols basically cover almost all the Operating Systems (iOS (AirPrint), Android, macOS, Linux, Windows) in use these days.


Connecting to Print Server

Connect the Print Server to your network via LAN Cable.


Connect your smartphone to the same network via WiFi.


Run a network scan via Fing app.


Note down the IP Address of the Print Server.


Ubuntu Server Edition has SSH installed by default, for Desktop Edition you’ll have to install OpenSSH Server from GUI with this command

sudo apt install openssh-server

Now ssh into the server with this command

ssh your_username@ip_address

your_username is the computer username you entered while installing Ubuntu.


ip_address is the IP Address you got with network scanner.


Enter the password when prompted.


Installing CUPS

Ubuntu desktop edition has CUPS pre-installed. If you use Ubuntu server edition, you need to run the following command to install CUPS from the default Ubuntu repository.

sudo apt install cups

Then start CUPS.

sudo systemctl start cups

Enable auto-start at boot time.

sudo systemctl enable cups

Check its status:

systemctl status cups

Sample output:


Placeholder for Screenshot


Next, edit the CUPS main configuration file with a command-line text editor like Nano.

sudo nano /etc/cups/cupsd.conf

First, we need to show shared printers on the local network. Find the following line.

Browsing Off

Change it to

Browsing On

so other computers in the same network can see printers connected to your Ubuntu computer.


By default, the CUPS web interface is only available at localhost:631. If you are running Ubuntu server edition, you may also want to make CUPS listen on all available network interface, so that you will be able to access the CUPS web interface from other computers. Find the following line.

Listen localhost:631

Change it to

Port 631

So CUPS will listen on all network interfaces. Then find the following lines.

n  Order allow,denynn

The above configuration allows access to the CUPS web interface from localhost only. To allow access from other computers in the same network, add Allow @LOCAL to the configuration like below.

n  Order allow,denyn  Allow @LOCALnn

Also add it for the /admin directory to allow remote administration from local network.

n  Order allow,denyn  Allow @LOCALn

You can also allow a particular IP address like so:

n  Order allow,denyn  Allow

Save and close the file. Then restart CUPS for the changes to take effect.

sudo systemctl restart cups

Note that if you have enabled the UFW firewall on Ubuntu, you need to allow clients in the same network to access port 631 on your Ubuntu box. For example, my private network is using the ~ network range, so I run the following command.

sudo ufw allow in from to any port 631

The CUPS web interface is available at https://ip_address:631. Add your user account to the lpadmin group in order to make changes in the CUPS web interface.

sudo adduser your_username lpadmin


Installing Printer Drivers in CUPS


Installing HP Printer Drivers is very straightforward

sudo apt install hplip

If You have any other printer like Epson, Canon, then install printer-driver-gutenprint package,

sudo apt install printer-driver-gutenprint

If you have other printers, you can find drivers on


Setting up the Printer in CUPS

Next goto https://ip_address:631 on your web browser.


It will open up the CUPS Web Interface. Now add your printer in the “administration” section. Add Printer, Select your model from the list of available printers. Click Next and select the location where the printer will be kept physically (not mandatory though).


Next leave the default options as it is. Save and take a test print.


Share CUPS Printer via Bonjour/IPP Protocol, Avahi (AirPrint), Samba


…. To be continued

Leave a Reply

Your email address will not be published. Required fields are marked *