Migrate from Railway to Self-Hosted

Railway and Temps share the same deployment model — Git push, auto-detect, run in containers. If your app deploys on Railway it will deploy on Temps with minimal changes. The main difference is databases: Railway provides managed Postgres; on Temps you bring your own or use Temps's managed database service.


Applications

Nixpacks Compatibility

Railway uses Nixpacks to build apps without a Dockerfile. Temps supports Nixpacks-built projects — if your repo has no Dockerfile, Temps auto-detects your framework the same way Railway does.

If you want an explicit build definition, add a Dockerfile at the repo root. Temps will use it automatically.

Environment Variables

Export your Railway variables from Railway → Project → Variables → Raw Editor (copy the .env format), then add them in Temps → Project → Settings → Environment Variables.

Railway injects a few platform variables automatically (RAILWAY_ENVIRONMENT, PORT, etc.). Remove or replace Railway-specific ones:

Railway variableTemps equivalent
PORTSet explicitly or use 8080 (Temps default)
RAILWAY_ENVIRONMENTUse NODE_ENV or a custom TEMPS_ENV var
DATABASE_URL (Railway Postgres)Your new database URL (see below)

Deploy

# Install Temps if not already done
curl -fsSL https://temps.sh/deploy.sh | bash
  1. Go to Projects → New Project in the Temps console
  2. Connect your Git repository and select your branch
  3. Add environment variables
  4. Click Deploy

Databases

Railway provides a managed Postgres service that injects DATABASE_URL automatically. On Temps, choose one of:

  • Temps Managed Services — provision a PostgreSQL container inside Temps (same server, private network, simplest path)
  • External provider — Neon, Supabase, PlanetScale, or any hosted Postgres
  • Self-hosted on your VPS — run Postgres in a Docker container alongside your app

Step 1: Export from Railway Postgres

Find your Railway database URL: Railway → Project → your Postgres service → Variables → DATABASE_URL.

# Export a compressed, portable backup
pg_dump "$RAILWAY_DATABASE_URL" \
  --no-acl \
  --no-owner \
  -Fc \
  -f railway_backup.dump

# Verify the dump is readable
pg_restore --list railway_backup.dump | head -20

Step 2: Create the New Database

Option A — Temps Managed Postgres (recommended):

  1. In the Temps dashboard, go to Managed Services → New Service → PostgreSQL
  2. Choose a name (e.g. myapp-db)
  3. Temps creates a Postgres instance and shows you the connection string

Option B — External Postgres: Create a database at Neon, Supabase, or any Postgres host and copy the connection string.

Step 3: Restore Your Data

# Restore to the new database
pg_restore \
  --clean \
  --if-exists \
  -d "$NEW_DATABASE_URL" \
  railway_backup.dump

# Sanity check — compare row counts between old and new
psql "$RAILWAY_DATABASE_URL" -c "SELECT schemaname, tablename, n_live_tup FROM pg_stat_user_tables ORDER BY n_live_tup DESC LIMIT 10;"
psql "$NEW_DATABASE_URL"     -c "SELECT schemaname, tablename, n_live_tup FROM pg_stat_user_tables ORDER BY n_live_tup DESC LIMIT 10;"

Step 4: Update the Connection String

Update DATABASE_URL in your Temps environment variables. For a Temps managed Postgres on the same server, the format is:

postgresql://postgres:yourpassword@localhost:16432/yourdb

For an external database, use the provider's connection string directly.


Volumes and Persistent Storage

Railway supports persistent volumes for storing files between deploys. On Temps, mount a directory from your VPS into the container via Project → Settings → Volumes, or use object storage (Cloudflare R2, MinIO) for file uploads.


Templates

Railway templates are pre-configured stacks (e.g. "Node + Postgres"). Temps doesn't have a template marketplace, but the examples page covers common stacks with working configs.


Verify and Cut Over DNS

  1. Confirm your app works at the Temps preview URL before touching DNS
  2. Go to Project → Settings → Domains → Add Domain
  3. Add the A or CNAME record shown
  4. Temps provisions TLS automatically

Keep your Railway project running for 48 hours as a fallback.


Next Steps

Was this page helpful?