Managed Laravel hosting
Deploy a Laravel application on a managed server with MySQL, queue workers and the scheduler already wired up.
Connect your GitHub repository from your dashboard, pick the branch and deploy it. See "How to deploy a web app from GitHub" for the exact steps.
- Supported versions
- 8.4, 8.3, 8.2
- Runtime mode
- Runs as a managed, always-on process
Queues & scheduler
Background workers and the Laravel scheduler run as managed, supervised processes.
MySQL included
A dedicated MySQL database is provisioned alongside your app.
Zero-downtime releases
Each deploy is a new, isolated release with a health check before it goes live.
How this deployment works
How we detect your project
- A artisan file in the repository
- The package laravel/framework in composer.json
What happens on every deploy
-
Build step
composer install --no-dev --no-interaction --optimize-autoloader -
Build step
php artisan optimize:clear -
Start command
php artisan serve --host=0.0.0.0 --port=9000 - The app listens on port 9000
- A new release goes live only after /up answers the health check
- Background workers and scheduled tasks are supported
Environment variables
-
Laravel application encryption key. (generated for you)
APP_KEY -
Password for the provisioned application database user. (generated for you)
DB_PASSWORD
Database
- MariaDB 11.4 is provisioned next to your app and is not exposed publicly
-
The connection settings are injected as environment variables
DB_CONNECTION, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME
Persistent storage
-
These paths survive redeploys
storage/app, storage/logs, storage/framework, storage/framework/cache, storage/framework/sessions, storage/framework/testing, storage/framework/views, bootstrap/cache
Minimum resources
- 0.5 vCPU share, 512 MB memory, 2000 MB storage
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.
Related pages
Frequently asked questions
Which Laravel versions are supported?
See the supported versions listed above; this list reflects what the deployment pipeline actually builds and tests against.
Can I run Artisan commands?
Yes, via SSH access, which is included on every plan.