How to Completely Disable the ‘CUPS’ Daemon (Print Server) in Ubuntu Linux

If you install the desktop edition of Ubuntu Linux (and frequently on the server edition, depending on the packages you select during installation), the operating system installs and activates the CUPS daemon by default. CUPS (Common UNIX Printing System) is an incredibly powerful background service developed by Apple that manages print jobs, schedules queues, and constantly broadcasts your machine’s ability to act as a print server across the local network over port 631.

While this is essential if you plan to plug a USB laser printer into your machine, it is completely useless bloatware for 99% of modern server deployments. If you are building a web server, a Docker host, or a dedicated gaming rig, you will never print a document from that machine. Leaving CUPS running needlessly consumes background RAM, opens an unused network port (631), and introduces potential security vulnerabilities if the print spooler is exploited by a malicious actor. To harden your system and free up resources, you must completely disable the CUPS daemon.

Stopping and Disabling the CUPS Service via Systemctl

Because CUPS is managed by the systemd init system, you can gracefully stop it from running and permanently disable it from starting at boot time.

  1. Open a Terminal session (or connect to your server via SSH).
  2. First, stop the daemon if it is currently running in the background:
    sudo systemctl stop cups.service
  3. Next, permanently disable the service so that it does not automatically launch the next time you reboot the server:
    sudo systemctl disable cups.service
  4. CUPS also uses socket activation (which means it will automatically start itself if something pings port 631). You must disable the socket as well:
    sudo systemctl stop cups.socket
    sudo systemctl disable cups.socket

Uninstalling CUPS Entirely (Recommended)

To guarantee that no future software updates or accidental print commands ever resurrect the daemon, you should purge the software from your hard drive.

  1. In the terminal, run the following command to completely uninstall the package and delete its configuration files:
    sudo apt-get purge cups cups-client cups-bsd
  2. Press Y when prompted to confirm the removal.
  3. Clean up any orphaned printer driver dependencies left behind:
    sudo apt-get autoremove

With CUPS completely eradicated from the system, your Ubuntu machine is now significantly more secure. Port 631 will be permanently closed, and your server will never waste another CPU cycle polling for non-existent network printers.

Get the best tech tips delivered straight to your inbox.

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