CUPS stands for Common UNIX Printing System
There are two ways to manage your printers on Linux environment:
- First, from command line, using lpadmin command, you can configure your printer and manage the print queues
- Second, from web UI, you can manage your printers interactively
In one of our previous tutorial, we discussed about how to add new printer, change the printer settings, and manipulate print queues using 12 examples of lpadmin command on Linux.
In this quick tutorial, we’ll show you how you can allow web UI access for an existing CUPS installation.
Manage Printer from Web GUI
All the printer configurations & classes that we setup using lpadmin command line, can also be managed from your browser from the following location:
To configure this URL, you must do the following changes on your /etc/cups/cupsd.conf
Modify the cupsd.conf file, and do the following two changes:
- Comment-out this line: Listen localhost:631
- Add this line Port 631
# vi /etc/cups/cupsd.conf .. #Listen localhost:631 Port 631 Listen /var/run/cups/cups.sock ..
Allow Local Subnet to Access Printer Web GUI
Add the local desktop IP address or the subnet from which you want to access the printer URL, it should look like below in /etc/cups/cupsd.conf
# vi /etc/cups/cupsd.conf .. # Restrict access to the server... <Location /> Order allow,deny Allow 127.0.0.2 Allow your-desktop-client-ip-or-subnet </Location> ..
Note: In the above, change the “your-desktop-client-ip-or-subnet” to the ip-address of your desktop client. Instead of ip-address, you can also specify the subnet here.
Restart the CUPS Service
After making the above changes, restart the CUPS service as shown below.
# service cups restart Shutting down cupsd done Starting cupsd done
CUPS Web UI for Remote Access
After the above changes, you should be able to access the printer from Web URL as shown below:
The following displays all the printers that are connected to your Linux system.
Shared Printer Configuration
You can also enable or disable browsing support in your CUPS.
When you enable the browsing, then this will display the shared printers from your local network.
Add the following entries to your cupsd.conf file if you want Browsing to be turned on.
# vi /etc/cups/cupsd.conf .. Browsing On BrowseOrder allow,deny BrowseAllow all BrowseAddress your-desktop-client-ip-or-subnet ..
Note: Change the your-desktop-client-ip-or-subnet to your ip-address accordingly.
When you turn-off browsing, then polling will be enabled automatically. In this case, you’ll not be able to view all the shared printers from your local network. So, you have to poll for it manually.
# vi /etc/cups/cupsd.conf .. Browsing Off