Ports
What a port is
Section titled “What a port is”When two programs communicate over a network, they use an IP address to identify the machine and a port number to identify the specific service on that machine. A Mac running both a web server and a database server has one IP address but multiple ports – one for each service.
Think of it like a building: the street address (IP) tells you which building, and the apartment number (port) tells you which unit inside.
Port numbers range from 0 to 65535. Many common services have established default ports that software assumes when no port is specified:
| Service | Default port |
|---|---|
| HTTP (web) | 80 |
| HTTPS (web, encrypted) | 443 |
| MySQL | 3306 |
When you type http://example.com in a browser, the browser silently connects to port 80. No port number appears in the address bar because 80 is the understood default.
Why MAMP PRO does not use port 80 by default
Section titled “Why MAMP PRO does not use port 80 by default”On macOS, ports below 1024 are privileged ports. Only processes running with administrator rights can open them. If MAMP PRO used port 80, macOS would ask for your admin password every time the servers start.
MAMP PRO avoids this by defaulting to port 8888 for Apache and 8889 for MySQL. Both are well above 1024 and can be opened by a normal user process without elevated permissions. This also means MAMP PRO’s servers can run alongside other servers already installed on your Mac without port conflicts.
The only visible consequence is that you have to include the port number in local URLs:
http://localhost:8888/my-project/instead of just:
http://localhost/my-project/When to change the ports
Section titled “When to change the ports”You may want to switch to ports 80 and 3306 in two situations:
- Your project hardcodes port 80. Some CMS configurations or scripts assume the web server is on the standard port and break when they see
:8888in a URL. - You want URLs without a port number. Some developers prefer
http://localhost/for a cleaner address bar.
You can configure all ports under Settings › Server › Ports.