Laravel on LiteSoup

Deploy and manage Laravel applications on LiteSoup-managed servers. LiteSoup handles the stack — you focus on the code.

Creating a Laravel Site

Use the site import command with --framework=generic and your Git repository:

sudo bash /usr/lib/litesoup/site/site-import.sh \
  --domain=myapp.com \
  --git-repo=git@github.com:org/myapp.git \
  --git-branch=main \
  --php=8.3 \
  --tier=medium \
  --tls=letsencrypt \
  --email=admin@example.com \
  --framework=generic

This will:

  • Create a system user and PHP-FPM pool
  • Clone the repository into the docroot
  • Create a MariaDB database and user
  • Import a SQL dump (if provided via --db-dump)
  • Generate an Apache vhost with SSL
  • Run composer install --no-dev

Queue Workers

Set up a systemd service for the queue worker:

# /etc/systemd/system/laravel-worker@.service
[Unit]
Description=Laravel Queue Worker for %i

[Service]
User=%i
Group=%i
WorkingDirectory=/home/%i/webapps/%i
ExecStart=/usr/bin/php artisan queue:work --sleep=3 --tries=3
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target
sudo systemctl enable --now laravel-worker@myapp.com

Scheduled Tasks

Add the Laravel scheduler to crontab:

crontab -u myapp -e
# * * * * * cd /home/myapp/webapps/myapp.com && php artisan schedule:run

Auto-Deploy via Git Webhook

sudo bash /usr/lib/litesoup/site/site-set-webhook.sh --domain=myapp.com

Configures a webhook listener. Add a deploy.sh to run post-pull steps:

#!/usr/bin/env bash
set -e
composer install --no-dev --optimize-autoloader
php artisan migrate --force
php artisan optimize