Migrating From Heroku To Railway
Moving a Heroku app to Railway comes down to three steps: deploy from a GitHub repo, import Heroku config vars, and add Postgres and Redis as separate database services. Railway reads the repo's Procfile and turns each named process (e.g. web, worker) into its own service, which takes the place of Heroku's dyno process model. It injects DATABASE_URL and REDIS_URL automatically, so any imported Heroku copies of those variables must be deleted or they will override Railway's. The guide also covers `railway run` for running commands like migrations against cloud variables, `railway up` for CLI deploys, and having apps listen on 0.0.0.0:$PORT so Railway can expose them.
Related posts
- Migrate a Rails App from Heroku to Render
Render mediumAdept
Migrating the open-source git-scm.org Rails app from Heroku to Render means mapping Heroku concepts (web/worker processes, dynos, Heroku Postgres/Redis, Scheduler, config vars) to Render equivalents and codifying the whole stack in a render.yaml Blueprint. The walkthrough defines a Ruby web service, wires PostgreSQL and Redis connection strings in through environment variables, and adds a bin/render-build.sh script for asset precompilation and migrations that Heroku's buildpack used to handle. It also prompts for secrets like the Bonsai Elasticsearch URL with sync: false, schedules nightly rake tasks as a standalone Cron Job, and deduplicates shared variables with an Environment Group. Practical tips include copying SECRET_KEY_BASE from Heroku so users stay logged in, adding a .ruby-version file, and checking Procfile, app.json and heroku.yml to discover the app's components.
- Getting started with Ruby on Rails and Postgres on Supabase
Supabase mediumAdeptA Rails app can be wired to a Supabase-hosted Postgres database by scaffolding with `rails new -d=postgresql` and supplying the Supabase pooler connection URI through the `DATABASE_URL` environment variable. The walkthrough generates an Article scaffold, runs migrations, inserts and queries records from the Rails console, and routes the root path to the articles index. Deployment to Fly.io uses `fly launch` with Postgres provisioning set to none, the connection string stored as a Fly secret, and `fly deploy`.
- Deploy a Dart App on Railway, Part 1
Railway mediumAdeptA Flutter + Serverpod trivia app is deployed to Railway with a Railway-hosted PostgreSQL database, using the Railway CLI and a custom multi-stage Dockerfile that compiles the Dart server and bundles a Flutter web build into Serverpod's static webserver. Database credentials are wired in through Railway variable references, and migrations are applied in production mode. Because Railway exposes only one port per domain, a Caddy reverse proxy template routes traffic between Serverpod's API port (8080) and web port (8082). A curl request to the example hello endpoint confirms the deployment works.
- Migrate a Django App from Heroku to Render (and get it ready for prod)
Render mediumAdept
A Django e-commerce app (Saleor) can be moved from Heroku to Render by translating its app.json, Procfile, Dockerfiles and docker-compose.yml into a single render.yaml Blueprint. The walkthrough defines the GraphQL API as a web service on Render's native Python environment, then wires in Postgres and Redis through connection-string environment variables. It adds a build script for dependencies and migrations, a static-site dashboard with rewrite rules, and a Next.js storefront that drops the redundant nginx layer. The second half covers production hardening: an RSA key stored as a Secret File, background workers, cron jobs, runtime steps, a message broker, and deriving shared environment variables to keep the Blueprint DRY.
- Building a NestJS App on Railway
Railway mediumAdeptA NestJS app can run on Railway as a Dockerized service from a GitHub repo, with Redis for caching, Postgres via TypeORM, and in-process cron jobs. The walkthrough supplies a Node 20 Dockerfile, an async CacheModule factory using cache-manager-redis-store with a one-week TTL, and a TypeOrmModule config. Each piece reads its connection details from Railway reference variables such as ${{Redis.REDISHOST}} and ${{Postgres.PGHOST}}. For the fastest path, a one-click Railway template provisions the same stack, and ejecting from it afterward puts the repo under your own GitHub account.