Environment variables
The `SKIFFLY_*` variables injected into every container, how they map to Railway's `RAILWAY_*`, and the variables the CLI and MCP server read.
Injected into every service#
| Variable | Value | Railway equivalent |
|---|---|---|
PORT | port the service must listen on (service port, 8080 when unset) | PORT |
SKIFFLY_PUBLIC_DOMAIN | first public domain (api-x1y2.skiffly.cloud or a verified custom domain); unset when the service has none | RAILWAY_PUBLIC_DOMAIN |
SKIFFLY_PRIVATE_DOMAIN | hostname on the private network (the service slug, e.g. api) | RAILWAY_PRIVATE_DOMAIN |
SKIFFLY_SERVICE_NAME | service name | RAILWAY_SERVICE_NAME |
SKIFFLY_SERVICE_ID | service id | RAILWAY_SERVICE_ID |
SKIFFLY_PROJECT_ID | project id | RAILWAY_PROJECT_ID |
SKIFFLY_ENVIRONMENT | environment slug (production, staging, pr-42) | RAILWAY_ENVIRONMENT_NAME |
SKIFFLY_ENVIRONMENT_ID | environment id | RAILWAY_ENVIRONMENT_ID |
SKIFFLY_DEPLOYMENT_ID | id of the running deployment | RAILWAY_DEPLOYMENT_ID |
SKIFFLY_GIT_COMMIT_SHA | commit that was built (repository services only) | RAILWAY_GIT_COMMIT_SHA |
All of them can be referenced from other services (${{api.SKIFFLY_PRIVATE_DOMAIN}}) and from templates and config as code as self (${{self.SKIFFLY_PUBLIC_DOMAIN}}). Not provided: RAILWAY_PROJECT_NAME, RAILWAY_REPLICA_ID, RAILWAY_STATIC_URL, RAILWAY_GIT_BRANCH, RAILWAY_GIT_AUTHOR and the volume variables; read the branch from your CI or set a variable.
Reference syntax#
| Syntax | Resolves to |
|---|---|
${{Postgres.DATABASE_URL}} | variable of the service Postgres (name, slug or id) in the same environment |
${{shared.REGION}} | shared variable of the environment |
${{self.PORT}} | the service being defined (templates, @skiffly/config) |
Resolution happens at deploy time, recursively; unresolved references become empty strings and a warning in the deployment log.
Read by the CLI#
| Variable | Meaning |
|---|---|
SKIFFLY_TOKEN | API token; overrides skiffly login |
SKIFFLY_PROJECT_ID, SKIFFLY_ENVIRONMENT_ID, SKIFFLY_SERVICE_ID | override the directory link |
SKIFFLY_API_URL | GraphQL endpoint |
SKIFFLY_CONFIG_DIR, XDG_CONFIG_HOME | config location |
SKIFFLY_DEBUG | 1 for stack traces |
Read by the MCP server#
| Variable | Meaning |
|---|---|
SKIFFLY_TOKEN | API token (required for npx @skiffly/mcp) |
SKIFFLY_API_URL | GraphQL endpoint |
PORT | listening port of skiffly-mcp serve (HTTP transport) |