Skip to content

Deploy a Laravel website with a safe document root

Keep application secrets outside the public web root and plan workers and updates.

Protect your data firstKeep a current off-server backup before reinstalling, updating, changing firewall rules, or running an application installer.
On this page

Check your project version

Use the PHP version and extensions required by the project's own Composer dependencies and Laravel release. A generic installer is not a reason to change a production site's framework version.

Protect configuration

Point the web server to the project's public directory, never to its repository root. Keep environment credentials private and production debug output disabled. Give the web process only the required write access to storage and cache; do not make the whole project world-writable.

Plan the runtime

Configure the database, HTTPS, persistent uploads, scheduled tasks, and queue workers needed by the application. Build frontend assets before publishing. Back up the database and files before migrations or a release.

Verify before switching traffic

Test sign-in, forms, email, queues, and recovery in a staging environment. A ZIP of source code is not proof that dependencies, migrations, and workers are ready.

Laravel deployment documentation. Select the version matching your project.

Was this not enough?Include the service number, exact error, and time of the problem. Never send a password or private key.
Contact support