Linux Production Deployment
Recommended production path for Lacelium: Ubuntu, Debian, or RHEL with Nginx, PHP 8.2+ FPM, and systemd process supervision for background workers and Nexify real-time services.
Step-by-Step Setup Guide
Follow these standard operations on your production server:
Deploy the project source code to /var/www/lacelium and grant ownership to the web server user:
git clone https://github.com/your-org/lacelium-app.git /var/www/lacelium
cd /var/www/lacelium
chown -R www-data:www-data storage storage/cache
chmod -R 775 storage storage/cache
Build optimized autoloader classmaps and omit developer tooling:
composer install --no-dev --optimize-autoloader --no-interaction
Ensure debug mode is turned off and database credentials are set:
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com
NEXIFY_PUBLIC_URL=wss://yourdomain.com
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=lacelium_prod
DB_USERNAME=lacelium_user
DB_PASSWORD=SecurePasswordHere
Nginx Server Configuration
Create a new server block in /etc/nginx/sites-available/lacelium.conf:
server {
listen 80;
listen [::]:80;
server_name yourdomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourdomain.com;
root /var/www/lacelium/public;
index index.php index.html;
# SSL Certificates (managed via Certbot/Let's Encrypt)
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
# Security Headers
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# Pass PHP scripts to FastCGI server
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
# Reverse proxy for real-time Nexify daemon (shares same port externally)
location /ws {
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Systemd Nexify Real-Time Service
Keep the Lacelium Nexify real-time daemon running persistently with a systemd unit. Create /etc/systemd/system/lacelium-nexify.service:
[Unit]
Description=Lacelium Nexify Real-Time Server
After=network.target
[Service]
Type=simple
User=www-data
Group=www-data
Restart=always
RestartSec=5s
WorkingDirectory=/var/www/lacelium
ExecStart=/usr/bin/php /var/www/lacelium/console nexify:serve
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable lacelium-nexify
sudo systemctl start lacelium-nexify
sudo systemctl status lacelium-nexify
Automated Deployment Scripts
In CI/CD environments (GitHub Actions or GitLab CI), run migrations with the --force flag: php dipperlook migrate --force so execution does not prompt for interactive confirmation.
Next Steps
- Explore other deployment targets and containerization in Deployment Hub.
- Configure systemd supervisor for background workers in Nexify Real-Time.
- Tune environment variables and caching in Configuration.