Toggle sidebar
From Laravel Sail to Serversideup + Traefik: A Smarter Local Development Setup

From Laravel Sail to Serversideup + Traefik: A Smarter Local Development Setup

Laravel Sail is a fantastic starting point for developers who want a quick, official way to run Laravel in Docker. It’s simple, consistent, and great for single-project environments.

But as your workflow matures — maybe you’re managing multiple apps, microservices, or need more control over routing and environments — Sail can start to feel a bit limited.

That’s where Serversideup/PHP and Traefik come in. Together, they offer a cleaner, more scalable approach to local development while staying 100% Docker-native.


🐋 Why Consider Moving Beyond Sail?

Sail is opinionated — which is both its biggest strength and its main constraint. It’s designed to “just work,” but it’s not built for everything.

Developers often outgrow Sail when they need:

  • ⚙️ Customizable service configurations (e.g. specialized PHP extensions, tuned Nginx configs)

  • 🌐 Centralized routing and domain-based access instead of random localhost ports

  • 🔄 Easier multi-project orchestration under a shared reverse proxy (Traefik)

  • 💼 A more production-like environment that mirrors your deployment setup

Sail’s simplicity is perfect for getting started, but the Serversideup + Traefik combo gives you the flexibility to design your local environment exactly how you want it.


🧱 Enter Serversideup/PHP + Traefik

Your new setup uses two key components:

  • Serversideup/PHP — a robust PHP-FPM + Nginx image that’s production-ready out of the box.

  • Traefik — a modern reverse proxy and load balancer that automatically routes traffic to your containers based on domain names.

This lets you access your local services like:

myapp.localhost  
adminer.myapp.localhost  
meilisearch.myapp.localhost

All clean, organized, and without the port juggling.


⚙️ How It Works

Your Docker Compose defines two main networks:

networks:
  app:
    driver: bridge
  proxy:
    external: true
  • The app network connects your app containers internally (Postgres, Redis, etc.).

  • The proxy network is shared across all projects — this is where Traefik listens for routes.

Each container you want publicly available has a few Traefik labels, such as:

labels:
  - traefik.enable=true
  - traefik.http.routers.${STACK_NAME}-web.rule=Host(`${APP_DOMAIN}`)
  - traefik.docker.network=proxy

These tell Traefik how to handle requests — for example, when someone visits myapp.localhost, the traffic automatically routes to your Laravel app.


🧠 The Benefits

🌐 1. Centralized Routing with Traefik

No more managing random ports or editing /etc/hosts. Each app can have its own local domain, and Traefik handles everything automatically — even HTTPS if you want.

🧰 2. Greater Customization

With Serversideup/PHP, you can easily tweak PHP settings, install extensions, or modify Nginx configs — all without touching Laravel Sail’s internals.

🧩 3. Production-Like Environments

This stack mirrors real-world production setups. What runs locally will behave the same way when deployed to staging or production.

🔀 4. Seamless Multi-App Development

Running multiple projects side-by-side? No problem. Traefik isolates routes by domain, so your apps never interfere with each other.

🧠 5. Cleaner Organization

Using domain-based routing keeps things intuitive — adminer.myapp.localhost, meilisearch.myapp.localhost, etc. Each service feels like part of the same ecosystem.


🧰 Example Stack Overview

Service

Purpose

web

Runs your Laravel app using Serversideup’s PHP image

postgres

PostgreSQL for your main database

redis

Caching and queues

adminer

Web database interface at adminer.app.localhost

meilisearch

Full-text search engine at meilisearch.app.localhost

traefik

Reverse proxy that routes all local traffic

All connected via:

  • app: internal network

  • proxy: shared external network


🏁 Wrapping Up

Switching from Laravel Sail to Serversideup/PHP + Traefik isn’t about replacing something broken — it’s about upgrading to a setup that grows with your needs.

You’ll keep the Docker-based workflow you already love, while gaining:

  • Centralized domain routing

  • Flexible PHP customization

  • Production-ready configuration

  • Smooth multi-app workflows

If you’re ready to take your local environment from “works fine” to “works beautifully,” this is the next logical step. 🚀