This guide is for services deployed on Railway from a Git repository. dply reads railway.json or railway.toml on the create page, so your build and start commands come with you. Services run as container apps that sleep when idle, with databases and Valkey attached as resources.
How the pieces map
| Railway | dply |
|---|---|
| Service | A container app, or a static site |
railway.json, railway.toml |
Build and start commands imported (see below) |
| Nixpacks or Railpack builds | A generated image for the detected stack, or your own Dockerfile (Frameworks & runtimes) |
| Pre-deploy command | The release command: build.release in dply.yaml or a Procfile release: line (Procfile) |
| Variables and shared variables | Environment (Environment variables) |
| Postgres, MySQL | dply Postgres or MySQL (Postgres, MySQL & MongoDB) |
| Redis | dply Valkey (Valkey (Redis)) |
| Volumes | Not available. Use object storage |
| Cron schedule | A Scheduled task (Scheduled tasks) |
| Replicas, serverless sleep | Instances and Sleeps after (Scaling & sleep) |
| PR environments | Preview deployments |
*.up.railway.app |
The app's *.on-dply.live hostname (Domains) |
| Rollback | Roll back (Deployments) |
What the import covers
When the repository has a railway.json or railway.toml and no dply.yaml, dply uses its build.buildCommand and deploy.startCommand ahead of what it would detect. A service with deploy.cronSchedule gets a note in the build log: add it as a scheduled task instead of a web app. Other settings, such as health checks and restart policies, aren't read.
Each Railway service in a project is its own app on dply. Create one app per service, with Repository root set for a monorepo. See Monorepos.
1. Deploy the app
- Choose New app, connect your source control, and select the repository and branch.
- Check the detected build and start commands, then choose Deploy.
2. Copy variables
In Railway, open the service's Variables tab and choose Raw Editor to copy them in .env format. Paste them into Environment on dply. Leave out variables that reference other Railway services, such as DATABASE_URL and REDIS_URL: dply sets them from the resources you attach next.
3. Attach resources
On the app's Overview, choose Add resource and add a Database (Postgres or MySQL) and dply Valkey for Redis. Redeploy so the app receives the new variables.
4. Move the database
-
Stop writes to the Railway service.
-
Export with the database's public connection URL from Railway:
pg_dump --no-owner --no-acl -Fc "$RAILWAY_DATABASE_URL" > app.dump -
Open the database from the app's Overview. Under Export and import, choose Get upload command, run it where
app.dumpis, then choose Load it.
For MySQL, upload isn't available: export with mysqldump --single-transaction and restore with mysql using the Connection URL under Connect. See Postgres, MySQL & MongoDB.
5. Switch the domain
- Check the app on its
on-dply.liveaddress. - Add the domain under Routing, Domains.
- Lower the TTL on the existing record, then point it at the CNAME target dply shows.
- Choose Verify DNS and wait for TLS to be active.
- Remove the custom domain from Railway, then remove the service.
See Domains.