Laravel
A Laravel website is a PHP website with Laravel’s defaults. Create a Laravel server first, then add a website to it.
What you get
Section titled “What you get”- A database, always created with the website. Its name, user and password are shown under Databases.
- The
publicfolder as the web root. Visitors never see the rest of the project. - Composer on the server, for builds and for the website’s SSH shell.
- Laravel’s scheduler, run every minute for you once the project is in place. You don’t need to add a cron job for
php artisan schedule:run. - Nginx only as the web server, so
.htaccessfiles are ignored.
Netkeel does not start a queue worker for you.
Deploy from Git
Section titled “Deploy from Git”Git deploy is the easiest way to run Laravel. Open Hosting › Deployments and connect your repository. The Laravel preset fills in:
- Build commands:
composer install --no-dev --optimize-autoloader --no-interaction - Shared paths:
.envandstorage, kept between releases - Publish directory:
public. A Laravel website always publishes a folder of its repository, so this can’t be left empty. - After each deploy: Clear and cache config, routes and views is on. Run
php artisan migrate --forceis off; tick it if you want migrations to run on every deploy.
Migrations run before the website switches to the new release: if they fail, the website stays on the release it was on. The caches are built after the switch: if that fails, the deploy shows Live, with a warning.
If your app builds front-end assets, add npm ci and npm run build to the build commands. Node.js is available to the build when a build command uses npm, npx or node.
Once the project is deployed, the scheduler runs from the live release.
Environment variables
Section titled “Environment variables”Set your .env values under Environment variables on the Deployments page. They apply from the next deployment.
- APP_KEY: Laravel needs one. Create it on your computer with
php artisan key:generate --showand add it here. - Database settings: if you don’t set any
DB_*values (orDATABASE_URL) yourself, Netkeel adds the website’s own database for you. If you set them, uselocalhostas the host withDB_SOCKET=/run/mysqld/mysqld.sock, not127.0.0.1.
If a deploy fails, see Troubleshooting.
Upload instead
Section titled “Upload instead”You can also upload the whole project into htdocs with SFTP or the file manager. The public folder inside it is served, and the scheduler starts once the project’s artisan file is there.
What is not available yet
Section titled “What is not available yet”Staging, cloning, moving to another server and import and export are WordPress-only for now. Backups work as for every website.