Create and manage sites
Before you start
Install native Homebrew Nginx and a compatible PHP version using Initial Environment Setup. Start Nginx and the corresponding PHP-FPM service in Services. PortCradle needs a recognized Nginx sites include and a usable PHP-FPM loopback listener or Unix socket. The Add Site sheet lists the eligible installations.
Choose a name such as demo.test. The default for new sites is port 18080. The stock Homebrew Nginx listener PortCradle sets up for a fresh install uses 8080. You can use 8080 for your site too. On the same Nginx server, different hostnames can share a port. Use Use as default for new sites to remember your choice.

Register an existing project
- Open Sites → Add Site → Existing Project.
- Enter a name and select the Project folder and Document root. Choose the directory intended for browser requests, such as
publicfor Laravel or CodeIgniter. The document root must be the project directory or a directory inside it. - Enter the lowercase
.testhostname. Optionally enter comma-separated.testaliases. Choose a loopback port, Nginx installation, and PHP runtime. - Click Register Site and continue to Apply and verify the site.
For a quick PHP test, create a disposable folder and save this as index.php. Select the folder as both the project folder and document root.
<?php
echo 'PortCradle PHP check: ' . PHP_SAPI;
With Nginx routing requests through PHP-FPM, the browser should display PortCradle PHP check: fpm-fcgi.

Create a site from a starter
- Open Sites → Add Site and select WordPress, Laravel, or CodeIgniter 4.
- Choose an existing Parent folder and an unused New folder name. Enter a display name and
.testhostname, and pick the port, Nginx installation, and PHP runtime. PortCradle uses the new project’spublicfolder as the document root. - For Laravel or CodeIgniter, use Install Composer… if prompted and review the Homebrew changes. After installation, continue in the same Add Site form. Homebrew’s Composer package can bring in its own default PHP dependency. PortCradle runs the starter install with the PHP you select for that site.
- Click Create WordPress Site, Create Laravel Site, or Create CodeIgniter 4 Site. Wait for the download and setup before applying the configuration.
For WordPress, prepare a running MySQL or MariaDB server, an empty database, and a user with access to that database. PortCradle downloads WordPress from WordPress.org. After you apply the site configuration and open the site, complete the WordPress browser installer with your database details. For Laravel and CodeIgniter, configure database settings and run any needed migrations from the project.



Apply and verify the site
- Review Configuration opens after successful registration or starter creation. Read the proposed Nginx server block and click Validate & Apply. You can reopen the review from the site card. PortCradle checks the assembled Nginx configuration and reloads the service if it is running.
- Select Verify Site on the card. PortCradle tests the named route with a temporary loopback override. An HTTP 2xx or 3xx result confirms a response on that route. For the PHP example above, open it in the browser and check for the
fpm-fcgitext. - Choose Site Options → Set Up Hostname to give the browser a system mapping for the
.testaddress. Then use Open Site. It can also open the loopback IP when PortCradle verifies that the IP routes to this specific site.
If the card shows Configuration required, use Review Configuration and apply the changes before opening or verifying the site. If you receive an error, check that the selected Nginx and PHP-FPM are running and review Logs for the failed step. If Verify Site succeeds and the browser cannot resolve the name, complete hostname setup.

Set up the browser hostname
- On the card, choose Site Options → Set Up Hostname → Enable Hostname Helper if offered. This requires an Apple team-signed build. If macOS asks for background approval, click Open System Settings and allow PortCradle under General → Login Items & Extensions.
- Return to PortCradle, click Add Hostname, and approve the macOS administrator prompt if shown. The helper maps the primary hostname to
127.0.0.1. If the name already points elsewhere, review the conflicting entry before continuing. - Click Check Hostname, then Open Site. For example, with port 18080 the browser address is
http://demo.test:18080/. Any optional aliases you want to use in the browser need their own system mappings.


Change the port or use port 80
Use Site Options → Change Port… on the site card. Choose a port from Common Ports or enter a custom port, then click Change Port. PortCradle keeps the same site registration, backs up the configuration, validates the change, and reloads Nginx if running. Verify and open the new address.
For http://demo.test/ without a port in the address, choose 80 in Site Options → Change Port…. In Set Up Port 80, click Move Site to 8080 if offered. Apply the configuration and start Nginx, then choose Enable Port 80. Approve the helper in System Settings → General → Login Items & Extensions if asked. Click Check Again and complete Set Up Hostname if needed. The signed helper forwards loopback port 80 to Nginx on 8080 for sites using that listener.


Use trusted HTTPS
- Confirm the site works over HTTP and the hostname resolves to
127.0.0.1. Leave Nginx and PHP-FPM running. - Choose Site Options → Set Up HTTPS… → Prepare HTTPS. PortCradle creates certificate material for the site and configures Nginx on loopback port 8443. The HTTP address remains available. If this site already uses 8443 for HTTP, move HTTP to another port first.
- Choose Trust Certificate and approve trust in macOS. If PortCradle offers Open Certificate in Keychain, use the login keychain, open that site certificate authority’s Trust section, and set Secure Sockets Layer (SSL) to Always Trust.
- Choose Enable Port 443 if offered. Approve the signed helper in System Settings if asked, then click Check HTTPS. The helper forwards loopback port 443 to Nginx on 8443.
- Choose Open HTTPS and check that
https://demo.test/opens without a certificate warning. If port 443 is occupied, identify the service using it before retrying.
Use Site Options → Manage HTTPS… → Remove Trust… to remove this site’s trust from your account. Settings → Disable Port 443… affects all sites using that forwarding helper. Disable Port 80… affects the shared HTTP forwarding helper.


Link an existing database
Choose Link Database… on the site card. Select MySQL, MariaDB, Percona Server, PostgreSQL, or SQLite. For a server, enter the database name, host and port or absolute socket path, and the optional username. For SQLite, enter an absolute database file path. Choose Link Existing when offered, then Save Link.
The site card shows the engine, database, endpoint, and username when supplied. Use Edit Database Link… to change the record or Remove Link to clear it. Set the connection and credentials in the project.


Create a database and login
Open Link Database… or Edit Database Link…, select MySQL or PostgreSQL, and choose Create & Link.
- Choose a running local server and enter a database name. If a compatible Homebrew client is missing, use the install button in the form. Review the formula and continue in the same form when the installation finishes. An empty endpoint uses
127.0.0.1:3306for MySQL or127.0.0.1:5432for PostgreSQL. An absolute Unix socket path also works. PortCradle uses the client from a native Homebrew installation. Start MySQL from Services. In PostgreSQL’s Create & Link form, PortCradle starts the selected server on demand after an inline install and checks the form’s endpoint. For an installed server, click Start PostgreSQL. If the endpoint does not respond, check the displayed address and use Retry PostgreSQL Start. The form keeps your draft, and the server’s login startup policy is preserved. - Enter a database administrator username and password. MySQL needs permission to create databases and accounts and to grant database privileges. PostgreSQL needs permission to create roles and databases and assign the new role as the database owner.
- Enter a different username and password for the new site login. MySQL grants access on the new database only. PostgreSQL creates a login role and makes it the new database’s owner. Use printable ASCII for the new PostgreSQL password.
- Click Create Database & Link. PortCradle checks the new login against the new database before saving the site link. Enter the new database name, username, password, and endpoint in your project or WordPress setup page.
PortCradle records the connection details and username. Passwords are used for the connection and cleared from the sheet when creation starts. If a database or account already exists, use Link Existing to record it or choose new names. If creation stops partway, check the resources named in the error before retrying.

Remove a site
Use Site Options → Remove Site… on the card to remove the registration and the Nginx configuration PortCradle owns. It saves a backup and reloads Nginx if running. Project files, database data, and hostname mappings are preserved. Remove Registration Only keeps the existing Nginx files when app-managed cleanup is unavailable. If you also want to remove macOS certificate trust for this site, use Remove Trust… before removing the registration.
