Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

Tips

Choosing your own ports in Server by Zaweba

The Ports card in Server by Zaweba's Settings lets you set the web, HTTPS, MariaDB and mail ports yourself and check them for conflicts first.

Choosing your own ports in Server by Zaweba

Ports are the numbered doors that local services listen on, and Server by Zaweba normally picks them for you: 80 for the web, 443 for HTTPS, 3306 for MariaDB, 1025 for mail sent from PHP and 8025 for the mail web page. When something else already uses one, the app offers a free alternative. But sometimes you want to decide for yourself, and that is what the Ports card in Settings is for.

What the Ports card holds

There is one box for each service: Web (HTTP), HTTPS, MariaDB, Mail from PHP (SMTP) and the mail web page. Type the numbers you want and press Save the ports to apply them. Each must be a whole number from 1 to 65535, and no two services may share one, so the card won't let you save a setup that couldn't work.

Next to the save button is Check for conflicts. It runs the same check as Services, Check ports: it looks at IPv4 and IPv6 listeners and tells you if any of your chosen ports is already taken, and by which program, with its name, process id, path and whether it is a Windows service.

When to choose ports yourself

The most common reason is living alongside another local server. If XAMPP or a similar stack is installed and you sometimes run both, giving Server by Zaweba its own set of ports for good means neither has to give way. Server's start-up check would offer free ports anyway, but fixing them in Settings saves the question every time and keeps your bookmarks stable.

Another reason is a tool that expects a particular port. An old project's configuration file might point at a database on a certain port, and it can be easier to match it than to edit the project. The same goes for test scripts or other programs on your PC that talk to the mail catcher.

Some people simply prefer high numbers, such as 8080 and 8443, so there is never a clash with anything Windows or another program might start later.

What changes when you move a port

If the web port isn't 80, a browser needs the port in the address, for example name.test:8080, so typed links and bookmarks need updating to match.

A MariaDB port other than 3306 needs to go into your sites' database settings, since PHP code usually assumes the standard one. The dashboard web page shows the MariaDB connection details, which is the quickest place to copy them from.

Mail is the easiest. Every php.ini that Server manages points SMTP and smtp_port at Mailpit, so PHP's mail() follows the new port without you touching any code.

Avoiding trouble

Check for conflicts before you save, especially with numbers you have picked by hand. Stay away from ports that another program you use regularly claims on start-up. And keep a note of what you chose; the status bar at the bottom of the window lists every port in use, which is handy when you have forgotten.

If you ever want the standard ports back, type them in again and save. The other program that caused the change is never stopped or touched by Server by Zaweba, so moving back only works once that program has let go of the port.