Skip to content

Deploy Laravel

A Laravel application with its database, cache, queues, scheduler and migrations, on Fransys.

Checked against the console on 23 Oct 2026
  • A project attached to a cluster (First deployment).
  • Your application in a GitHub or GitLab repository, or a Docker image that’s already built.

Add an Application: Fransys runs it from a Docker image, either the one your Dockerfile builds or an image that’s already published. Connect the repository and the CI: see From GitHub or GitLab.

Set the Container port to the one your web server listens on (for example 8080 with the serversideup/php images, 80 with a standard nginx).

Add a PostgreSQL or MariaDB database linked to the application. The application receives its connection variables: open the Variables tab to see their names.

Laravel expects DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD. Two ways to match them:

  • rename each received variable in this service (Name in this service);
  • or add DB_HOST=${…} referencing the received variable, with Allow ${VAR} references.

Add DB_CONNECTION=pgsql (or mariadb).

Import your .env.example (Multiple variables (.env) mode), then fill in:

  • APP_KEY: generate it on your machine with php artisan key:generate --show, and add it protected;
  • APP_ENV=production, APP_DEBUG=false;
  • APP_URL: the service’s address, on fransysapp.com or your own domain.

Keep secrets (API keys, SMTP passwords) as protected variables.

Add a Redis linked to the application: it receives REDIS_HOST, REDIS_PORT and REDIS_PASSWORD, the names Laravel expects. Then CACHE_STORE=redis, SESSION_DRIVER=redis, QUEUE_CONNECTION=redis.

In Deployment commands, add php artisan migrate --force to After the first install and to After an update. Add php artisan optimize in the same place if you cache your configuration.

Add a scheduled task php artisan schedule:run every minute (* * * * *). Your tasks stay defined in your code (routes/console.php or app/Console/Kernel.php).

Fransys doesn’t change the container command. Have your entrypoint read a role:

entrypoint.sh
#!/bin/sh
if [ "$CONTAINER_ROLE" = "worker" ]; then
exec php artisan queue:work --tries=3
fi
exec "$@"

Then copy the application service and add CONTAINER_ROLE=worker to the copy. Your agent can prepare this copy in a plan.

A container restarts without its files. For storage/app, add a volume in Storage (mount point /var/www/html/storage/app, depending on your image), or use S3-compatible object storage.

For broadcasting, add a WebSocket service linked to the application, and the Pusher driver. See Other services.

Open the agent in the repository folder and give it the instruction from the launch guide: it reads the Dockerfile, the docker-compose file and the .env.example, then prepares the port, variables, databases, scheduler and workers in a plan, which you review. See Deploy your code.