In this tutorial, we will show you how to install CUPS Print Server on Ubuntu 20.04 LTS. For those of you who didn’t know, CUPS (Common Unix Printing System) is the primary mechanism in the Unix-like operating system for printing and print services. It can allow a computer to act as a Print server.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the CUPS Print Server on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
Install CUPS Print Server on Ubuntu 20.04 LTS Focal Fossa
Step 1. First, make sure that all your system packages are up-to-date by running the following
aptcommands in the terminal.
sudo apt update sudo apt upgrade
Step 2. Installing CUPS Printer Server on Ubuntu 20.04.
CUPS is installed by default in the Ubuntu Desktop. To Install CUPS on the Ubuntu server enter the following command below:
sudo apt install cups
After installing the CUPS print server, start the CUPS print service in the following command:
sudo systemctl start cups sudo systemctl enable cups sudo systemctl status cups
Step 3. Configure CUPS on Ubuntu.
Now we edit the CUPS main configuration file:
sudo nano /etc/cups/cupsd.conf
First look for the line:
Change that line to:
Next, find the “Only listen for connections from the local machine” section. Here, there will be an entry titled, “Listen localhost:631.” Change this to “Port 631,”:
#Listen localhost:631 Port 631
We also need to make sure that CUPS is listening on all interfaces. To do that, look for the section:
<Location /> Order allow,deny </Location>
Change the above section to:
<Location /> Order allow,deny Allow @LOCAL </Location>
Also, add it for the
/admin directory to allow remote administration from the local network:
<Location /admin> Order allow,deny </Location>
Change that section to:
<Location /admin> AuthType Default Require valid-user Order allow,deny Allow @LOCAL </Location>
Save and close the file. Then restart CUPS for the changes to take effect:
sudo systemctl restart cups
Once configure CUPS, Now we’re going to make sure the printer is shared out to your network using the Bonjour and IPP protocols. First, we need to install the avahi-daemon with the command below:
sudo apt install avahi-daemon
After installing the Avahi-daemon, start, and auto boot time using the following command:
sudo systemctl start avahi-daemon sudo systemctl enable avahi-daemon
Step 4. Configure Firewall.
If you have enabled a firewall make sure to allow the client’s machines to talk to CUPS port 631:
sudo ufw allow 631/tcp sudo ufw allow 5353/udp
Step 5. Connect to the Printer.
Now we add the printer will depend on the desktop operating system you are using. For example, with Ubuntu Linux, I can open up the Add Printer window from Settings | Devices and the new printer automatically appears.
At this point, your printer should be added to the desktop and able to print. Should you need to, you can manage both the printer and the server from the web-based console by pointing a browser to
http://your-server-ip-addrees:631. The admin console is at the address
https://your-server-ip-address:631/admin. For the admin console, you’ll be prompted for a valid username and password.
Congratulations! You have successfully installed CUPS. Thanks for using this tutorial for installing and set up CUPS Print Server on Ubuntu 20.04 LTS Focal Fossa systems. For additional help or useful information, we recommend you check the official CUPS website.