How to Disable the Ubuntu ‘CUPS’ Print Server Service on Servers

The Unused Print Server

CUPS (Common UNIX Printing System) is the standard printing system for Ubuntu and most other Linux distributions. If you install the standard Ubuntu Desktop version, CUPS is installed and enabled by default, running as a background daemon (cupsd) listening on port 631 so you can easily connect to local or network printers.

However, if you are running an Ubuntu Server for web hosting, databases, or API endpoints, or if you have a desktop machine that will absolutely never be connected to a physical printer, the CUPS daemon is a waste of system resources. More importantly, having an unnecessary service listening on a network port is a potential security vulnerability. You should disable it.

How to Disable the CUPS Service

You can turn off the printing daemon using standard systemctl commands.

  1. Open your Ubuntu Terminal (or connect via SSH).
  2. First, stop the service if it is currently running:
sudo systemctl stop cups.service
  1. Next, disable the service so it does not attempt to start the next time the system boots:
sudo systemctl disable cups.service
  1. CUPS also uses a socket for local communication. You must stop and disable the socket as well to prevent the service from being accidentally woken up:
sudo systemctl stop cups.socket
sudo systemctl disable cups.socket
  1. Finally, to ensure no other dependent service can resurrect the print spooler, mask the service completely:
sudo systemctl mask cups.service

Your Ubuntu machine will no longer run the print daemon, freeing up a small amount of memory and closing port 631, resulting in a cleaner, more secure server environment.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.