Skip to content

Flock

Flock is a local development environment for Laravel and other PHP projects. A background daemon runs PHP, Node, databases, mail and trusted HTTPS as native processes on macOS, Windows and Linux. It does not use Docker, a VM or file sync. Licensed AGPL-3.0 (verified 2026-11-03).

  • An embedded Caddy web server on ports 80 and 443 passes requests to PHP-FPM on macOS and Linux, or to a pool of php-cgi workers on Windows (introduction)
  • An embedded DNS server answers for *.test, so new sites work without editing the hosts file
  • Flock serves public/index.php when a project has one (Laravel, Symfony, Statamic, Craft). Otherwise it serves the project folder, which covers plain PHP and static sites
  • Parking and linking: flock park ~/Work serves every subfolder as <folder>.test and picks up new projects automatically. flock link adds a single project
  • HTTPS: a local CA with a root that is name-constrained to the local TLD and localhost, so a leaked key cannot sign certificates for real domains. PHP’s CA bundle and the Node shims (NODE_EXTRA_CA_CERTS) trust it, so HTTPS calls between local apps work
  • On Linux the command is flk, because /usr/bin/flock is the system file-locking tool. Flock’s own flock comes first on PATH after setup (installation)

PHP 8.1–8.5 are installed side by side. On macOS and Linux Flock ships its own builds with PHP-FPM and leaves the distribution’s PHP alone. On Windows it uses the official thread-safe builds from windows.php.net plus extra extensions. The php, composer, node, npm and npx shims resolve the version per project.

Project versions are set in two ways:

  • Pin — writes the version into the project: .flockrc for PHP, and .nvmrc or .node-version for Node. Commit it so the team shares it
  • Isolate — overrides the version for one site, on this machine only, and writes nothing into the project
Terminal window
flock pin php 8.5 # write to .flockrc
flock isolate php 8.4 # this machine only
flock unisolate php # follow the project again

.flockrc holds key=value lines and is looked up from the current directory upwards, like .nvmrc.

  • flock ext lists the extensions a project requires in composer.json and composer.lock. For Laravel apps it also reads .env and config/ for extensions used without being required, e.g. DB_CONNECTION=pgsql needs pdo_pgsql
  • flock ext add pdo_pgsql adds ext-pdo_pgsql to composer.json
  • A site can run on FrankenPHP instead of PHP-FPM, in classic mode or in Laravel Octane’s worker mode. Requires PHP 8.2+
Terminal window
flock frankenphp on acme --octane # Octane worker mode
flock frankenphp restart acme # reload changed code into the workers
flock frankenphp off acme # back to PHP-FPM

Services install from the app or CLI, listen on 127.0.0.1 and can use a non-default port, so MySQL and MariaDB can run side by side:

Terminal window
flock services install mariadb 11.8 --port 3307
flock services create-db # PostgreSQL, MySQL and MariaDB
Service Type Default port
PostgreSQL Database 5432
MySQL, MariaDB Database 3306
MongoDB Database 27017
Valkey (Redis on macOS only) Cache, queue 6379
Meilisearch Search 7700
Typesense (macOS, Linux) Search 8108
RustFS S3-compatible storage 9000
  • Mail — catches outgoing mail on SMTP port 2525
  • Dumps — a dump server on port 9912 collects dumps, queries and logs and links each one to the first file outside vendor/ that caused it
  • Xdebug — loads only for requests that ask for it, e.g. ?XDEBUG_TRIGGER=1. The IDE listens on port 9003 and needs no path mappings because PHP runs directly from the project folder
  • flock share — opens a Cloudflare quick tunnel with a random trycloudflare.com URL, no account needed. It ends when stopped, after 8 hours, or when Flock stops. --allow <email> limits access to people who confirm a one-time code sent by email. Visitors get the production build from public/build, never the Vite dev server, and dotfiles such as .env are blocked
  • MCP server — flock mcp install gives agents site URLs, logs, mail, dumps and required PHP extensions. Agents can also switch PHP versions, HTTPS or FrankenPHP
  • flock boost — writes .ai/guidelines/flock.md and runs php artisan boost:update, so Laravel Boost adds Flock to the agent guideline files
Platform Requirements
macOS 15 Sequoia or newer, Apple silicon only
Windows 10 (2004+) or 11, x64, Microsoft Visual C++ Redistributable
Linux Ubuntu 24.04+ or current Fedora (x64, arm64), Arch via AUR flockphp-bin (x64); systemd-resolved as the DNS resolver