This post shows students and new users the steps to configure the CUPS print server on Ubuntu Linux. CUPS allows a computer to act as a print server. Provides a Unix-like mechanism in the operating system for printing and print services.
In multi-printer environments, the CUPS print server can be used to manage and manage print jobs. CUPS supports printing, queuing, network printing (via IPP), supports a wide range of printers, automatic network printer detection, web management, and more.
For businesses and individuals looking for an affordable print server, CUPS should be considered especially when it comes to large printers. And if you need help installing and configuring CUPS, the steps below will show you how.
Also, for students and new users learning Linux, the easiest place to start learning is Ubuntu Linux. Ubuntu is the modern open source Linux operating system for desktops, servers, and other devices.
To start installing and configuring CUPS on Ubuntu Linux, follow the steps below.
How to install CUPS on Ubuntu Linux
As mentioned above, CUPS can turn any Unix-like operating system, including Ubuntu, into a print server. CUPS packages are included in the Ubuntu repositories by default, and installation is fairly straightforward.
To install CUPS on Ubuntu, run the following commands.
sudo apt update sudo apt install cups
Once CUPS is installed, the following commands can be used to stop, start, and enable the CUPS service to start automatically when the server starts.
sudo systemctl stop cups sudo systemctl start cups sudo systemctl enable cups
To verify that CUPS is installed and running, run the following commands.
sudo systemctl status cups
You should then see output similar to the following:
● cups.service - CUPS Scheduler Loaded: loaded (/lib/systemd/system/cups.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2021-08-15 01:31:30 WAT; 53min ago TriggeredBy: ● cups.socket ● cups.path Docs: man:cupsd(8) Main PID: 971 (cupsd) Status: "Scheduler is running…" Tasks: 1 (limit: 18958) Memory: 26.3M
How to configure CUPS on Ubuntu Linux
After installing CUPS above, you can configure CUPS its web interface in http: // localhost: 631 / admin.
If you prefer to use the command line interface, the CUPS configuration file is located in /etc / cups / cupsd.conf.
When using the command line to configure CUPS, run the following commands to create a backup copy of the configuration file.
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original
Then run the following commands to open the CUPS configuration file.
/etc/cups/cupsd.conf
You can then begin to configure the settings to suit your environment.
By default, CUPS listens on port 631.
#Listen localhost:631 Port 631
You can also make sure that browsing is enabled to allow CUPS to make shared printers available on the network.
Browsing On
Set the following directive to dnsd protocol (which supports Bonjour), by default it is enabled.
BrowseLocalProtocols dnssd
CUPS also restricts access to the printer server web interface and administration pages using the following directives. You can configure allow before deny to allow computers on the local network to access the CUPS web interface.
#Restrict access to the server <Location /> Order allow,deny Allow @LOCAL <Location> #Restrict access to the admin pages. <Location /admin> Order allow,deny Allow @LOCAL <Location>
If you prefer to configure using the CUPS web interface, it is recommended to use root or an authenticated user on the lpadmin group.
To add a user to lpadmin group, type:
sudo usermod -aG lpadmin username
Replace Username with the account you want to add to the lpadmin group.
When done, run the following commands to restart CUPS.
sudo systemctl restart cups
How to install printer drivers in Ubuntu Linux
Most HP printers are compatible with Linux systems, including Ubuntu. However, installing HP Linux Imaging and Printing Software (HPLIP) won’t hurt.
Run the following commands to install hplip on Ubuntu.
sudo apt install hplip
For CUPS to publish a shared printer, you may need to install avahi-demon. avahi-daemon is a Bonjour server that will transmit the information from your computer over the network.
sudo apt install avahi-daemon sudo systemctl start avahi-daemon
If you have the firewall enabled, you must also allow CUPS traffic through the firewall. You can run the following commands to enable CUPS through the Ubuntu firewall.
sudo ufw allow 631/tcp sudo ufw allow 5353/udp
How to add a printer in Ubuntu Linux
Now that CUPS is installed and configured, log into your Ubuntu machine and browse the CUPS print server and access the shared printers.
Here’s how to install printers on Ubuntu Linux. See the post below to learn how to add a printer to Ubuntu.
How to add printers to Ubuntu Linux
You should do that!
Conclusion:
In this tutorial we have seen how to install and configure CUPS on Ubuntu Linux. If you find any errors above or have something to add, please use the comment form below.