Skip to content
All posts

Tutorial · Laravel

Deploy Laravel with Auto-Provisioned MySQL in 5 Minutes

Upload your Laravel project — we detect it, spin up a MySQL database, generate your .env, run migrations, and serve it. No DevOps required.

Deploying Laravel traditionally means: provision a server, install PHP extensions, set up MySQL, configure .env, run composer install, generate APP_KEY, run migrations, configure Apache, set up SSL. It's a 45-minute process if everything goes right.

On Hostendor, you upload a ZIP and we do all of that automatically. Here's the walkthrough.

Step 1: Prepare your Laravel project

You don't need to change anything. Hostendor's pipeline handles:

  • Running composer install if vendor/ isn't shipped
  • Detecting any ext-* requirements in your composer.json and installing them
  • Pointing Apache at public/ (Laravel's front controller)

Just make sure your project has a composer.json and a public/index.php. That's it. ZIP it up.

Step 2: Upload and deploy

Go to hostendor.com/upload. Drop your ZIP. Our analyzer detects "Laravel" from your composer.json and the presence of artisan. Click Deploy.

Behind the scenes, here's what happens:

  1. Your ZIP is extracted and analyzed
  2. A PHP-Apache Docker image is built with all required extensions
  3. A MySQL database is auto-provisioned in the same Docker network
  4. An .env file is generated with DB_HOST, DB_DATABASE, DB_USERNAME, DB_PASSWORD, and a cryptographically random APP_KEY
  5. php artisan key:generate runs
  6. php artisan migrate --force runs (with retry — it waits for MySQL to be ready)
  7. php artisan storage:link runs
  8. The container starts and Apache serves your app

Total time: the build, MySQL provisioning, and migrations usually take a few minutes from upload to live.

Step 3: Your app is live

You'll get a URL like https://<id>.app.hostendor.com with automatic Let's Encrypt SSL. Your .env is pre-configured. Your database is running. Your migrations have been applied.

To connect a custom domain, go to the Domains tab in your service dashboard. Add your domain, point your DNS CNAME to app.hostendor.com, and SSL is issued automatically within minutes.

What about environment variables?

Go to the Settings tab → Environment Variables. Your DB_* and APP_KEY are pre-populated. Add any additional vars your app needs (Mailgun keys, Stripe secrets, etc.). Save, restart, and they take effect immediately.

What about queues and scheduled tasks?

Laravel's queue worker runs inside the same container. For scheduled tasks (the scheduler), add a cron job in the Settings tab that hits php artisan schedule:run every minute.

Deploying updates

Connect your GitHub repo from the Settings tab → Auto Deploy. Push to your repo and Hostendor rebuilds your image and restarts — your database and .env are preserved across redeploys.

Try it now

Upload your Laravel ZIP at hostendor.com/upload. The 14-day trial gives you ₹300 of credit with no card required — deploy your side project, portfolio, or client demo and see it running before you pay.

Hostendor

Want to try this on your own project? The 14-day trial comes with ₹300 of credit, and you don't need a card to start.

More from the blog