Deploying a Laravel site on a Plesk panel can be a straightforward process when you follow the right steps. In this blog post, we will walk you through the process of deploying your Laravel site on a Plesk panel, ensuring a smooth and successful deployment. This guide is assuming you already have a Plesk Panel installed with a domain pointing at the server. So basic level of knowledge is needed for the Plesk Panel and this guide also is the same for Statamic sites as they are made from Laravel, Let’s dive in!
Version used in this guide: Plesk Obsidian Web Pro Edition 18.0.52
There is an extension on the Plesk Panel that helps you install Laravel applications with the correct configurations called Laravel Toolkit, we will be installing this on to Plesk. From your Plesk Panel go to “Extensions” → this should leave you on the Extensions Catalog → search for “Laravel Toolkit” → Then click “Install”.
Before deploying your Laravel/Statamic site, you need to create a domain or subdomain in your Plesk panel. This will be the location where your site will be accessible. If you are in Power User Mode: Go to “Website & Domains” →” Add Domain” → Click “Laravel” to install the Laravel application on the domain → Fill out the “Registered Domain Name” with your domain leaving the “Webspace” as “Create new subscription” → Choose your Username and Password then “Add Domain”.
Whereas Service Provider View you Go to “Domains” and follow the above.
You are now ready to install the Laravel application using the toolkit. You can install your Laravel application from a remote repository such as Github, Gitlab or Bitbucket etc or you can install only the skeleton of Laravel with a local git repository created. You can do this by “Install Application” → “Install Skeleton” to create a fresh new application.
OR “Install Repository” to install from a remote repository → Enter the URL in the “Repository” and it will install your repository. You might need to enter the details of your remote repository if it is private and make sure from the remote that you have the allowed access and permission to install the files. This will vary per repository provider.
You should now be redirected to the Laravel dashboard of the domain. To access the `.env` file for your application it is under the “Dashboard” tab under “Settings” labelled “Environment variables (.env)”. This can be left alone if it has been installed from Skeleton as it is already done for you, else if its a different application from a remote source it may need configuration.
Ensure that your domain is properly configured to point to your Plesk server’s IP address. Update the DNS settings of your domain in your domain registrar’s settings if necessary.
Access your Laravel site through the domain or subdomain you set up on Plesk. Verify that your site is functioning as expected. If you have any scheduled tasks or cron jobs required for your site, set them up in Plesk accordingly.
Deploying a Laravel site on a Plesk panel doesn’t have to be complicated. By following these step-by-step instructions, you can successfully deploy your Laravel site, ensuring it runs smoothly and securely. Enjoy the benefits of Plesk’s powerful management tools and take your Laravel project to the next level! Remember, specific steps may vary based on your server setup, Plesk version, and individual requirements. Always refer to the official Plesk documentation or seek assistance from the Plesk support team for the most accurate instructions tailored to your environment. Happy deploying!
1. File Permissions: Ensure proper file permissions are set for Laravel files and directories to avoid read or write errors. 2. Database Connection Issues: Double-check database credentials and the `.env` file to prevent database connection errors. 3. Document Root Misconfiguration: Set the document root to the `public` folder of your Laravel installation to avoid 404 errors and security risks. 4. DNS Configuration: Verify that your domain is correctly configured to point to the Plesk server’s IP address to avoid accessibility issues. 5. Cache-related Issues: Clear Laravel caches (`php artisan cache:clear`, `php artisan config:clear`, `php artisan route:clear`) if configuration or routing updates don’t reflect on the deployed site. 6. Missing Dependencies: Make sure all required dependencies and packages are installed on the server using `composer install` or `composer update`. 7. Server Environment Compatibility: Check PHP version, required extensions, and other Laravel specifications to ensure server environment compatibility.
Remember to refer to error messages, review logs, and consult official documentation for Laravel and Plesk to troubleshoot and resolve specific issues during deployment.