Migrate from Heroku to Laravel Cloud

Users who’ve migrated from Heroku to Laravel Cloud estimate cost reductions of up to 50%. If you’re ready to make the switch, this guide walks you through migrating your application from Heroku to Cloud.

Burger Close

Guide

Why Migrate from Heroku to Laravel Cloud?

  • Reduce infrastructure costs. Users who migrated from Heroku to Laravel Cloud estimated savings of up to 50% in infrastructure costs.

  • Built for Laravel, not adapted for it. Heroku is a general-purpose PaaS that relies on buildpacks, Procfiles, and manual PHP configuration. Laravel Cloud is purpose-built for Laravel, with framework-aware defaults and no boilerplate setup required.

  • Consistent, zero-downtime deployments. Heroku build times vary depending on buildpack configuration and slug size. Laravel Cloud is optimized specifically for Laravel applications, delivering reliable sub-minute deployments with zero-downtime releases included by default.

  • More included, fewer add-ons. Features such as edge caching, DDoS protection, and auto-hibernation are built into Laravel Cloud. On Heroku, comparable functionality typically requires multiple paid add-ons and additional configuration.

Laravel Cloud provides the programmable, seamless infrastructure that mirrors our own ambition, allowing us to slash our spend by 50% and shift our focus from managing servers to building the future of insurance.”

Craig Morris

Craig Morris

Technical Program Manager at Superscript

Prerequisites

  • Access to your current Heroku application and Postgres database
  • Git repository connected to a supported provider (GitHub, GitLab, Bitbucket)
  • Database credentials for your existing Heroku Postgres database
  • DNS management access for your domain
  • A Laravel Cloud account

If you already have all these prerequisites in place, lower your DNS TTL 24 hours before migration for faster propagation.

Heroku to Laravel Cloud: Migration steps

Set up Laravel Cloud account

Create your account at cloud.laravel.com and set up your organization. Have questions? Check our Laravel Cloud Quickstart documentation.

Have a complex migration and need assistance? Contact sales.

Create your new application

  • From your Laravel Cloud dashboard, click + New application.
  • Connect your Git provider (GitHub, GitLab, or Bitbucket).
  • Select your repository and branch.
  • Configure your environment settings:
    • Choose PHP version from the list of supported versions.
    • Set environment variables (copy from Heroku or .env).
    • Add any secrets your application needs.

Don't deploy yet. Set up your infrastructure first by following the next steps. For more info, here's how you can configure your application.

Provision your new infrastructure

Create the resources your application needs:

Postgres database
  • In your environment's infrastructure canvas, add a Database.
  • Choose Postgres (Heroku uses Postgres).
  • Select compute size based on your needs.
  • Enable public endpoint for migration (you can disable after).
  • Laravel Cloud automatically configures Laravel environment variables.
KV store for cache/session storage
  • Add a KV Store resource to your infrastructure canvas.
  • Choose Redis or Valkey
  • Laravel Cloud automatically configures Laravel environment variables.
Object storage (S3-compatible)
  • Add Object storage if you use file uploads.
  • Update your filesystems.php configuration to use the Laravel Object Storage.

Laravel Cloud automatically injects connection credentials as environment variables, so no manual configuration is needed.

You've now set up a new Laravel Cloud account and provisioned all necessary infrastructure. You can now migrate your Heroku application to Laravel Cloud.

Prepare to migrate

  • Log into your Heroku account.
  • Get your Heroku database credentials:
    • Check Heroku dashboard → Datastores → Credentials

Migrate your database

With your new Laravel Cloud database provisioned and public endpoint enabled:

Finding your Laravel Cloud database credentials:

  • Application dashboard → Environment → Database → Connection Details
  • Credentials are also injected as environment variables
Export from Heroku
# From your local machine
pg_dump \
  -Fc \
  -f "dump-file.bak" \
  "postgresql://heroku-db-username:heroku-db-password@heroku-db-host:heroku-db-port/heroku-db-database"
Import to Laravel Cloud
# From your local machine
pg_restore \
  --clean \
  --no-owner \
  --no-acl \
  --if-exists \
  --dbname="postgresql://cloud-db-username:cloud-db-password@cloud-db-host:cloud-db-port/cloud-db-database" \
  "dump-file.bak"

At this point, you are ready to deploy your application to Laravel Cloud by hitting the "Deploy" button. Follow the next steps to test if everything is working correctly.

Test your Laravel Cloud deployment

Before switching DNS:

  • Deploy your application: Click the Deploy button in Laravel Cloud.
  • Verify deployment: Check the deployment logs for any errors.
  • Test using Laravel Cloud URL: Every environment gets a .laravel.cloud URL.
  • Run smoke tests: Verify critical functionality works.
  • Check background jobs: Ensure queues are processing correctly.

Switch DNS to Laravel Cloud

Once verified, point your domain to Laravel Cloud:

  • In the Laravel Cloud dashboard, go to Domains and add your custom domain.
  • Laravel Cloud will provide DNS records (A/CNAME).
  • Update your DNS provider with the new records.
  • SSL certificates are automatically provisioned and renewed.

Disable public database endpoint (optional)

After migration is complete and stable:

  • Disable the public endpoint on your Laravel Cloud database for security.
  • Your application will continue to access it via private network.

End your Heroku subscription

Once you've successfully deployed and tested your application, don't forget to cancel your Heroku add-ons and dynos. You can remove the Heroku app or keep it for reference until you're confident in Laravel Cloud.

Successfully migrated? Email Support ([email protected]) with a screenshot of your Heroku cancellation, and we'll send you a code for $50 off on Laravel Cloud.

Common migration scenarios

Scenario 1: Standard Laravel app

Heroku setup: Postgres + Redis + S3/assets + queues

Laravel Cloud setup: Postgres database + Redis + object storage + Queue cluster for intelligent scaling

Estimated migration time: 30-60 minutes

Scenario 2: API-only application

Heroku setup: Postgres + Heroku Redis or similar

Laravel Cloud setup: Postgres database + Redis

Estimated migration time: 20-40 minutes

Scenario 3: Multi-environment setup

Heroku setup: Production + staging apps

Laravel Cloud setup: Create separate environments in the same application

Estimated migration time: 45-90 minutes per environment

Scenario 4: Heroku Private Spaces to Private Cloud

Heroku setup: Private spaces

Laravel Cloud setup: Private cloud

Estimated migration time: Contact sales

Post-migration validation

After successful migration:

1. Configure autoscaling

Set appropriate min/max replicas based on your traffic patterns.

2. Enable auto-hibernation

For staging/development environments to reduce costs.

3. Set up queue clusters

Leverage Laravel Cloud's autoscaling queue workers for background jobs.

4. Monitor performance use

Use Laravel Cloud's built-in metrics to optimize compute resources.

5. Review costs

Compare your Laravel Cloud usage costs to previous Heroku bills.

Your Heroku to Laravel Cloud migration is now complete!

Migrating from Heroku to Laravel Cloud gives you a cleaner workflow, faster deployments, and predictable performance without the overhead of managing Heroku add-ons and dynos.

With zero-config environments, autoscaling, and a straightforward infrastructure model, most applications can be migrated in under an hour.

By following the steps in this guide, you can transition smoothly and start taking advantage of Laravel Cloud's simpler, more cost-effective platform.

Need extra guidance?

Migration assistance

Contact sales for complex migrations

AI-assisted migration

Using an agent for your migration? Copy the URL into your terminal.

Frequently asked questions

Most applications can be migrated in under an hour. Complex apps may take 2-4 hours.

No. Keep Heroku running while you set up Laravel Cloud, then switch DNS when ready.

In most cases, no. Laravel Cloud is designed to work with standard Laravel applications. Heroku uses Postgres, and Laravel Cloud supports Postgres too.

Laravel's scheduler works the same on Laravel Cloud, no changes needed.

No. Heroku uses the Procfile to define your web process, workers, and release commands. On Laravel Cloud, all of this is configured through the dashboard: your web server, queue workers, scheduler, and deploy commands are all managed via the UI. You can delete the Procfile.

No. Heroku uses buildpacks to detect and build your PHP app. Cloud is purpose-built for Laravel — it detects your app automatically from the repo. You choose your PHP version and Node version (for frontend builds) in the environment settings. Frontend build steps (like npm install && npm run build) go in the Build Commands section of your environment settings.

On Heroku, you probably ran a separate worker dyno with php artisan queue:work in your Procfile. On Laravel Cloud, you have two options: create a dedicated queue cluster from the infrastructure canvas (autoscales based on job depth and latency), or enable background processes on your existing App cluster.

Go to your environment's settings in the Laravel Cloud dashboard and add them in the Environment variables section. Cloud automatically injects credentials for any attached resources (database, cache, object storage), so you can skip those. Just bring over your app-specific variables, such as API keys, mail config, etc. Redeploy after saving.

Documentation

cloud.laravel.com/docs

Migration Assistance

Contact sales for complex migrations.

Laravel Cloud provides the programmable, seamless infrastructure that mirrors our own ambition, allowing us to slash our spend by 50% and shift our focus from managing servers to building the future of insurance.”

Craig Morris

Craig Morris

Technical Program Manager at Superscript

Ready to focus on shipping?

Let's build the incredible together, with Laravel