localhost:631: Using the CUPS Web Interface

Port 631 belongs to CUPS, the print system on macOS and most Linux distributions. Opening http://localhost:631 shows its admin pages for printers, queues and jobs. On a Mac the page is switched off by default, so you see 'Web Interface is Disabled' until you run cupsctl WebInterface=yes.

What you see at localhost:631 and why
MessageCauseFix
Web Interface is DisabledmacOS ships with it offcupsctl WebInterface=yes
Unable to connectcupsd is not runningsudo systemctl start cups
Forbidden on AdministrationYour user is not a print adminAdd yourself to lpadmin (_lpadmin on a Mac)
Asks for a passwordAdmin pages need a loginUse your own system account and password

Updated

Port 631 is also the registered port for IPP, the Internet Printing Protocol, which is why printers and print servers speak on it. CUPS reuses the same port for its browser interface, so one address both receives print jobs and lets you manage them.

Turn on and reach the CUPS interface

macOS and Linux

The first line is for macOS; the rest are for systemd-based Linux such as Ubuntu or Fedora.

# macOS: switch the web interface on
cupsctl WebInterface=yes

# Linux: start CUPS and allow your user to manage printers
sudo systemctl enable --now cups
sudo usermod -aG lpadmin "$USER"

When nothing answers on 631

A refused connection means the cupsd daemon is stopped or not installed. Minimal server images and some containers leave CUPS out entirely, so install the cups package first, then enable the service so it survives reboots.

If cupsd refuses to start, its error log under /var/log/cups/error_log names the bad line in cupsd.conf, which is usually a hand edit that went wrong.

Printing from a web app

Browsers cannot send jobs to port 631 directly from a page script, so web apps print through the browser's own print dialog. A restaurant menu or booking confirmation on a We.Inc site prints the same way, with window.print and a print stylesheet.

How it works

  1. Make sure the cups service is running on your machine.
  2. On a Mac, turn the web interface on with cupsctl, then reload the page.
  3. Open Administration, add the printer, and sign in with your own account when asked.
  4. Print a test page from the printer's page to confirm the queue works.

Tips

  • Linux desktops often add network printers automatically through cups-browsed, so check the Printers tab before adding one by hand.
  • Turning the web interface off again on a Mac is cupsctl WebInterface=no; system settings keep working either way.
  • If the browser warns about the certificate on https://localhost:631, CUPS is using its own self-signed one, which is expected for local admin.

Frequently asked questions

What is localhost:631?

It is the local web interface of CUPS, the Common Unix Printing System. From it you can add printers, change default options and cancel stuck jobs.

How do I enable the CUPS web interface on a Mac?

Open Terminal and run cupsctl WebInterface=yes. Reload http://localhost:631 and the full interface appears. No restart is needed.

Why does localhost:631 say Forbidden when I add a printer?

Administrative actions are limited to members of the print admin group. On Debian and Ubuntu that group is lpadmin; add your user with sudo usermod -aG lpadmin $USER and sign out and in again.

Can I reach localhost:631 from another computer?

Not by default. CUPS listens only on the local machine. Running cupsctl --remote-admin --share-printers opens it to the network, which you should only do on a trusted network.

Related: What is localhost, localhost refused to connect, Your connection is not private, localhost:80.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Guides

Product

Who It's For

Features

Resources

Company

View Sitemap