jcergolj / metator-for-laravel
Laravel package that installs Deployer deployment scaffolding into an application.
Package info
github.com/jcergolj/metator-for-laravel
Language:Shell
pkg:composer/jcergolj/metator-for-laravel
Requires
- php: ^8.2
- deployer/deployer: ^8.0
- illuminate/console: ^12.0 || ^13.0
- illuminate/filesystem: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
This package is auto-updated.
Last update: 2026-09-01 13:31:51 UTC
README
An opinionated deployment setup for Laravel using Deployer, Caddy, Cloudflare, and optional Horizon with Redis.
php artisan metator:install is a wrapper around the usual Deployer setup. It adds deploy.php and the extra scripts/ helpers for server setup.
Install
composer require --dev jcergolj/metator-for-laravel php artisan metator:install
Installing this package also installs deployer/deployer.
What it adds
- Deployer as a dependency
deploy.phpscripts/server-bootstrap.shscripts/lib/*scripts/steps/*
What the scripts do
./scripts/server-bootstrap.sh is an interactive server setup script. It asks for step-specific details only when you continue into that step, keeps going even if a step fails, and prints a final summary of which steps succeeded, failed, or were skipped. It can:
- create the
deployeruser if it does not exist - add your public SSH key to
authorized_keysfordeployerlogin - create a GitHub deploy key for the server and configure the SSH alias
- optionally create a Cloudflare DNS A record for the domain using a Cloudflare zone ID
- create the shared Laravel
.envand wait for review confirmation before continuing - configure SQLite or MySQL connection values
- create the shared SQLite database file when SQLite is used
- configure shared file permissions
- add
import /etc/caddy/sites-enabled/*.caddyto/etc/caddy/Caddyfilewhen missing - create and validate the Laravel app Caddy site file in
/etc/caddy/sites-enabled/ - add the Laravel scheduler cron job
- configure Supervisor for
queue:workor Horizon - install Redis when Horizon is selected
- use the latest detected PHP-FPM version when installing PHP database extensions
- print the next deployment steps for
deploy.php
Typical generated or updated files during bootstrap:
- shared Laravel environment:
/var/www/<app-name>/shared/.env - Caddy site config:
/etc/caddy/sites-enabled/<app-name>.caddy - Supervisor worker config:
/etc/supervisor/conf.d/<app-name>-worker.conf
Notes
- Use
php artisan metator:install --forceto overwrite existing files. - Review
deploy.phpafter install. - Ensure the latest detected
phpX.Y-fpmservice is installed and running before bootstrap, because the script uses that version for the FPM socket and PHP database extensions. - Ensure Caddy is installed before bootstrap, because the script updates
/etc/caddy/Caddyfile, validates the config, and reloads the service.
Fresh Server Bootstrap
For a fresh server, copy the generated scripts/ directory first:
scp -r scripts user@SERVER_IP:/tmp/
ssh user@SERVER_IP
cd /tmp/scripts
bash server-bootstrap.sh
Deploy
After bootstrap, deploy the app with Deployer:
vendor/bin/dep deploy production
Deployer: https://deployer.org/