Port 9000

What’s running on port 9000 on my Mac?

Port 9000 is shared by tools that have nothing in common: PHP’s FastCGI process manager, an S3-compatible store, a code-quality server and a database. lsof sorts it out in one line.

Commonly used by

  • PHP-FPM (Homebrew)brew services start php runs php-fpm on 127.0.0.1:9000 for nginx or Valet.
  • MinIOS3-compatible API on 9000; the web console is set with --console-address.
  • SonarQubeThe web UI and API listen on 9000.
  • ClickHouseNative TCP protocol on 9000; HTTP interface on 8123.
  • Portainer (older setups)HTTP UI on 9000; current versions prefer HTTPS on 9443.

Check what’s on port 9000

lsof -nP -iTCP:9000 -sTCP:LISTEN
ps -o pid,command -p <PID>
COMMANDTool
php-fpmPHP-FPM (several worker processes share the socket)
minioMinIO
javaSonarQube (the command line mentions sonar)
clickhouseClickHouse server
com.docker.backend / OrbStackAny of these in a container: docker ps --filter publish=9000

With Stat Space: statspace port 9000.

Free it or move it

ToolStopChange the port
PHP-FPMbrew services stop phplisten = 127.0.0.1:9001 in php-fpm.d/www.conf
MinIOCtrl-C / docker stop--address :9100
SonarQubesonar.sh stop / docker stopsonar.web.port=9001 in sonar.properties
ClickHouseclickhouse stop / docker stop<tcp_port>9001</tcp_port> in config.xml

Laravel Valet doesn’t use 9000: it talks to PHP-FPM over a Unix socket. If you see php-fpm on 9000 alongside Valet, it’s a second, plain brew services PHP that you can probably stop.

Security

PHP-FPM must stay on 127.0.0.1. FastCGI has no authentication: anyone who can reach it can ask it to execute PHP files on your Mac, and with the right parameters, arbitrary code. Homebrew’s default config binds to localhost, so this mostly goes wrong when a guide tells you to use listen = 9000 (which binds all interfaces).

MinIO, SonarQube and ClickHouse ship with well-known default credentials (minioadmin, admin/admin, a passwordless default user). Published from Docker with -p 9000:9000, they’re reachable by everyone on your network. Use -p 127.0.0.1:9000:9000. See dev server exposed to the network.

Seeing it live

Stat Space lists 9000 with the process behind it and warns if it’s on *:9000. With Pro, Docker-published services show their container and image instead of com.docker.backend.

Questions

Why does Xdebug use port 9003 instead of 9000?

Xdebug 2 used 9000, which clashed with PHP-FPM on the same machine. Xdebug 3 moved its default to 9003, so update your IDE's debug port if you're following an old guide.

How do I change PHP-FPM's port on a Mac?

Edit listen = 127.0.0.1:9000 in /opt/homebrew/etc/php/<version>/php-fpm.d/www.conf, then brew services restart php. Point nginx's fastcgi_pass at the new port.

How do I run MinIO on another port?

Start it with minio server ~/data --address :9100 --console-address :9101, or change the Docker mapping, for example -p 127.0.0.1:9100:9000.

Get started

Know what your Mac is doing, without adding to it.

Free, no account. Pro is $9.99 once for the first 100 buyers.