Product Hunt🚀 We are live on Product Hunt! Support our launch & use code PHLAUNCH20 for 20% off Pro→
Stratosv1.7.0
Troubleshooting & Fixes• 3 min read

Why Laravel Sail & Docker Are Slow on macOS (And the Native Fix)

Fix slow page loads, high CPU usage, and VirtioFS file sync latency with Laravel Sail on Apple Silicon MacBooks.


The Truth About Docker Desktop on Apple Silicon

If you're using Laravel Sail on macOS, you've probably noticed that a simple GET / request that takes 2ms in production takes 150ms to 400ms on your brand-new M3 or M4 MacBook Pro. When running test suites (php artisan test), hundreds of tests take minutes instead of seconds.

Why Is Docker File Sync So Slow on macOS?

Docker is fundamentally a Linux technology. On macOS, Docker Desktop runs a Linux virtual machine inside Apple's Virtualization Framework. When you mount your Laravel project directory into the container (via volumes: - '.:/var/www/html'):

  1. Every single PHP file read must cross the host-to-guest virtualization boundary via VirtioFS or gRPC-FUSE.
  2. A standard Laravel request inspects 500+ PHP files across the vendor/ directory, framework service providers, configuration files, and Blade templates.
  3. Each file lookup involves network socket IPC and kernel translation between macOS APFS and the Linux guest filesystem.
  4. Result: 10x to 50x slower I/O latency, audible MacBook fans, and massive battery drain.

Docker Sail vs. Stratos Native Swift Benchmark

Metric Stratos (100% Native Swift) Docker Desktop (Sail / VirtioFS)
Average Page Latency 1.8 ms (Native APFS) 185.0 ms (Virtual VM Bridge)
Idle CPU Usage < 0.1% CPU 18% – 35% CPU (qemu/virtiofs)
RAM Footprint 62 MB 4,800 MB (Linux VM allocation)
MacBook Battery Life 10.5+ hours ~3.2 hours (battery drain)

How to Migrate from Laravel Sail to Stratos in 60 Seconds

You don't have to rewrite your application or delete your Docker files:

  1. Stop your Sail containers: ./vendor/bin/sail down
  2. Open Stratos and drag your project folder into the app.
  3. Stratos provisions local Nginx, links your .test domain, and generates a trusted green SSL certificate automatically.
  4. In your .env file, set DB_HOST=127.0.0.1 and REDIS_HOST=127.0.0.1.
  5. Visit https://my-app.test in Safari or Chrome and experience instantaneous sub-2ms response times.

Switch to Native macOS Development Free →