./bootstrap.sh --name=my-app
Free to use under its open-source licence. Issues and pull requests are welcome.
View on GitHub ↗Automated Local Development Environment Setup
Overview
A productivity-focused command-line tool that automates the entire Laravel project setup workflow on Linux systems.
Designed to eliminate repetitive manual configuration, this tool streamlines the process of setting up a professional, nginx-based local development environment with a single command.
The CLI handles all critical setup steps automatically: Laravel project creation, PHP-FPM configuration with version selection, MySQL database initialisation, local domain registration, SSL certificate generation (via mkcert), nginx vhost configuration, and environment file setup. Developers can spin up a fully configured Laravel project in minutes instead of spending 30+ minutes on manual configuration.
With sensible defaults, flexible CLI options, and clear documentation, this tool reflects a real-world development workflow and is particularly valuable for developers working on multiple Laravel projects simultaneously.
The hard parts
Every project has a few problems that decide whether it works in real life. These were the ones here, and how we handled them.
Orchestrating multiple system-level operations (DNS, nginx config, SSL generation, database creation) in a reliable sequence
Built modular bash functions with error handling and validation at each step, with clear separation of concerns
Supporting multiple PHP versions while correctly routing to the appropriate PHP-FPM socket
Implemented dynamic PHP-FPM socket detection based on the selected version, with validation to ensure the version exists on the system
Handling file and directory permissions correctly for nginx and PHP-FPM to avoid permission-denied errors
Implemented automatic permission fixing for Laravel directories and proper ownership assignment during setup
Generating nginx vhost configurations programmatically that are compatible with Laravel and HTTPS
Created template-based vhost generation with proper socket paths, SSL directives, and Laravel-specific location blocks
Providing trusted local SSL certificates without manual intervention
Integrated mkcert support with fallback graceful handling if not installed
Keeping a complex bash script maintainable and understandable
Extensively documented code with clear comments, logical function organisation, and helpful error messages
Eliminates 10+ manual steps with a single command
Sensible configuration options reduce required input
CLI arguments allow customisation of project name, domain, and PHP version
Prompts once for sudo access instead of repeatedly
Automatically opens the newly created project in the default browser
Uses nginx + PHP-FPM + MySQL, matching production-like setups
Under the hood
./bootstrap.sh --name=my-app
Free to use under its open-source licence. Issues and pull requests are welcome.
View on GitHub ↗