Перевірений фреймворк

Керований хостинг Laravel

Розгорніть застосунок Laravel на керованому сервері з уже налаштованими MySQL, воркерами черг і планувальником.

Підключіть репозиторій GitHub у панелі, виберіть гілку та розгорніть. Точні кроки див. у «Як розгорнути вебзастосунок із GitHub».

Підтримувані версії
8.4, 8.3, 8.2
Режим виконання
Працює як керований, завжди активний процес

Черги та планувальник

Фонові воркери та планувальник Laravel працюють як керовані процеси під наглядом.

MySQL включено

Разом із застосунком розгортається окрема виділена база даних MySQL.

Розгортання без простою

Кожен деплой — це новий ізольований реліз із перевіркою працездатності перед тим, як він стає активним.

Як працює це розгортання

Як ми визначаємо ваш проєкт

  • Файл artisan у репозиторії
  • Пакет laravel/framework у composer.json

Що відбувається під час кожного розгортання

  • Крок збірки composer install --no-dev --no-interaction --optimize-autoloader
  • Крок збірки php artisan optimize:clear
  • Команда запуску php artisan serve --host=0.0.0.0 --port=9000
  • Застосунок слухає порт 9000
  • Новий реліз стає активним лише після того, як /up проходить перевірку стану
  • Підтримуються фонові воркери та заплановані завдання

Змінні середовища

  • Laravel application encryption key. (генерується автоматично) APP_KEY
  • Password for the provisioned application database user. (генерується автоматично) DB_PASSWORD

База даних

  • MariaDB 11.4 створюється поруч із вашим застосунком і не доступна публічно
  • Параметри підключення передаються як змінні середовища DB_CONNECTION, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME

Постійне сховище

  • Ці шляхи зберігаються між розгортаннями storage/app, storage/logs, storage/framework, storage/framework/cache, storage/framework/sessions, storage/framework/testing, storage/framework/views, bootstrap/cache

Мінімальні ресурси

  • 0.5 vCPU, 512 МБ пам’яті, 2000 МБ сховища

What you get when you host Laravel on MoodLensAI

The Laravel preset is built for the way real Laravel applications run in production. Your code is installed with Composer without development packages, the application is served as a managed process, a MariaDB database is provisioned next to it, and the queue worker and the scheduler run as supervised background processes. You do not install PHP, configure a web server or write a systemd unit.

Each deploy is a new, isolated release. It goes live only after the /up health route answers, so a release that crashes on boot never replaces the one that works.

Preparing your repository

Detection is automatic when the repository contains an artisan file and lists laravel/framework in composer.json. Before the first deploy it is worth checking a few points.

  • The /up route must respond. Recent Laravel versions register it by default, and the release only goes live after it answers.
  • Your composer.json must install cleanly without development dependencies, because the build uses the no-dev option.
  • Do not commit your .env file. Configuration is supplied through environment variables from your dashboard.
  • Use the database connection variables that Laravel already reads, so the injected settings are picked up without code changes.
  • Pick a PHP version from the supported list shown above: 8.4, 8.3 or 8.2.

Environment variables and the database

The application key and the database password are generated for you. The connection settings, namely DB_CONNECTION, DB_HOST, DB_PORT, DB_DATABASE and DB_USERNAME, are injected as environment variables, so Laravel's standard database configuration works without edits. The database is not exposed to the public internet and is reachable only from your own application.

Anything specific to your project, such as mail credentials, payment keys or third-party API tokens, you add yourself before deploying. Keep them out of the repository and out of your commit history.

Queues and the scheduler

Background work is a first-class part of the preset. Queue workers run as supervised processes, so a worker that exits is restarted rather than left dead. The Laravel scheduler runs the same way, which means the scheduled commands you define in your application are executed on time without a cron entry that you maintain yourself.

Workers are long-running processes, so plan your queue changes the way you would anywhere else: after you ship a change to a job class, confirm over SSH that the worker is running the new release and not an older one.

Storage, migrations and Artisan

Because every deploy is a fresh release, only certain paths are kept between releases. For Laravel these are storage/app, storage/logs, the storage/framework directories and bootstrap/cache. Uploaded files that you keep under storage/app survive a redeploy, while anything you write elsewhere in the project folder does not.

The build steps run composer install and clear the optimization caches. Database migrations are not part of those steps, so you run them yourself over SSH, which is included on every plan. The same connection lets you run any other Artisan command, open Tinker or inspect logs.

Sizing and what to expect

The minimum footprint of a Laravel deployment is a half share of one vCPU, 512 MB of memory and 2000 MB of storage. That is enough for a small application, an internal tool or an early product. If your queue workers, image processing or reports need more headroom, choose a larger plan instead of squeezing a heavy workload into the smallest one.

Custom domains are supported with one hostname per deployment. You add a single A record at your own DNS provider, MoodLensAI verifies it and issues the SSL certificate automatically. Backups run on a schedule and are stored off the server, so a restore is possible even if the server itself is lost.

A typical first deploy

A first Laravel deploy usually takes four moves. Connect the repository and choose the branch. Confirm that the Laravel preset was detected and pick a PHP version. Add the variables that are specific to your project, for example mail settings or a payment provider key. Start the deploy and watch the output until the health check passes.

Once the release is live, open an SSH session, run your migrations and any seeders you need, and load the site. From then on, a normal change is a commit, a push and a new deploy. Because each release is health-checked before it goes live, you can ship small changes often without worrying that one mistake takes the site down.

Troubleshooting a Laravel deploy

Most failed Laravel deploys come from three causes. A health check that fails after a successful build usually means the application crashes on boot, often because a required variable is missing, so check the output for an exception about the key or the database. A build that stops during Composer installation usually points at a dependency that is only available in development. A release that starts but shows errors on pages that need the database often means migrations have not been run yet.

If you are weighing this against running your own server, the comparison of managed hosting and a VPS lays out what you take on in each case, and the Laravel Cloud alternative page compares this setup with Laravel's own platform.

Пов’язані сторінки

Часті запитання

Які версії Laravel підтримуються?

Перелік підтримуваних версій вище відображає те, з чим реально працює та проти чого тестується конвеєр розгортання.

Чи можу я виконувати команди Artisan?

Так, через SSH-доступ, який включено в кожен тариф.