Migrate from Railway to Laravel Cloud

On Railway, a Laravel app runs as four services you wire together: web, worker, cron, and database. Laravel Cloud runs it as one application, with queues, the scheduler, and autoscaling built in. This guide walks you through moving your Laravel application from Railway to Cloud.

Why migrate from Railway to Laravel Cloud?

  • One application, not four services: Railway splits your Laravel app into web, worker, cron, and database services, each with its own scripts and variables. On Cloud, your app, queues, and scheduler live in one place.

  • Autoscaling on real traffic: Cloud adds and removes replicas based on live traffic, CPU, and memory, on Growth and above. On Railway, you set replica counts by hand.

  • Managed queues: Queue workers scale up when jobs pile up and scale to zero when the queue is empty on Flex compute. You get a jobs dashboard and failed-job retries, with no worker service to size.

  • Scheduler included, no Cron service: One toggle runs Laravel's scheduler every minute on your app compute. There's no run-cron.sh script or extra service to maintain.

  • Jobs finish during deploys: Managed queue workers get up to 90 seconds (Flex) or one hour (Pro) to finish the current job before a new release takes over.

  • Full-stack scale to zero: Compute, databases, and cache sleep when idle and wake together in under 500 ms.

  • Standard Laravel apps can migrate in as little as 30 minutes.

For a full side-by-side, see Laravel Cloud vs. Railway.

“

All feedback I have is positive! We move our production apps to Laravel Cloud as it is safe and very comfortable. Laravel framework became the first choice for new projects and Laravel Cloud is one of the reasons.”

Marcin Kw

Marcin Kw

Developer

See X post

Prerequisites

  • Access to your Railway project and its database service
  • Git repository connected to a supported provider (GitHub, GitLab, Bitbucket)
  • Database credentials for your Railway Postgres or MySQL database
  • The Railway CLI, if you want to export variables or volume files from the command line
  • DNS management access for your domain
  • A Laravel Cloud account
Lower your DNS TTL 24 hours before migration for faster cutover.

Why migrate from Railway to Laravel Cloud?

“

We ran our own Kubernetes cluster. That was a full-time job for two people. It really took a lot of your energy. It's great to have people who are absolute experts on this.”

Alex Millar

Alex Millar

Co-founder at GovAI

Watch the live session

Frequently asked questions

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

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

Very little. You can delete Railway's scripts and config files, add the AWS SDK package for managed queues, and add ->onOneServer() to scheduled tasks that should run once. See the Code changes required section.

You don't need them. Managed queues replace the Worker service, and the Scheduler toggle replaces the Cron service. The scheduler runs every minute, with no script or extra service to maintain.

Laravel's scheduler runs on Cloud without any infrastructure setup, but there's one behavior change to know about. On Railway, the Cron service runs the scheduler on a single instance. On Cloud, if your app scales to multiple replicas, the scheduler runs on each one by default. Add ->onOneServer() to any task that should only fire once per schedule to prevent duplicate runs.

Run railway variables list --kv to export them, then add your app-specific values in your environment's settings on Laravel Cloud. Cloud automatically injects credentials for any attached resources (database, cache, object storage), so leave out DB_URL, DATABASE_URL, REDIS_URL, Railway reference variables like ${{Postgres.DATABASE_URL}}, and QUEUE_CONNECTION. Keep DB_CONNECTION. Redeploy after saving.

Download them with railway volume files download and upload them to Laravel Cloud object storage. Cloud's filesystem resets on each deploy, so uploads need to live in object storage.

Yes. Laravel Cloud also runs Node.js, Bun, and Deno apps (Next.js, Nuxt, Express, Hono), Python (Django, FastAPI, Flask), Ruby on Rails, Go, and Rust. The database export, file transfer, and DNS steps in this guide work the same way. Build commands, environment variables, and background jobs differ by framework, so follow the deploy guide for your runtime. Managed queues and the Scheduler toggle are built for Laravel and Symfony. Other apps run background jobs and scheduled tasks on worker clusters.

Delete your Railway services, volumes, and buckets once migration is complete and validated. Volumes and buckets keep billing for storage while stopped, so delete them to stop all charges.

Ready to focus on shipping?

Let's build the incredible together, with Laravel. Start now with $5 in usage credit.