EN

Web hosting

Host a Laravel site on Plesk

Put a Laravel application online on Plesk, with or without Laravel Toolkit: PHP version, database, .env file, migrations, scheduled tasks and common errors.

10 min read, updated on 18 November 2026

On this page

Your values

Enter them once and the commands in this guide update.

This guide shows you how to publish a Laravel application on your Plesk hosting. It covers two methods: with Laravel Toolkit, the Plesk tool dedicated to Laravel, or manually if this tool is not available.

Prerequisites

  • Access to your Plesk panel (see Connect to Plesk interface).
  • A domain attached to your hosting and pointing to it.
  • A PHP version compatible with your application. Laravel 13 requires PHP 8.3 or higher. For another Laravel version, check the php line in your composer.json file.
  • The PHP extensions required by Laravel: Ctype, cURL, DOM, Fileinfo, Filter, Hash, Mbstring, OpenSSL, PCRE, PDO, Session, Tokenizer and XML, plus pdo_mysql for MySQL or MariaDB.
  • Your project, in a Git repository or on your computer.

This guide uses httpdocs, the usual folder for the main domain. For an additional domain, the folder may be different: check the Document root under Hosting & DNS > Hosting.

Key point: the public folder

Only Laravel's public folder should be reachable from the web. The rest of the project contains, among other things, the .env file with your passwords and encryption key. Never move index.php to the project root: the domain's document root must point to public.

With a project placed in httpdocs, the value to use is /httpdocs/public.

Step 1: choose the PHP version

  1. Go to Websites & Domains and find your domain.
  2. Open PHP (or PHP Settings, depending on your Plesk version).
  3. Select a compatible version, then save.

Step 2: create the database

Create a database and a dedicated user by following the Create a database guide. Write down the database name, the user, the password and the host shown by Plesk in the database connection information.

Method 1: with Laravel Toolkit

Install the application

In Websites & Domains, on your domain, click Create Website > Laravel, then choose one of these options:

  • Install from remote repository: enter your repository URL. If it is private, add the public key displayed by Plesk to your repository (the process is explained in Deploy from GitHub or GitLab). Then click Install Application.
  • Install Skeleton: Plesk installs a blank Laravel application. Click Install Application, then, if you already have a project, replace the files with your own over FTP or with the file manager.

If your application is already on your hosting:

  1. Under Hosting & DNS > Hosting, set Document root to /httpdocs/public, then click Save.
  2. Go back to the Dashboard tab, click Create Website > Laravel, then Cancel.
  3. Click Scan so that Plesk detects the application.

Configure the .env file

Open Laravel from your domain. Next to Environment variables (.env), click Edit, adjust the following values, then click Update:

Configuration
APP_NAME="My application"
APP_ENV=production
APP_DEBUG=false
APP_URL=https://your-domain.com

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=database_name
DB_USERNAME=database_user
DB_PASSWORD=database_password

Run the Artisan commands

In the Artisan tab, enter each command without the php artisan prefix, then run it:

Text
key:generate --force
migrate --force
storage:link
optimize
  • key:generate --force creates the APP_KEY key. Run it only if this value is empty: changing the key of a live site makes encrypted data unreadable and logs users out.
  • migrate --force creates the tables. By default, Laravel also stores sessions, cache and queues there.
  • storage:link makes the files on the public disk accessible.
  • optimize caches the configuration, routes, events and views.

Deploy updates

In the Deployment tab:

  1. Choose the Deployment mode: Manual or Automatic.
  2. Under Deployment scenario, clear the steps you do not need.
  3. Click Deploy.

The Edit script button lets you customize the deployment, provided SSH access is allowed for the domain.

Enable scheduled tasks

Tasks are defined in the application code, usually in routes/console.php. They cannot be created from Plesk. Once at least one task exists, the Scheduled Tasks tab appears: set its toggle to Enabled.

Enable queues

Queues in Laravel Toolkit rely on the database and on scheduled tasks, which must therefore be enabled.

  1. Add the Plesk integration package to the require section of composer.json, checking that it is compatible with your Laravel version:

    JSON
    "plesk/ext-laravel-integration": "^7.0"
  2. Deploy, then commit the updated composer.lock file and deploy again.

  3. Check that QUEUE_CONNECTION=database is present in the .env file.

  4. Turn on Maintenance mode.

  5. In Artisan, run migrate --force. If your project does not contain a migration for the jobs table, run queue:table first.

  6. Turn off Maintenance mode, then set the Queue toggle to Enabled.

Method 2: without Laravel Toolkit

Prepare the project on your computer

From the project folder, install the production dependencies and build the front-end files:

Terminal
composer install --no-dev --optimize-autoloader
npm ci
npm run build
php artisan key:generate --show

Keep the key displayed by the last command: it starts with base64:. If your site is already live, reuse its current key instead.

Upload the files

  1. Create a .zip archive of the project, including the vendor and public/build folders, but without node_modules or your local .env file.

  2. In Files, open httpdocs, upload the archive, select it, click Extract Files, then delete it.

  3. Create a .env file in httpdocs based on the example from method 1, and add your key to it:

    Configuration
    APP_KEY=base64:YOUR_GENERATED_KEY

You can also use an FTP account to upload the files.

Set the document root

  1. In Websites & Domains, open Hosting & DNS > Hosting for your domain.
  2. Set Document root to /httpdocs/public.
  3. Click Save.

Run the Artisan commands

With SSH access, use the PHP binary matching the version chosen for the site. The php command on its own may point to a different version:

Terminal
cd httpdocs
/opt/plesk/php/8.3/bin/php artisan migrate --force
/opt/plesk/php/8.3/bin/php artisan storage:link
/opt/plesk/php/8.3/bin/php artisan optimize

Without SSH access, use scheduled tasks:

  1. Open Scheduled Tasks, then click Add Task.
  2. Choose Run a PHP script.
  3. Select the httpdocs/artisan file with the folder icon.
  4. In the arguments field (with arguments), enter migrate --force.
  5. Select the PHP version used by the site.
  6. Click Run Now and wait for the result.

Repeat the operation with storage:link, then optimize. You can then cancel without saving the task.

Schedule Laravel tasks

If your application uses the scheduler, create a Run a PHP script task as above, with the schedule:run argument and the following frequency, in Cron style:

Text
* * * * *

Check the result

  1. Open https://your-domain.com/: your application should be displayed.

  2. Test Laravel's health route, present by default in recent projects:

    Terminal
    curl -i https://your-domain.com/up

    A 200 status code means that the application started without errors.

  3. Check that no sensitive file is exposed: https://your-domain.com/.env must never display your configuration.

  4. Test a page that uses the database, such as the login page.

Troubleshooting

500 error with no details

Check storage/logs/laravel.log from the file manager, or use the Logs button in Laravel Toolkit. Only turn on APP_DEBUG=true briefly if the log is not enough.

No application encryption key has been specified.

The APP_KEY variable is empty or missing. Generate it with key:generate --force, or paste the key created on your computer, then run config:clear.

Your .env changes are ignored

The configuration is cached. Run optimize:clear, then optimize once the problem is solved.

403 or 404 error, or a file listing on the home page

The document root probably does not point to public. Check that it is set to /httpdocs/public. If only inner pages return a 404 error, check that the public/.htaccess file was uploaded.

Vite manifest not found at: .../public/build/manifest.json

The front-end files were not built or uploaded. Run npm run build, then upload the public/build folder.

SQLSTATE[HY000] [1045] Access denied

The database user or password is incorrect, or the user is not associated with this database. Correct the .env file, then run config:clear. If the password contains spaces or the # character, put it in quotes.

SQLSTATE[HY000] [2002]

Laravel cannot reach the database server. Check DB_HOST and DB_PORT against the database connection information. If the message says No such file or directory with localhost, try DB_HOST=127.0.0.1.

SQLSTATE[42S02]: sessions or cache table not found

The migrations have not been run on this database. Run migrate --force.

Failed to open stream: Permission denied in storage

Laravel must be able to write to storage and bootstrap/cache. Check the permissions of these folders in the file manager. If you cannot correct them, contact support.

Your Composer dependencies require a PHP version ">= 8.3.0"

The site or the command line is using a PHP version that is too old. Select the right version in Plesk and, over SSH, call the full binary path, for example /opt/plesk/php/8.3/bin/php.

Uploaded images return a 404 error

The link to public storage is missing or was lost during a deployment. Run storage:link again.

The Scheduled Tasks tab does not appear

It is only displayed if the application defines at least one task. Check routes/console.php, then run a new deployment.