Service settings
Every setting a service has, with its default and the Railway setting it matches.
Settings live in the service panel under Settings. Edits are staged until you press Deploy. A field set by a config file (railway.json, 5050.yaml) shows a file icon and cannot be edited in the console; see Config as code.
The JSON names below are the ones the API, 5050 environment edit --service-config and 5050.yaml use.
| Field | Type | Default and notes | Railway |
|---|---|---|---|
name | string | 1-32 chars, [a-zA-Z0-9-_ ], unique per environment | Service name |
icon | string | icon key or URL path under /icons/ | Service icon |
kind | ServiceKind | No equivalent (web, worker or cron is inferred on Railway) | |
source.type | string | "github" | "image" | "upload" | "empty" | Source (GitHub repo or Docker image) |
source.repo | string | github "owner/name" (GitHub App) or https URL of a public repo | Source Repo |
source.branch | string | default: repo default branch | Branch connected to production |
source.rootDir | string | default "/" | Root Directory |
source.autoDeploy | bool | default true (webhook with an App, polling for public repos) | Automatic deployments on push |
source.waitForCi | bool | not in v0.1; refused with a sentence | Wait for CI (not in v0.1) |
source.image | string | image "nginx:1.27", "ghcr.io/o/r:tag" | Source Image |
source.registryCredential | string | id of a stored credential | Private registry credentials |
build.builder | string | Builder: "auto" (default: Dockerfile if present, else Railpack) | "railpack" | "dockerfile" | "nixpacks" (built with Railpack, with a log line). | Builder (Railpack, Nixpacks, Dockerfile) |
build.dockerfilePath | string | relative to rootDir; default "Dockerfile" | Dockerfile Path (RAILWAY_DOCKERFILE_PATH) |
build.buildCommand | string | Custom Build Command | |
build.railpackVersion | string | RailpackVersion is one of the pinned versions (current and the two before); empty = current. | Railpack version |
build.nixpacksCompat | bool | NixpacksCompat maps NIXPACKS_* variables and nixpacks.toml hints to Railpack. Default true; set false to ignore them. | No equivalent (Nixpacks hints mapped to Railpack) |
build.watchPaths | []string | gitignore-style, relative to repo root | Watch Paths |
build.noCache | bool | NO_CACHE variable | |
build.timeoutMin | int | default: the install's build timeout (30) | No equivalent |
build.configPath | string | ConfigPath is the config-as-code file ("railway.json", "infra/5050.yaml"); empty = look for 5050.yaml, 5050.json, railway.json, railway.toml in rootDir. | Config-as-code file path |
deploy.startCommand | string | Custom Start Command | |
deploy.preDeployCommand | string | Pre-deploy Command | |
deploy.preDeployTimeoutSec | int | default 300, 1..3600 | No equivalent |
deploy.cronSchedule | string | 5-field crontab or @hourly/@daily/@weekly/@monthly | Cron Schedule |
deploy.cronTimezone | string | IANA, default "UTC" | No equivalent (Railway cron runs in UTC) |
deploy.cronOverlap | string | "skip" (default) | "queue" | No equivalent |
deploy.cronTimeoutSec | int | 0 = none | No equivalent |
deploy.healthcheckPath | string | empty = TCP check on the target port | Healthcheck Path |
deploy.healthcheckTimeoutSec | int | default 300 | Healthcheck Timeout (RAILWAY_HEALTHCHECK_TIMEOUT_SEC) |
deploy.restartPolicy | string | "on_failure" (default) | "always" | "never" | Restart Policy |
deploy.restartMaxRetries | int | default 10 | Restart Policy max retries |
deploy.overlapSec | int | keep old serving after cutover, default 0 | RAILWAY_DEPLOYMENT_OVERLAP_SECONDS |
deploy.drainingSec | int | SIGTERM to SIGKILL, default 30 | RAILWAY_DEPLOYMENT_DRAINING_SECONDS |
deploy.replicas | int | default 1; must be 1 with a volume | Replicas |
deploy.maxSurge | string | MaxSurge is how many new replicas start per wave: a number ("1", default) or a percentage of Replicas ("25%"). | No equivalent |
deploy.singleton | bool | Singleton replicas are never rescheduled automatically while their host is offline. Default: on for workers, off for web services. | No equivalent |
deploy.processes | string | Processes per replica. "auto" = one per vCPU of the replica's CPU limit (or of the host when unlimited), 1..32. For Node start commands of the form "node <file>" the agent wraps the process with cluster.cjs; for every runtime it sets WEB_CONCURRENCY and FIFTY_PROCESSES. Default "1". | No equivalent |
deploy.cpuLimit | float64 | vCPU, 0 = unlimited | Resource limits: vCPU |
deploy.memoryLimitMb | int | 0 = unlimited | Resource limits: memory |
deploy.memoryReservationMb | int | MemoryReservationMB is what placement reserves per replica. Default: the memory limit when set, else 256 (database templates 512). | No equivalent |
deploy.runAsUser | string | "0", "1000:1000" | RAILWAY_RUN_UID |
deploy.shmSizeMb | int | default 64 | RAILWAY_SHM_SIZE_BYTES |
deploy.placement.roles | []string | default ["app"]; database templates use ["data"] | Regions (replicas per region) |
deploy.placement.hosts | []string | pin to host ids; overrides roles | No equivalent |
networking.port | int | target port; default from PORT detection, else 8080 injected as PORT | Target port of a domain |
networking.privateName | string | default slug of service name; <privateName>.internal | Private Networking name (name.railway.internal) |
networking.allowMetadata | bool | AllowMetadata lets the service reach 169.254.169.254 and the mesh (Admin only, audited). Default false. | No equivalent |
networking.publicAccess | bool | PublicAccess creates a TCP proxy for database templates. | TCP Proxy for databases |
template | string | Template marks a service created from a template ("postgres", "redis", ...). | No equivalent |
templateVersion | string | TemplateVersion is the chosen major for database templates ("17"). | No equivalent |
Next steps
- Config file schema: the same settings in a file.
- Variables reference: variables that override settings.