sincecutoff.com
← all changes

railway config targets project, environment, and service through environment variables

Introduced 2026-03-25 · score 0.94

HOW TO USE IT

When running a Railway CLI command without persisted link state, set both project and environment IDs; the CLI then builds the linked project from those IDs. Set the service ID optionally to target a service.

RAILWAY_TOKEN=<project-token> RAILWAY_PROJECT_ID=<project-id> RAILWAY_ENVIRONMENT_ID=<environment-id> RAILWAY_SERVICE_ID=<service-id> railway status

WHY THIS HELPS

Run Railway CLI commands in a CI or scripting workflow that cannot persist link state on disk.

BEFORE THIS CHANGE

The CLI deployment guide instructs users to run `railway link` before `railway up` when the project is not already linked.

REQUIREMENTS AND LIMITATIONS

  • Version: v4.35.0
  • RAILWAY_PROJECT_ID (required): Project ID; must be set together with RAILWAY_ENVIRONMENT_ID for env-var targeting.
  • RAILWAY_ENVIRONMENT_ID (required): Environment ID; must be set together with RAILWAY_PROJECT_ID for env-var targeting.
  • RAILWAY_SERVICE_ID: Service ID to use; if absent, the CLI may use a service from the locally linked project configuration.
  • RAILWAY_TOKEN (required): Authentication token required for this env-var project targeting path; Railway documents project tokens for project-scoped CLI actions.
  • Prerequisite: Authenticate with a Railway token; the v4.35.0 targeting code errors when no Railway auth token is available. Railway documents RAILWAY_TOKEN for project-scoped operations.
  • The `LinkedProject` is constructed on the fly when both project ID and environment ID environment variables are set.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card