jcergolj/metator-for-laravel

Laravel package that installs Deployer deployment scaffolding into an application.

Maintainers

Package info

github.com/jcergolj/metator-for-laravel

Language:Shell

pkg:composer/jcergolj/metator-for-laravel

Transparency log

Statistics

Installs: 26

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v3 2026-09-01 13:31 UTC

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.php
  • scripts/server-bootstrap.sh
  • scripts/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 deployer user if it does not exist
  • add your public SSH key to authorized_keys for deployer login
  • 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 .env and 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/*.caddy to /etc/caddy/Caddyfile when 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:work or 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 --force to overwrite existing files.
  • Review deploy.php after install.
  • Ensure the latest detected phpX.Y-fpm service 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/