It is primarily used to install and configure printers on a computer. It also allows you to submit jobs and receive results through a network client or local printing device.
CUPS is used in all Linux distributions, as well as most other UNIX like operating systems (such as Solaris and FreeBSD).
This article will show you how to set up a print server on Linux Ubuntu 20.04 with CUPS.
What is CUPS
CUPS is the acronym for Common Unix Printing System. It is a software printing system for Unix like operating systems and their counterparts, including Linux, OpenBSD, and Solaris.
CUPS is a suite of programs that together provide a flexible, scalable printing system. It provides an easy to use, user friendly interface for creating and managing printers and has several different print functions, including server and client based printing.
The CUPS print server has been designed to be a robust, scalable and secure printing system that can be used with a wide range of printers, including networked printers and those connected directly to the hardware (LPD).
CUPS was developed by Apple Inc. and support for CUPS in Linux has been growing steadily since version 1.1 in 1995. The latest stable release is 2.3.9 which supports a wide range of printers, including USB printers and networked printers.
Besides Linux, CUPS is also available on all major platforms, including Microsoft Windows, macOS, and Android.
How to Setup a Print Server on Linux Ubuntu 20.04 (CUPS)
Prerequisites
A network connection to the printer on a system running Ubuntu server 20.04
To access the printer, you will need a client version of Ubuntu or a server version.
Install CUPS Print Server on Ubuntu
Update your system to ensure all packages are updated.
sudo apt update
The Ubuntu Desktop edition is pre-installed with CUPS. Run the following command in your terminal to install CUPS on the Ubuntu server edition.
sudo apt install cups
Output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
cups is already the newest version (2.3.1-9ubuntu1.2).
cups set to manually installed.
…
Once CUPS is installed on your system, you need to start and enable the cups service on boot.
Run the following command to start the CUPS print service.
sudo systemctl start cups
Next, verify that the service is running as intended by checking the service status.
sudo systemctl status cups
Output:
● cups.service - CUPS Scheduler
Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: enable>
Active: active (running) since Sat 2022-06-18 09:28:45 PDT; 13s left
TriggeredBy: ● cups.path
…
You can also enable the CUPS service to run on boot with the following command.
sudo systemctl enable cups
Output:
Synchronizing state of cups.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable cups
Open the /etc/cups/cupsd.conf file in the nano editor using the following command.
sudo nano /etc/cups/cupsd.conf
First, go to the Only listen for connections from the local machine section in the file and add the following line to specify 631 as the default port.
#Listen localhost:631
Port 631
Next, go to the Show shared printers on the local network section of the file and enable Browsing On. This will show shared printers on the local network.
Browsing On
Set BrowseLocalProtocols to dnssd protocol.
BrowseLocalProtocols dnssd
Now, go to the Restrict access to the server section and add Allow @LOCAL to allow access to other computers on the network.
#Restrict access to the server
Order allow,deny
Allow @LOCAL
Similarly, add Allow @LOCAL under the Restrict access to the admin pages section.
#Restrict access to the admin pages.
Order allow,deny
Allow @LOCAL
Press Ctrl+O and Ctrl+X to save and exit the file.
Restart the CUPS service for the changes to take effect.
sudo systemctl restart cups
Add User to lpadmin Group
It is advised to use either root or a user authorized in the lpadmin group if you want to set up via the CUPS web interface.
sudo usermod -aG lpadmin
Install Your Printer Driver
On the majority of Linux distributions, printer drivers are already included. Use the following command to install the HP driver, if it is not installed.
sudo apt install hplip
For printers other than HP printers, you can consult openprinting.org.
Install Bonjour for CUPS Printer Sharing
You have to install the avahi-daemon, which is a Bonjour server that broadcasts information from your machine to the network and supports mDNS/DNS-SD service discovery.
The Bonjour (DNSSD) protocol aids in making printing a network-discoverable service.
You can install avahi-daemon using the following command.
sudo apt install avahi-daemon
Then, start and enable the avahi-daemon service on boot with the following command.
How to Setup a Print Server on Linux Ubuntu 20.04 (CUPS) Conclusion
In this guide, we have shown you how to set up a CUPS print server on Linux Ubuntu 20.04.
CUPS, or the Common UNIX Printing System, is a printing system for UNIX-like operating systems. It’s an open source software package that aims to provide a standard printing solution.
If you are interested in alternate solutions for printing, explore our content on printing.
Information Security professional with 4+ years of experience. I am interested in learning about new technologies and loves working with all kinds of infrastructures.
51vote
Article Rating
Subscribe
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.