Generate production-ready supervisor configuration files for Laravel queue workers, Horizon, and custom processes. No registration required, completely free, and optimized for Laravel 12.
Create up to 10 supervisor configuration files for your Laravel application
Your supervisor configuration files are ready. Copy each config to /etc/supervisor/conf.d/
and run sudo supervisorctl reread && sudo supervisorctl update
/etc/supervisor/conf.d/
Laravel Boilerplate
The first Laravel boilerplate built for vibe coding. 200+ pre-built features, multiple payment processors, and Cursor-optimized code.
Laravel Supervisor configuration is essential for production environments where you need reliable process management for queue workers, Horizon, and custom processes. This comprehensive guide covers everything you need to know about setting up, configuring, and managing Laravel 12 applications with Supervisor in production environments.
Supervisor is a client/server system that allows users to monitor and control a number of processes on UNIX-like operating systems. It provides a unified interface for managing long-running processes, making it ideal for Laravel applications that need to run queue workers, Horizon, and other background processes reliably in production environments.
Supervisor operates as a process control system that monitors and manages Laravel processes. When you configure Supervisor for Laravel, it creates a persistent connection to your queue workers, Horizon processes, and custom commands, ensuring they remain running even after system restarts or process failures.
Laravel 12 introduces significant improvements to the queue system, making it more efficient and reliable for production environments. The queue system provides a unified API across various backends including Redis, Amazon SQS, database, and Beanstalkd.
Key Laravel 12 queue features that work seamlessly with Supervisor:
Installing Supervisor is straightforward on most Linux distributions. Here are the installation commands for popular systems:
# Update package list
sudo apt update
# Install Supervisor
sudo apt install supervisor
# Enable and start Supervisor service
sudo systemctl enable supervisor
sudo systemctl start supervisor
# Check Supervisor status
sudo systemctl status supervisor
# Install EPEL repository (if not already installed)
sudo yum install epel-release
# Install Supervisor
sudo yum install supervisor
# Enable and start Supervisor service
sudo systemctl enable supervisord
sudo systemctl start supervisord
# Check Supervisor status
sudo systemctl status supervisord
# Install Supervisor
brew install supervisor
# Start Supervisor service
brew services start supervisor
# Check Supervisor status
brew services list | grep supervisor
Supervisor configuration files are typically stored in /etc/supervisor/conf.d/
on Linux systems. Each configuration file should have a .conf
extension and define one or more programs to manage.
[program:laravel-worker]
command=php /var/www/your-app/artisan queue:work --sleep=3 --tries=3 --max-time=3600
directory=/var/www/your-app
user=www-data
numprocs=1
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-worker-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production,QUEUE_CONNECTION=redis
Laravel queue workers are the backbone of background job processing. Here are the most common configurations for Ubuntu servers:
[program:laravel-worker]
command=php /var/www/your-app/artisan queue:work --sleep=3 --tries=3 --max-time=3600
directory=/var/www/your-app
user=www-data
numprocs=2
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-worker-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production,QUEUE_CONNECTION=redis
[program:laravel-worker]
command=php /var/www/your-app/artisan queue:work --sleep=3 --tries=3 --max-time=3600 --memory=512
directory=/var/www/your-app
user=www-data
numprocs=4
process_name=%(program_name)s_%(process_num)02d
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-worker-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production,QUEUE_CONNECTION=redis
[program:laravel-high-priority-worker]
command=php /var/www/your-app/artisan queue:work high --sleep=1 --tries=3 --max-time=3600
directory=/var/www/your-app
user=www-data
numprocs=2
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-high-priority-worker.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-high-priority-worker-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production,QUEUE_CONNECTION=redis
[program:laravel-default-worker]
command=php /var/www/your-app/artisan queue:work default --sleep=3 --tries=3 --max-time=3600
directory=/var/www/your-app
user=www-data
numprocs=2
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-default-worker.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-default-worker-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production,QUEUE_CONNECTION=redis
Laravel Horizon provides a beautiful dashboard and configuration system for Redis-powered queues. Here's how to configure it with Supervisor on Ubuntu:
# Install Horizon via Composer
composer require laravel/horizon
# Publish Horizon configuration
php artisan horizon:install
# Publish Horizon assets
php artisan horizon:publish
[program:laravel-horizon]
command=php /var/www/your-app/artisan horizon
directory=/var/www/your-app
user=www-data
numprocs=1
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-horizon.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-horizon-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production,QUEUE_CONNECTION=redis
[
'production' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default'],
'balance' => 'simple',
'processes' => 3,
'tries' => 3,
'nice' => 0,
],
'supervisor-2' => [
'connection' => 'redis',
'queue' => ['high'],
'balance' => 'simple',
'processes' => 2,
'tries' => 3,
'nice' => 0,
],
],
],
];
Supervisor can manage custom Laravel artisan commands and other processes. Here are common configurations for Ubuntu:
[program:laravel-scheduler]
command=php /var/www/your-app/artisan schedule:work
directory=/var/www/your-app
user=www-data
numprocs=1
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-scheduler.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-scheduler-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production
[program:laravel-data-processor]
command=php /var/www/your-app/artisan data:process --daemon
directory=/var/www/your-app
user=www-data
numprocs=1
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-data-processor.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-data-processor-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production
[program:laravel-reverb]
command=php /var/www/your-app/artisan reverb:start --host=0.0.0.0 --port=8080
directory=/var/www/your-app
user=www-data
numprocs=1
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-reverb.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-reverb-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production
Proper environment variable configuration is crucial for security and functionality. Here are the essential variables for Laravel 12:
# Basic Laravel Configuration
APP_ENV=production
APP_DEBUG=false
APP_URL=https://your-domain.com
# Database Configuration
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password
# Queue Configuration
QUEUE_CONNECTION=redis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
# Cache Configuration
CACHE_DRIVER=redis
SESSION_DRIVER=redis
# Mail Configuration
MAIL_MAILER=smtp
MAIL_HOST=your-smtp-host
MAIL_PORT=587
MAIL_USERNAME=your-email
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
Effective monitoring and management of Supervisor processes is essential for production environments. Here are the key commands and techniques:
# Check Supervisor status
sudo supervisorctl status
# Start all processes
sudo supervisorctl start all
# Stop all processes
sudo supervisorctl stop all
# Restart all processes
sudo supervisorctl restart all
# Restart specific process
sudo supervisorctl restart laravel-worker
# Reload configuration
sudo supervisorctl reread
sudo supervisorctl update
# View process logs
sudo supervisorctl tail laravel-worker
# Follow logs in real-time
sudo supervisorctl tail -f laravel-worker
# Clear logs
sudo supervisorctl clear laravel-worker
# Check Supervisor service status
sudo systemctl status supervisor
# Start Supervisor service
sudo systemctl start supervisor
# Stop Supervisor service
sudo systemctl stop supervisor
# Restart Supervisor service
sudo systemctl restart supervisor
# Enable Supervisor on boot
sudo systemctl enable supervisor
# Disable Supervisor on boot
sudo systemctl disable supervisor
Digital Ocean is one of the most popular cloud providers for Laravel applications. Here's a complete guide to setting up Laravel with Supervisor on Digital Ocean droplets.
Start by creating a new droplet with the following specifications:
# Connect to your droplet
ssh root@your-droplet-ip
# Update system packages
apt update && apt upgrade -y
# Create a non-root user
adduser laravel
usermod -aG sudo laravel
# Switch to the new user
su - laravel
# Generate SSH key for the user (optional)
ssh-keygen -t rsa -b 4096 -C "your-email@example.com"
# Install Apache, MySQL, PHP, and required extensions
sudo apt install -y apache2 mysql-server php8.2 php8.2-cli php8.2-fpm php8.2-mysql php8.2-xml php8.2-gd php8.2-curl php8.2-mbstring php8.2-zip php8.2-bcmath php8.2-intl php8.2-redis
# Install Composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
# Install Node.js and NPM
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install Redis
sudo apt install -y redis-server
sudo systemctl enable redis-server
sudo systemctl start redis-server
# Install Supervisor
sudo apt install -y supervisor
# Enable and start Supervisor
sudo systemctl enable supervisor
sudo systemctl start supervisor
# Check Supervisor status
sudo systemctl status supervisor
# Create application directory
sudo mkdir -p /var/www/your-app
sudo chown -R laravel:laravel /var/www/your-app
# Clone your Laravel application
cd /var/www/your-app
git clone https://github.com/your-username/your-laravel-app.git .
# Install dependencies
composer install --optimize-autoloader --no-dev
npm install && npm run build
# Set up environment
cp .env.example .env
php artisan key:generate
# Set proper permissions
sudo chown -R www-data:www-data /var/www/your-app
sudo chmod -R 755 /var/www/your-app
sudo chmod -R 775 /var/www/your-app/storage
sudo chmod -R 775 /var/www/your-app/bootstrap/cache
# Create supervisor configuration for Digital Ocean
sudo nano /etc/supervisor/conf.d/laravel-worker.conf
# Add the following configuration:
[program:laravel-worker]
command=php /var/www/your-app/artisan queue:work --sleep=3 --tries=3 --max-time=3600
directory=/var/www/your-app
user=www-data
numprocs=2
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-worker-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production,QUEUE_CONNECTION=redis
# Reload supervisor configuration
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-worker
Hetzner Cloud offers excellent performance and competitive pricing for Laravel applications. Here's how to set up Laravel with Supervisor on Hetzner Cloud servers.
Create a new server with these recommended specifications:
# Install Nginx
sudo apt install -y nginx
# Install MySQL
sudo apt install -y mysql-server
sudo mysql_secure_installation
# Install PHP 8.2 and extensions
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
sudo apt install -y php8.2-fpm php8.2-cli php8.2-mysql php8.2-xml php8.2-gd php8.2-curl php8.2-mbstring php8.2-zip php8.2-bcmath php8.2-intl php8.2-redis
# Install Composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
# Install Redis
sudo apt install -y redis-server
sudo systemctl enable redis-server
sudo systemctl start redis-server
# Create supervisor configuration for Hetzner
sudo nano /etc/supervisor/conf.d/laravel-worker.conf
# Add the following configuration:
[program:laravel-worker]
command=php /var/www/your-app/artisan queue:work --sleep=3 --tries=3 --max-time=3600
directory=/var/www/your-app
user=www-data
numprocs=2
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stderr_logfile=/var/log/supervisor/laravel-worker-error.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
environment=APP_ENV=production,QUEUE_CONNECTION=redis
# Reload supervisor configuration
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-worker
Here are solutions to the most common issues you might encounter when setting up Laravel with Supervisor:
# Check Supervisor status
sudo supervisorctl status
# Check logs for errors
sudo supervisorctl tail laravel-worker
# Check Laravel logs
tail -f /var/www/your-app/storage/logs/laravel.log
# Verify PHP path
which php
# Test artisan command manually
cd /var/www/your-app
php artisan queue:work --once
# Fix file permissions
sudo chown -R www-data:www-data /var/www/your-app
sudo chmod -R 755 /var/www/your-app
sudo chmod -R 775 /var/www/your-app/storage
sudo chmod -R 775 /var/www/your-app/bootstrap/cache
# Check if user exists
id www-data
# Create user if it doesn't exist
sudo useradd -r -s /bin/false www-data
# Check memory usage
free -h
ps aux --sort=-%mem | head
# Add memory limit to supervisor config
[program:laravel-worker]
command=php /var/www/your-app/artisan queue:work --memory=512
# ... other settings
# Monitor memory usage
watch -n 1 'ps aux | grep queue:work'
# Test database connection
cd /var/www/your-app
php artisan tinker
DB::connection()->getPdo();
# Check MySQL status
sudo systemctl status mysql
# Restart MySQL
sudo systemctl restart mysql
# Check MySQL logs
sudo tail -f /var/log/mysql/error.log
To ensure optimal performance and reliability with Laravel Supervisor, follow these proven best practices:
Set appropriate memory and CPU limits to prevent resource exhaustion and ensure system stability. Without proper limits, queue workers can consume all available memory, causing system crashes.
[program:laravel-worker]
command=php /var/www/your-app/artisan queue:work --memory=512 --sleep=3 --tries=3
directory=/var/www/your-app
user=www-data
numprocs=2
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker.log
stderr_logfile=/var/log/supervisor/laravel-worker-error.log
environment=APP_ENV=production,QUEUE_CONNECTION=redis
# Monitor memory usage
watch -n 1 'ps aux --sort=-%mem | head -10'
# Set system-wide limits in /etc/security/limits.conf
www-data soft nofile 65536
www-data hard nofile 65536
www-data soft nproc 4096
www-data hard nproc 4096
Key Points: Start with 512MB memory limit per worker, monitor usage, and adjust based on your job complexity. Use --memory=512
flag to restart workers when they exceed memory limits.
Configure log rotation and monitoring to prevent disk space issues. Unmanaged logs can quickly fill up your server's disk space, causing application failures.
# Create logrotate configuration
sudo nano /etc/logrotate.d/supervisor
# Add the following configuration:
/var/log/supervisor/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 644 root root
postrotate
/usr/bin/supervisorctl reread > /dev/null 2>&1 || true
/usr/bin/supervisorctl update > /dev/null 2>&1 || true
endscript
}
[program:laravel-worker]
command=php /var/www/your-app/artisan queue:work --sleep=3 --tries=3
directory=/var/www/your-app
user=www-data
numprocs=2
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=5
stderr_logfile=/var/log/supervisor/laravel-worker-error.log
stderr_logfile_maxbytes=10MB
stderr_logfile_backups=5
Key Points: Set log file size limits (10MB), keep 5 backups, enable compression, and monitor disk usage with df -h
and du -sh /var/log/supervisor/
.
Use environment-specific configurations for different deployment stages. This ensures proper separation between development, staging, and production environments.
# Production Configuration
[program:laravel-worker-prod]
command=php /var/www/your-app/artisan queue:work --sleep=3 --tries=3 --max-time=3600
directory=/var/www/your-app
user=www-data
numprocs=4
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker-prod.log
stderr_logfile=/var/log/supervisor/laravel-worker-prod-error.log
environment=APP_ENV=production,QUEUE_CONNECTION=redis,LOG_LEVEL=error
# Staging Configuration
[program:laravel-worker-staging]
command=php /var/www/your-app/artisan queue:work --sleep=3 --tries=3 --max-time=1800
directory=/var/www/your-app
user=www-data
numprocs=2
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker-staging.log
stderr_logfile=/var/log/supervisor/laravel-worker-staging-error.log
environment=APP_ENV=staging,QUEUE_CONNECTION=redis,LOG_LEVEL=debug
Key Points: Use different process names, log files, and environment variables for each stage. Consider using fewer workers in staging and different log levels for debugging.
Implement health checks and monitoring for all managed processes. Proactive monitoring helps identify issues before they cause downtime.
#!/bin/bash
# Create health check script
sudo nano /usr/local/bin/supervisor-health-check.sh
# Add the following content:
#!/bin/bash
# Check if supervisor is running
if ! systemctl is-active --quiet supervisor; then
echo "Supervisor service is not running"
exit 1
fi
# Check if all processes are running
FAILED_PROCESSES=$(supervisorctl status | grep -v RUNNING | grep -v STOPPED | wc -l)
if [ $FAILED_PROCESSES -gt 0 ]; then
echo "Some processes are not running properly:"
supervisorctl status | grep -v RUNNING
exit 1
fi
echo "All processes are running normally"
exit 0
# Make executable
sudo chmod +x /usr/local/bin/supervisor-health-check.sh
# Monitor process status
watch -n 1 'supervisorctl status'
# Monitor memory usage
watch -n 1 'ps aux --sort=-%mem | grep queue:work'
# Monitor log files
tail -f /var/log/supervisor/laravel-worker.log
# Check system resources
htop
iostat -x 1
Key Points: Set up automated health checks, monitor log file sizes, track memory usage, and configure alerts for process failures. Use tools like New Relic, DataDog, or simple shell scripts for monitoring.
Configure proper signal handling for clean process termination. This ensures jobs complete properly and prevents data corruption during deployments or maintenance.
[program:laravel-worker]
command=php /var/www/your-app/artisan queue:work --sleep=3 --tries=3 --timeout=60
directory=/var/www/your-app
user=www-data
numprocs=2
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/laravel-worker.log
stderr_logfile=/var/log/supervisor/laravel-worker-error.log
stopwaitsecs=30
killasgroup=true
stopasgroup=true
environment=APP_ENV=production,QUEUE_CONNECTION=redis
#!/bin/bash
# Deployment script with graceful shutdown
echo "Starting deployment..."
# Gracefully stop workers
echo "Stopping queue workers..."
supervisorctl stop laravel-worker
# Wait for current jobs to complete
echo "Waiting for jobs to complete..."
sleep 30
# Update application code
echo "Updating application..."
git pull origin main
composer install --no-dev --optimize-autoloader
npm run build
# Clear caches
php artisan config:cache
php artisan route:cache
php artisan view:cache
# Restart workers
echo "Starting queue workers..."
supervisorctl start laravel-worker
echo "Deployment completed successfully!"
Key Points: Use stopwaitsecs
to allow time for jobs to complete, set killasgroup=true
for proper signal propagation, and implement job-level shutdown checks for long-running processes.
Run processes with appropriate user permissions and access controls. Security is crucial in production environments to prevent unauthorized access and data breaches.
# Create dedicated user for Laravel processes
sudo useradd -r -s /bin/false -d /var/www/your-app laravel-worker
sudo usermod -aG www-data laravel-worker
# Set proper file permissions
sudo chown -R www-data:www-data /var/www/your-app
sudo chmod -R 755 /var/www/your-app
sudo chmod -R 775 /var/www/your-app/storage
sudo chmod -R 775 /var/www/your-app/bootstrap/cache
# Secure supervisor configuration files
sudo chown root:root /etc/supervisor/conf.d/*.conf
sudo chmod 644 /etc/supervisor/conf.d/*.conf
# Configure UFW firewall
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow 'Apache Full' # or 'Nginx Full'
sudo ufw allow 6379 # Redis (if needed externally)
sudo ufw --force enable
# Restrict supervisor access
sudo nano /etc/supervisor/supervisord.conf
# Add these security settings:
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0700
chown=root:root
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock
# Disable web interface in production
# [inet_http_server]
# port=127.0.0.1:9001
Key Points: Use dedicated users with minimal privileges, secure file permissions (600 for .env, 644 for configs), configure firewalls, disable supervisor web interface in production, and never store passwords in supervisor configuration files.
Yes, our Laravel Supervisor configuration generator is completely free to use. There are no hidden fees, subscriptions, or premium tiers. You can generate as many configuration files as you need without any restrictions.
Yes, you need to install Supervisor on your server before using the generated configuration files. The tool generates the configuration files, but you'll need to install Supervisor and place the files in the appropriate directory.
You can install Supervisor using: sudo apt update && sudo apt install supervisor
. After installation, place your generated .conf files in /etc/supervisor/conf.d/
and run sudo supervisorctl reread && sudo supervisorctl update
.
Queue workers are basic Laravel processes that handle background jobs, while Horizon is a dashboard and process manager for Redis-based queues. Horizon provides advanced features like job monitoring, scaling, and balancing. Use queue workers for simple setups and Horizon for complex Redis-based queue management.
The number of queue workers depends on your server resources and job volume. Start with 2-4 workers per CPU core, but monitor your system resources. Too many workers can cause memory issues, while too few may create bottlenecks. Use monitoring tools to find the optimal number for your application.
Check your Laravel logs first: tail -f storage/logs/laravel.log
. Common issues include memory limits, database connection problems, or job-specific errors. Ensure your environment variables are correct and your database connections are stable. The generated config includes auto-restart settings to handle temporary failures.
Absolutely! This tool is designed to work with all Laravel versions, including Laravel 12. The generated configurations are compatible with the latest Laravel features and best practices. The tool automatically adapts command syntax and configuration options for optimal Laravel 12 compatibility.
Use sudo supervisorctl status
to check process status, sudo supervisorctl tail [process_name]
to view logs, and sudo supervisorctl restart [process_name]
to restart specific processes. For web-based monitoring, consider tools like Laravel Horizon or Supervisor's built-in web interface.
Essential environment variables include APP_ENV=production
, QUEUE_CONNECTION=redis
(or your preferred queue driver), REDIS_HOST
, DB_CONNECTION
, and any API keys your jobs need. The tool provides common environment variables, but customize them based on your application's requirements.
Supervisor typically requires root access and is not available on shared hosting. For shared hosting, consider using Laravel's built-in queue:work command with a cron job, or look into managed queue services like Laravel Forge, Envoyer, or cloud-based solutions like AWS SQS with Lambda.
Both Digital Ocean and Hetzner are excellent choices. Digital Ocean offers better documentation and community support, while Hetzner provides better performance and pricing. For beginners, Digital Ocean is recommended due to its user-friendly interface and extensive tutorials. For cost-conscious users or those needing high performance, Hetzner is the better choice.
LAMP uses Apache (Linux, Apache, MySQL, PHP) while LEMP uses Nginx (Linux, Nginx, MySQL, PHP). Nginx is generally faster and more efficient for static content and reverse proxying, while Apache has better .htaccess support and is easier to configure for beginners. For Laravel applications, both work well, but Nginx is often preferred for production environments.
Start by checking Supervisor status with sudo supervisorctl status
, then examine logs with sudo supervisorctl tail [process_name]
. Common issues include incorrect file paths, permission problems, or missing PHP extensions. Use the troubleshooting section in this guide for step-by-step debugging procedures.
Yes! Supervisor is perfect for managing Laravel Reverb WebSocket servers. Use the custom process configuration with the command php artisan reverb:start --host=0.0.0.0 --port=8080
. This ensures your WebSocket server stays running and automatically restarts if it crashes.
Always run Supervisor processes as non-root users (like www-data), set proper file permissions (644 for config files, 755 for directories), use environment variables for sensitive data, and configure firewalls to restrict access. Never store passwords or API keys directly in configuration files.
Start with 2-4 workers per CPU core and monitor resource usage. Use numprocs
in your Supervisor configuration to run multiple instances. For high-traffic applications, consider using load balancers and multiple servers. Both Digital Ocean and Hetzner support easy server scaling through their control panels.
Use a deployment script that: 1) Updates your application code, 2) Runs composer install and npm build, 3) Updates Supervisor configurations, 4) Reloads Supervisor with sudo supervisorctl reread && sudo supervisorctl update
, and 5) Restarts processes. Consider using Laravel Forge or Envoyer for automated deployments.