Skip to content

Laravel

A Laravel website is a PHP website with Laravel’s defaults. Create a Laravel server first, then add a website to it.

  • A database, always created with the website. Its name, user and password are shown under Databases.
  • The public folder 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 .htaccess files are ignored.

Netkeel does not start a queue worker for you.

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: .env and storage, 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 --force is 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.

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 --show and add it here.
  • Database settings: if you don’t set any DB_* values (or DATABASE_URL) yourself, Netkeel adds the website’s own database for you. If you set them, use localhost as the host with DB_SOCKET=/run/mysqld/mysqld.sock, not 127.0.0.1.

If a deploy fails, see Troubleshooting.

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.

Staging, cloning, moving to another server and import and export are WordPress-only for now. Backups work as for every website.