Deployment
VPS (Nginx + PHP-FPM)
Requirements
- Ubuntu 22.04+ or Debian 12+
- PHP 8.4 with
php-fpm,php-cli, and required extensions - Nginx (or Apache)
- MySQL 8+ or PostgreSQL 14+
- Node.js 18+ for building frontend assets
- Composer
- Supervisor (recommended, for background workers)
Step-by-step
# 1. Clone the projectcd /var/wwwgit clone https://github.com/jambostack/jambo-api.gitcd jambo-api
# 2. Install dependenciescomposer install --no-dev --optimize-autoloadernpm ci && npm run build
# 3. Configure environmentcp .env.example .env# Edit .env with your database, mailer, and APP_SECRET
# 4. Create databasephp bin/console doctrine:database:createphp bin/console doctrine:migrations:migratephp bin/console app:setup
# 5. Set permissionssudo chown -R www-data:www-data var/ public/uploads/Nginx configuration
server { listen 80; server_name api.example.com; root /var/www/jambo-api/public;
location / { try_files $uri /index.php$is_args$args; }
location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
location ~ /\.(ht|git|env) { deny all; }}Supervisor for background workers
[program:jambo-worker]command=php /var/www/jambo-api/bin/console messenger:consume async -vvuser=www-datanumprocs=2autostart=trueautorestart=trueDocker
# Clone and buildgit clone https://github.com/jambostack/jambo-api.gitcd jambo-apidocker compose up -d
# Run setup inside the containerdocker compose exec app php bin/console app:setupThe included compose.yaml sets up PHP-FPM, Nginx, MySQL, and Meilisearch.
Production checklist
- Set
APP_ENV=prodandAPP_DEBUG=0 - Generate a strong
APP_SECRET(openssl rand -hex 32) - Configure HTTPS (Let’s Encrypt recommended)
- Set up database backups
- Enable OPcache in
php.ini - Set proper file permissions (
var/,public/uploads/) - Configure a real mailer DSN (do not use
null://in production) - Run
php bin/console cache:clearafter every deploy