Skip to content

Migrate from Railway

Moving from Railway to Ownkube is mostly re-pointing your repo, re-creating your database, and copying your environment variables. There’s no rewrite: if it deploys on Railway, it deploys on Ownkube. This guide walks the cutover, including the database dump and restore.

For a side-by-side of the two platforms, see Ownkube vs Railway.

On RailwayOn Ownkube
Service from a GitHub repoA Web deployment from the same repo
Postgres pluginA managed PostgreSQL database
Service variablesEnvironment variables on the deployment
CronA Job deployment with a schedule
Public domainA public hostname with automatic TLS, plus your custom domain
  1. Connect your repo

    Connect your GitHub or GitLab account so Ownkube can build from the same repo. See Registries.

  2. Create a Web deployment

    From your dashboard, create a Web deployment, point it at your repo and branch, and set the port your app listens on. Ownkube builds from source, or uses your Dockerfile if you have one.

  3. Copy your environment variables

    Bring over the variables you set on Railway. Add them as KEY=value pairs and flip Secret on the sensitive ones. See Environment variables.

  1. Create a managed Postgres database

    Add a Database (PostgreSQL) in the same environment as your app. Ownkube generates credentials and injects DATABASE_URL into your app. See Databases.

  2. Dump from Railway

    Using your Railway database’s connection string, dump the data:

    Terminal window
    pg_dump "$RAILWAY_DATABASE_URL" --no-owner --no-privileges -Fc -f dump.pgc
  3. Restore into Ownkube

    Turn on public access for the new database (temporarily), then restore into it with TLS verification on:

    Terminal window
    pg_restore --no-owner --no-privileges \
    -d "postgresql://user:pass@db-yourname.ownkube.app:5432/app?sslmode=verify-full&sslnegotiation=direct" \
    dump.pgc

    Turn public access back off when the restore finishes. For production traffic, connect from inside the network.

  1. Verify on Ownkube. Open the generated hostname, exercise the app, and confirm it reads and writes the migrated database.
  2. Move your domain. Point your custom domain at the Ownkube deployment. TLS is provisioned and renewed automatically.
  3. Decommission Railway once traffic is served from Ownkube and you’ve confirmed a clean window.

You can start on Ownkube Compute and, if you ever want your own data boundary or your own bill, connect an AWS account and run the same app in your own VPC with no second migration. See Clusters.