PHPackages                             timo-de-winter/laravel-docker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. timo-de-winter/laravel-docker

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

timo-de-winter/laravel-docker
=============================

A package that adds docker features to your project for local development

v5.2.2(1w ago)01.5k↓58.8%[1 PRs](https://github.com/timo-de-winter/laravel-docker/pulls)MITPHPPHP ^8.3CI passing

Since Aug 1Pushed yesterdayCompare

[ Source](https://github.com/timo-de-winter/laravel-docker)[ Packagist](https://packagist.org/packages/timo-de-winter/laravel-docker)[ Docs](https://github.com/timo-de-winter/laravel-docker)[ GitHub Sponsors](https://github.com/timo-de-winter)[ RSS](/packages/timo-de-winter-laravel-docker/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (32)Versions (17)Used By (0)

Laravel Docker
==============

[](#laravel-docker)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7e7d7cfff4b17f7804110b1b51ce9fe3490bc38c5b7e116b86e247df96e3aba7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74696d6f2d64652d77696e7465722f6c61726176656c2d646f636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/timo-de-winter/laravel-docker)[![Total Downloads](https://camo.githubusercontent.com/29f234af1775b316dba11fdeb24c1a592c1be2b2d659b57d06f5d6beb84b25c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74696d6f2d64652d77696e7465722f6c61726176656c2d646f636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/timo-de-winter/laravel-docker)[![License](https://camo.githubusercontent.com/c2eebaaa560fbe4df14e8fad61ee43186a343003324906bed51008635aed2eda/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f74696d6f2d64652d77696e7465722f6c61726176656c2d646f636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/timo-de-winter/laravel-docker)

A comprehensive Laravel package that provides a complete Docker-based development environment for Laravel projects. Inspired by Laravel Sail but with additional services and optimizations for modern Laravel development.

**Note:** This package contains features that I use across almost all my projects. For a more customizable experience, consider Laravel Sail. This package is ideal if you want a full-featured development environment out of the box.

Features
--------

[](#features)

- 🐳 **Complete Docker Environment** - Pre-configured with all essential services
- 🚀 **One-Command Setup** - Get started with a single installation command
- 🔧 **Laravel Sail Compatibility** - Familiar commands and workflow
- 📦 **Rich Service Stack** - Database, cache, email testing, search, and storage
- 🛠 **Development Tools** - Xdebug, Laravel Horizon queue processing, and more
- 🤖 **AI Tools Integration** - Optional Claude Code + Laravel Boost MCP server
- 🎯 **Optimized for Performance** - PHP 8.4, Node 22, optimized configurations

Services Included
-----------------

[](#services-included)

ServicePurposePortAdmin Panel**Application**PHP 8.4 + Laravel80-**MariaDB**Database3306-**Redis**Cache &amp; Sessions6379-**Mailpit**Email Testing1025**MinIO**S3-compatible Storage9000**Meilisearch**Full-text Search7700Requirements
------------

[](#requirements)

- Docker &amp; Docker Compose
- PHP 8.3+ (for local Composer operations)
- Laravel 10, 11, or 12

Installation
------------

[](#installation)

### 1. Install the Package

[](#1-install-the-package)

```
composer require timo-de-winter/laravel-docker --dev
```

### 2. Run the Installation Command

[](#2-run-the-installation-command)

```
php artisan docker:install
```

This interactive command will:

- Ask for your project name
- Ask which database service you want to use (MariaDB, MySQL, or PostgreSQL)
- Ask if you want to enable AI tools (Claude Code + Laravel Boost MCP server)
- Automatically install and configure Laravel Horizon for queue processing
- Publish Docker configuration files
- Create a custom binary script for your project
- Set up all necessary Docker services

### 3. Start Your Environment

[](#3-start-your-environment)

After installation, start your development environment:

```
./your-project-name up -d
```

Your Laravel application will be available at

Usage
-----

[](#usage)

### Container Management

[](#container-management)

```
# Start all services in background
./your-project-name up -d

# Stop all services
./your-project-name down

# View service status
./your-project-name ps

# View logs
./your-project-name logs

# Follow logs for specific service
./your-project-name logs -f application
```

### Laravel Development

[](#laravel-development)

```
# Run Artisan commands
./your-project-name artisan migrate
./your-project-name artisan make:controller HomeController

# Access Laravel Tinker
./your-project-name tinker

# Run tests
./your-project-name test
./your-project-name pest
./your-project-name phpunit

# Queue processing (via Horizon)
# Queues are automatically processed in the background via supervisor
```

### Package Management

[](#package-management)

```
# Composer commands
./your-project-name composer install
./your-project-name composer require vendor/package

# Node.js/NPM commands
./your-project-name npm install
./your-project-name npm run dev
./your-project-name npm run build
```

### Code Quality

[](#code-quality)

```
# Format code with Laravel Pint
./your-project-name pint

# Run with additional options
./your-project-name pint --test
./your-project-name pint --dirty
```

### Database Operations

[](#database-operations)

```
# Access MariaDB CLI
./your-project-name mariadb

# Run migrations
./your-project-name artisan migrate

# Seed database
./your-project-name artisan db:seed
```

### Development Tools

[](#development-tools)

```
# Access container shell
./your-project-name shell
./your-project-name bash

# Run PHP commands
./your-project-name php -v
./your-project-name php artisan about

# Access Redis CLI
./your-project-name redis

# Open application in browser
./your-project-name open
```

### AI Tools Integration

[](#ai-tools-integration)

If you chose to enable AI tools during setup, you get access to both Claude Code and Laravel Boost:

```
# After starting your containers, complete Laravel Boost setup
./your-project-name artisan boost:install

# Start Claude Code session in container (if installation succeeded)
./your-project-name claude

# Note: Claude Code installation may fail during Docker build.
# If so, you can install it manually in the container:
./your-project-name shell
npm install -g @anthropic-ai/claude-code

# Laravel Boost MCP server runs automatically in the background
# providing AI agents with Laravel-specific tools and documentation
# The MCP server is accessible at the standard Laravel Boost endpoint
```

#### Laravel Boost MCP Server

[](#laravel-boost-mcp-server)

Laravel Boost provides a Model Context Protocol (MCP) server with specialized Laravel tools:

```
# The MCP server runs automatically when AI tools are enabled
# Check supervisor status
./your-project-name shell
supervisorctl status boost-mcp

# Manual MCP server management (if needed)
./your-project-name artisan boost:mcp  # Start manually
./your-project-name artisan boost:install  # Complete Boost setup

# MCP server provides 15+ Laravel-specific tools for AI agents
# Including project inspection, documentation access, and code generation
```

### Queue Management with Horizon

[](#queue-management-with-horizon)

Laravel Horizon is automatically installed and configured during setup:

```
# After Horizon installation, restart containers to enable automatic startup
./your-project-name down
./your-project-name up -d

# View Horizon dashboard (access via web browser)
# Navigate to http://localhost/horizon in your browser

# Queue processing runs automatically in the background via supervisor
# Check supervisor status in container
./your-project-name shell
supervisorctl status

# Restart Horizon if needed
./your-project-name artisan horizon:terminate
```

### Debugging with Xdebug

[](#debugging-with-xdebug)

Enable Xdebug for debugging sessions:

```
# Run commands with Xdebug enabled
./your-project-name debug tinker
./your-project-name debug artisan your:command

# Or set environment variable
export XDEBUG_MODE=debug
./your-project-name artisan your:command
```

Configure your IDE to connect to `localhost:9003` for Xdebug sessions.

### Sharing Your Site

[](#sharing-your-site)

Expose your local development site using expose.dev:

```
# Share your site (requires expose.dev account)
./your-project-name share

# Share with subdomain
TDW_LARAVEL_DOCKER_SHARE_SUBDOMAIN=myapp ./your-project-name share
```

Environment Configuration
-------------------------

[](#environment-configuration)

The package respects standard Laravel environment variables and adds a few Docker-specific ones:

```
# Standard Laravel
APP_PORT=80
DB_PORT=3306

# Redis Configuration (automatically configured)
REDIS_HOST=redis
REDIS_PORT=6379

# Docker-specific
XDEBUG_MODE=off                    # Set to 'debug' to enable Xdebug
VITE_PORT=5174                     # Vite development server port

# Service ports (optional overrides)
FORWARD_DB_PORT=3306
FORWARD_REDIS_PORT=6379
FORWARD_MAILPIT_PORT=1025
FORWARD_MAILPIT_DASHBOARD_PORT=8025
FORWARD_MINIO_PORT=9000
FORWARD_MINIO_CONSOLE_PORT=8900
FORWARD_MEILISEARCH_PORT=7700

# Sharing configuration
TDW_LARAVEL_DOCKER_SHARE_DASHBOARD=4040
TDW_LARAVEL_DOCKER_SHARE_SERVER_HOST="your-domain.com"
TDW_LARAVEL_DOCKER_SHARE_SUBDOMAIN=""
```

Docker Configuration
--------------------

[](#docker-configuration)

### PHP Configuration

[](#php-configuration)

The container includes optimized PHP settings:

- **Upload limits**: 100M file uploads
- **OPcache**: Enabled for better performance
- **Xdebug**: Available for debugging (disabled by default)
- **Extensions**: All common Laravel extensions included

### Container Stack

[](#container-stack)

- **Base Image**: Ubuntu 24.04 LTS
- **PHP**: 8.4 with all Laravel extensions
- **Node.js**: v22 (latest LTS)
- **Composer**: Latest stable version
- **Supervisor**: For background queue processing

### Volume Mounts

[](#volume-mounts)

- Application code: `/var/www/html`
- Vendor packages: Cached for performance
- Node modules: Cached for performance
- Database data: Persisted in Docker volumes

Comparison with Laravel Sail
----------------------------

[](#comparison-with-laravel-sail)

FeatureLaravel DockerLaravel Sail**Services**6 pre-configuredCustomizable selection**PHP Version**8.48.1, 8.2, 8.3**Node Version**2218, 20**Queue Processing**Horizon (auto-start)Manual setup**Search**Meilisearch includedOptional**Storage**MinIO includedOptional**Email Testing**Mailpit includedMailhog optional**Setup**One commandRequires publishingTroubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

**Port already in use:**

```
# Check what's using the port
sudo lsof -i :80

# Stop the service or change APP_PORT in .env
```

**Permission issues:**

```
# Fix file permissions
./your-project-name shell
sudo chown -R appuser:appuser /var/www/html
```

**Services not starting:**

```
# Check service logs
./your-project-name logs
./your-project-name logs mariadb

# Restart services
./your-project-name down
./your-project-name up -d
```

**Database connection issues:**

```
# Ensure database service is running
./your-project-name ps

# Check database credentials in .env
./your-project-name artisan config:show database
```

### Performance Tips

[](#performance-tips)

1. **Use Docker Desktop's WSL2 backend** on Windows
2. **Allocate sufficient memory** to Docker (4GB+ recommended)

Development
-----------

[](#development)

### Package Development

[](#package-development)

If you want to contribute to this package:

```
# Clone the repository
git clone https://github.com/timo-de-winter/laravel-docker.git

# Install dependencies
composer install
```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT License](LICENSE.md).

Credits
-------

[](#credits)

- **Timo de Winter** - Package author and maintainer
- **Laravel Sail** - Inspiration and base functionality

Support
-------

[](#support)

- 📧 **Email**:
- 🐛 **Issues**: [GitHub Issues](https://github.com/timo-de-winter/laravel-docker/issues)
- 📖 **Documentation**: This README

---

**Happy coding! 🚀**

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance99

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~30 days

Recently: every ~0 days

Total

12

Last Release

10d ago

Major Versions

v1.1.0 → v5.0.02026-06-24

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77292763?v=4)[timodw-nl](/maintainers/timodw-nl)[@timodw-nl](https://github.com/timodw-nl)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")[![timo-de-winter](https://avatars.githubusercontent.com/u/52080998?v=4)](https://github.com/timo-de-winter "timo-de-winter (1 commits)")

---

Tags

laravellaravel-dockertimo-de-winter

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/timo-de-winter-laravel-docker/health.svg)

```
[![Health](https://phpackages.com/badges/timo-de-winter-laravel-docker/health.svg)](https://phpackages.com/packages/timo-de-winter-laravel-docker)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
