After 10 years of deploying Laravel applications, I've open-sourced the Docker stack I've been using in production.
The Problem
Every new Laravel project meant several hours of:
- Configuring Docker Compose
- Setting up Nginx and SSL certificates
- Server hardening (Fail2Ban, firewall, SSH)
- Writing deployment scripts
- Debugging permissions
It was never the interesting partβjust friction before actual work could begin.
The Solution: Dockavel
A production-ready Docker environment that handles everything with one command:
./scripts/deploy.sh prod
What It Does
π One-Command Deployment
- Development:
./scripts/dev.sh up - Production:
./scripts/deploy.sh prod - Zero-downtime deployments
π Automatic SSL
- Let's Encrypt integration with auto-renewal
- Cloudflare origin certificates support
- Smart proxy detection
- HTTP to HTTPS redirects
π‘οΈ Security Hardening
Server setup script configures:
- Fail2Ban for SSH and HTTP protection
- UFW firewall with minimal ports
- SSH hardening (key-only, custom port)
- Automatic security updates
π¦ Full Production Stack
- Laravel 12+ with optimizations
- PHP 8.4-FPM with xtensions
- MySQL 8.0 with persistent volumes
- Redis 7.0 for caching and sessions
- Laravel Horizon for queue monitoring
- Nginx as reverse proxy
πΎ Automated Backups
- Daily database backups
- Configurable retention (7/30/90 days)
- Email notifications
- One-command restoration
Quick Start
# Clone the repository
git clone https://github.com/mg2k4/Dockavel.git my-project
cd my-project
# Development
./scripts/deploy.sh dev
# Production (on your server)
./scripts/server-setup.sh # First time only
./scripts/deploy.sh prod
Your app is now running with SSL, security hardening, and automated backups!
What Makes It Different
Laravel Sail: Great for local development, not production-focused
Laradock: Offers many options but complex for production
Dockavel: Production-first, opinionated, one command to deploy
Architecture
βββββββββββββββ
β Nginx β β SSL termination, reverse proxy
ββββββββ¬βββββββ
β
ββββββββΌβββββββ
β PHP-FPM β β Laravel application
ββββββββ¬βββββββ
β
βββββ΄ββββ¬ββββββββββ
β β β
ββββΌβββ βββΌββββ ββββΌβββββ
βMySQLβ βRedisβ βHorizonβ
βββββββ βββββββ βββββββββ
Links
π Documentation: https://dockavel.com
π¦ GitHub: https://github.com/mg2k4/Dockavel
π₯ Demo Video: https://www.youtube.com/watch?v=o-kj-T2QlXw
My First Open Source Project
This is my first time releasing something open source. I've been using variations of this stack for 5+ years in production, and I finally cleaned it up to share.
Feedback, issues, and PRs are very welcome! Let me know what features you'd like to see.
License
MIT - Free to use, modify, and distribute.
If this saves you even a few hours of Docker configuration, I'll consider it a success. Happy deploying! π
What deployment challenges are you facing with Laravel? Let me know in the comments!
Top comments (0)