Migrate from Railway to your own servers

Move your Railway services, variables, cron schedules and Postgres database to Tenkai, step by step.

Last verified on 2 November 2026 against Railway's documentation. Report a mistake.

Your Railway services keep their repository, their variables and their Postgres data when they move to a cluster of servers you own. Tenkai charges your team one price, whatever the number of services.

What each part becomes

On Railway On Tenkai
Service with a public domain Web application
Service without a domain Worker
Service with a cron schedule Scheduled job
startCommand Entrypoint
preDeployCommand Pre-deploy commands
Service variables Variables
Shared variables Environment variables
${{Postgres.DATABASE_URL}} A binding
Postgres PostgreSQL
Redis Redis® or Valkey
Volume Kept directory
PR environments Pull request previews
Custom domains Custom domains

Before you start

You need a cluster with a project on it, as projects and clusters explains. Your CI builds the image of your app, so the cluster needs no Git builds.

Move your services

  1. Build the image in your CI. Add the Dockerfile of your framework's guide, such as Rails, Django, Node.js, Next.js or PHP, and put your buildCommand in it as a RUN step. Then add the workflow that publishes an image to GHCR on each push.
  2. Create the web application. Add a web application, choose Container image and enter your image, such as ghcr.io/acme/app:main. Tenkai sets PORT, so an app that listens on 0.0.0.0:$PORT answers as it does on Railway.
  3. Copy the variables. Run railway variable list --kv in the linked service. Wrap each value in single quotes, then paste the lines in the project's Variables with Edit as .env…. Leave out PORT, the RAILWAY_ lines and the URLs of your Railway databases, because they describe the service on Railway.
  4. Stop the writes. Stop the web services and cron services. Let your workers empty the queue, then stop them too.
  5. Copy Postgres. Turn on Public Access in the database's Settings → Networking. Add a PostgreSQL, choose From database under Initial data and paste the DATABASE_PUBLIC_URL. Turn public access off once the copy ends.
  6. Bind the databases. Bind the PostgreSQL to the web application, so it receives DATABASE_URL. For Redis, add a Redis® and bind it, so the app receives REDIS_URL. The new store starts empty, so sessions and other Redis data start over.
  7. Add the workers, the pre-deploy command and the cron services. A service without a domain becomes a worker from the same image, with its start command as the entrypoint. The preDeployCommand becomes a pre-deploy command. A service with a cronSchedule becomes a scheduled job with the same expression, because both read cron in UTC. Bind the databases to each of them.
  8. Deploy and point your domain. Deploy the web application, then the workers and scheduled jobs, and check the default address. Add each deploy hook to your workflow, as deploy from GitHub Actions explains. Then add your domain, replace Railway's CNAME with the one Tenkai shows and delete Railway's TXT record.

A service with a volume

That service becomes a web application that keeps a directory at the path where your app writes. Deploy it once, then bring the files over. Download them with railway volume files download / ./volume, put an archive of them at an HTTPS address, and download it into the directory from the application's terminal.

Sources

We read these pages on 2 November 2026.

Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd.

Something wrong in this guide?

Railway and Tenkai both change, so a step can go out of date. If a command fails or a step does not match what you see, tell us at [email protected]. Once you have an account, you can also choose “Report a bug” in your user menu, as the account guide explains. We fix the guide and reply to you.

Bring your apps home

Enroll a server you already rent and deploy your first application. Free for one server, no credit card.

Start for free