On this site, you find a guide to install Laravel on CloudPanel.
- Click on + Add Site and then click on Create a PHP Site.
- Select the Application Laravel 10, enter Domain Name, Site User, Site User Password, and click on Create.
If you like the command line, you can create a Laravel Site with the following command as root user.
clpctl site:add:php --domainName=www.domain.com --phpVersion=8.2 --vhostTemplate='Laravel 10' --siteUser='john-doe' --siteUserPassword='!secretPassword!'
- Log in via SSH with the Site User:
- Go to htdocs and delete the directory which CloudPanel has created:
cd htdocs && rm -rf www.domain.com
- Create a Laravel Project via Composer:
php8.2 /usr/local/bin/composer create-project --prefer-dist laravel/laravel:^10 -n www.domain.com
- Done! You can now open your site in your browser to see the welcome page.