Port 80 or 443 already in use

On this page

Short Leash needs ports 80 and 443 on 127.0.0.1 to serve .test sites. If another program holds one, setup names it, and you quit that program yourself; Short Leash never stops other programs for you.

Which program is holding the port?

Setup shows its name. To check yourself on a Mac:

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

On Windows, in PowerShell:

Terminal window
Get-NetTCPConnection -LocalPort 80,443 -State Listen | Select-Object LocalPort, OwningProcess, @{n='Program';e={(Get-Process -Id $_.OwningProcess).ProcessName}}

What usually holds it?

Another web server (Apache or nginx you installed, or one that starts with your Mac), a container runtime publishing ports 80 or 443, or another local development app.

How do I free it?

Quit the program, or turn off its web server or port publishing. If it starts at login, turn that off too. Then choose Check again in Short Leash's setup.

Can Short Leash use other ports instead?

Before setup, Short Leash serves sites on fallback ports above 8000 so you can try it. For .test addresses without a port number, it needs 80 and 443. See Troubleshooting for other problems.