Download the PHP package mwguerra/docker-local without Composer

On this page you can find all versions of the php package mwguerra/docker-local. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package docker-local

docker-local

Complete Docker development environment for Laravel with a powerful CLI.

Packagist Version PHP Version

Global Composer Package — Install once, use everywhere. No per-project Docker configuration needed.

Quick Install

For experienced developers — get up and running in 60 seconds:

Need prerequisites first? See Installation for platform-specific setup guides.


Features

Table of Contents

Requirements

All Platforms

Software Minimum Version Check Command
Docker 24.0+ docker --version
Docker Compose 2.20+ docker compose version
PHP 8.2+ php --version
Composer 2.6+ composer --version

System Requirements

Installation

Linux

Tested on Ubuntu 22.04+, Debian 12+, Fedora 38+, and Arch Linux.

macOS

Tested on macOS 12 (Monterey) and later.

Windows (WSL2)

Important: docker-local requires WSL2 on Windows. Native Windows is not supported.

Step 1: Install WSL2

Restart your computer when prompted.

Step 2: Install Docker Desktop

  1. Download Docker Desktop for Windows
  2. During installation, ensure "Use WSL 2 based engine" is checked
  3. After installation, go to Settings > Resources > WSL Integration
  4. Enable integration with your Ubuntu distribution

Step 3: Install docker-local (in WSL2 Ubuntu)

Accessing Projects from Windows

Your WSL2 projects are accessible in Windows Explorer at:

Or in VS Code:

Quick Start

New Project

Existing Project

If you have an existing Laravel project, copy it to ~/projects/ and configure it:

Required .env changes for existing projects:

Quick setup script for existing projects:

Checklist for existing projects:

CLI Commands

Setup & Diagnostics

Fix command options:

The fix command automatically detects and resolves issues like:

Environment Management

Project Commands

make:laravel creates everything automatically:

Development Commands

Artisan Shortcuts

Database Commands

Queue Commands

Xdebug Commands

Startup Commands

Configure docker-local to start automatically when your computer boots:

Platform-specific behavior:

Platform Method Location
Linux systemd service ~/.config/systemd/user/docker-local.service
macOS LaunchAgent ~/Library/LaunchAgents/com.mwguerra.docker-local.plist
WSL2 bashrc script Entry in ~/.bashrc

Environment Verification

Configuration

Configuration is stored in ~/.config/docker-local/config.json:

Directory Structure

docker-local operates across three locations:

Package Structure (Source Code)

User Configuration (~/.config/docker-local/)

Created by docker-local init, persists across updates:

Projects Directory (~/projects/)

Each Laravel project is automatically accessible via HTTPS:

Understanding Environment Files

docker-local uses two separate .env files for different purposes:

File Scope Used By Location
.env.example Docker infrastructure docker-compose.yml ~/.config/docker-local/.env
laravel.env.example Laravel application Laravel framework ~/projects/<project>/.env

.env.example (Docker/Infrastructure)

Controls how Docker containers are built and connected:

This file is copied to ~/.config/docker-local/.env and read by docker-compose.yml via ${VARIABLE} syntax.

laravel.env.example (Application)

Controls how Laravel connects to services from inside the container:

This file is copied to each project's .env (~/projects/my-app/.env) and read by Laravel via env() and config().

Why Both Files Exist

Key insight: The same service has different addresses depending on where you're accessing it from:

Accessing From MySQL Address Why
Your host (TablePlus, DBeaver) localhost:3306 Uses exposed port
Inside PHP container (Laravel) mysql:3306 Uses Docker DNS

The Docker .env configures what ports are exposed to your machine, while the Laravel .env configures how to reach services via Docker's internal network.

Related Files

The stubs/ versions contain placeholders like {{PROJECT_NAME}} for automated project creation via docker-local make:laravel.

Services

URLs

Service URL
Your Projects https://<project>.test
Traefik Dashboard https://traefik.localhost
Mailpit https://mail.localhost
MinIO Console https://minio.localhost
Ollama API https://ollama.localhost
Whisper ASR https://whisper.localhost
tusd (resumable uploads) https://tusd.localhost

Ports

Service Port Purpose
Traefik HTTP 80 HTTP (redirects to HTTPS)
Traefik HTTPS 443 HTTPS
MySQL 3306 Database
PostgreSQL 5432 Database
Redis 6379 Cache/Queue
MinIO API 9000 S3 API
MinIO Console 9001 Web UI
Mailpit SMTP 1025 Email
Mailpit Web 8025 Email UI
Ollama 11434 Local LLM inference API
Whisper ASR 9501 OpenAI-compatible STT API
tusd 1080 Resumable uploads (TUS)

Default Credentials

Service Username Password
MySQL (root) root secret
MySQL (user) laravel secret
PostgreSQL laravel secret
MinIO minio minio123

All Included Services

All services are now enabled by default. Simply run:

RTMP Server (Live Streaming)

The RTMP server provides live streaming with HLS delivery:

RTMP Configuration:

Endpoint URL
RTMP Ingest rtmp://localhost:1935/live/<stream_key>
HLS Playback http://localhost:8088/hls/<stream_key>.m3u8
HLS (via Traefik) https://stream.localhost/hls/<stream_key>.m3u8
Stats http://localhost:8088/stat

Customizing RTMP:

To add project-specific webhooks (e.g., on_publish callbacks), create a custom config:

Node.js Container

A dedicated Node.js 20 container for long-running build processes:

PostgreSQL with pgvector

PostgreSQL 17 now includes the pgvector extension for AI embeddings:

AI/Whisper Transcription

Two options for speech-to-text transcription:

Option 1: Whisper API Container (Recommended)

A dedicated Whisper ASR webservice with OpenAI-compatible HTTP API (using faster-whisper-server):

Laravel Configuration (.env):

Example API Call:

Web UI: https://whisper.localhost

Option 2: PHP-AI Container (CLI)

For direct CLI access to Whisper:

Whisper Models:

Model Size Memory Speed Accuracy
tiny 39M ~1GB Fastest Lower
base 74M ~1GB Fast Good
small 244M ~2GB Medium Better
medium 769M ~5GB Slow High
large 1550M ~10GB Slowest Best

Configure the model in .env:

tusd — Resumable uploads (TUS protocol)

tusd is the reference TUS server (Go) for resumable uploads. It accepts chunked HTTP uploads from browsers (Uppy.js, TusUpload, etc.) and streams them directly to MinIO/S3 — no PHP worker in the hot path, safe for GB-scale files on flaky connections.

Endpoints:

Configuration (.env):

tusd reads S3 credentials from MINIO_ROOT_USER / MINIO_ROOT_PASSWORD and writes directly to the MinIO container at http://minio:9000. On upload completion, the file lives under s3://$TUSD_S3_BUCKET/<upload-id> and <upload-id>.info.

Example upload (Uppy.js on the client, nothing server-side):

For authorized uploads in production, configure tusd hooks (-hooks-http) to call a Laravel endpoint that validates the user and allowed bucket prefix before accepting a new upload.

Laravel Workers (Horizon, Reverb, Scheduler)

For Laravel-specific services, use the override stub as a template:

Available templates:

Multi-Project Support

docker-local supports multiple Laravel projects sharing the same Docker services. Each project gets complete automatic isolation to prevent data leakage between projects.

What Gets Created Automatically

When you create a project with docker-local make:laravel myapp, everything is set up automatically:

Automatic Isolation Details

Resource How It's Isolated Example Value
Database Unique DB per project myapp, myapp_testing
Redis Cache Separate Redis DB number REDIS_CACHE_DB=0
Redis Session Separate Redis DB number REDIS_SESSION_DB=1
Redis Queue Separate Redis DB number REDIS_QUEUE_DB=2
Cache Prefix Unique prefix per project CACHE_PREFIX=myapp_
MinIO Bucket Separate S3 bucket AWS_BUCKET=myapp
Reverb/WebSockets Unique credentials Random REVERB_APP_ID/KEY/SECRET
Horizon Prefix Unique queue prefix HORIZON_PREFIX=myapp_horizon:

Redis Database Allocation

Redis has 16 databases (0-15). Each project uses 3 databases:

Project Cache DB Session DB Queue DB
1st project 0 1 2
2nd project 3 4 5
3rd project 6 7 8
4th project 9 10 11
5th project 12 13 14

This allows up to 5 fully isolated projects. Beyond that, DB numbers wrap around (with a warning).

PostgreSQL vs MySQL

Both database engines are available. Use the --postgres flag:

PostgreSQL projects automatically get these extensions:

Conflict Detection

Example conflict output:

Running Multiple Projects Simultaneously

All projects can run at the same time without conflicts:

Each project has its own:

Migrating from Project-Specific Docker

If your project has its own Docker configuration, you can migrate to docker-local for a shared, centralized environment.

What docker-local Provides

Service Included Notes
PHP 8.4 FPM Yes With FFmpeg, ImageMagick, 50+ extensions
PostgreSQL 17 Yes With pgvector for AI embeddings
MySQL 9.1 Yes Innovation release
Redis 8 Yes With persistence
MinIO Yes S3-compatible storage
Mailpit Yes Email testing
Nginx Yes Dynamic multi-project routing
Traefik Yes Reverse proxy with SSL
RTMP Server Yes Live streaming with HLS
Whisper API Yes HTTP API for speech-to-text
PHP-AI Yes PHP with Whisper CLI
Node.js 20 Yes Frontend build tooling

What Stays Project-Specific

These should remain in your project's docker-compose.override.yml:

Service Reason
Laravel Horizon Uses app container, just different command
Laravel Reverb WebSocket server specific to your app
Scheduler Cron jobs specific to your app
E2E Testing (Playwright) Test infrastructure is project-specific
Custom AI Models Specialized ML models beyond Whisper

Migration Steps

  1. Copy your project's custom services to an override file:

  2. Add Laravel-specific services:

  3. Update your .env for docker-local:

  4. For RTMP/streaming features:

  5. Remove old Docker files from your project:

  6. Start using docker-local:

Example: pcast Migration

For a complex streaming application like pcast:

Before (project-specific):

After (docker-local):

Start docker-local (all features included):

Benefits:

IDE Integration

VS Code

  1. Install PHP Debug extension
  2. Create .vscode/launch.json:

  3. Start debugging: F5

PhpStorm

  1. Settings → PHP → Debug → Port: 9003
  2. Settings → PHP → Servers:
    • Name: docker
    • Host: localhost, Port: 443
    • Path mappings: /var/www/project → ~/projects/project
  3. Click "Start Listening for PHP Debug Connections"

Troubleshooting

General Diagnostics

The fix command is the recommended first step when troubleshooting - it automatically diagnoses issues and attempts to fix them where possible.

Common Issues

"Docker daemon is not running"

"Port already in use"

"Permission denied" errors

"*.test domains not resolving"

If dnsmasq is working but system DNS isn't:

SSL Certificate Issues

Cleaning Up

Using Local PHP

If you prefer using your local PHP installation with Docker services:

The setup:hosts command adds to /etc/hosts:

Shell Completion

Bash

Zsh

Updating

Extending

Adding Custom Services

Create ~/.config/docker-local/docker-compose.override.yml:

Then restart:

Custom PHP Configuration

Create ~/.config/docker-local/php/custom.ini:

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

License

MIT License. See LICENSE for details.


Made with :heart: for Laravel developers.


All versions of docker-local with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mwguerra/docker-local contains the following files

Loading the files please wait ...