Skip to content

Port 80 or 443 is in use

rexenv names what is holding a port rather than reporting a generic failure to start. From a terminal:

Terminal window
rex doctor
Terminal window
sudo lsof -nP -iTCP:443 -sTCP:LISTEN
sudo lsof -nP -iTCP:80 -sTCP:LISTEN

sudo matters here: without it you will not see processes owned by root, and the thing holding 443 is usually owned by root.

What How to stop it
Homebrew nginx sudo brew services stop nginx
Homebrew httpd sudo brew services stop httpd
Laravel Valet valet stop
Herd Quit it from the menu bar
Docker publishing 80/443 Stop the container or remap its ports
macOS Web Sharing System Settings → Sharing

A different problem with the same-looking symptom: nothing is holding the port, rexenv just is not serving yet. Start all in the app, or:

Terminal window
rex start

The two cases are told apart on purpose, because sending someone hunting for a program that is not running is worse than saying nothing.

Terminal window
rex restart

The edge re-binds on start. It does not poll for the port becoming free.