Skip to content

Search docs

Search the Skiffly documentation

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#

VariableValueRailway equivalent
PORTport the service must listen on (service port, 8080 when unset)PORT
SKIFFLY_PUBLIC_DOMAINfirst public domain (api-x1y2.skiffly.cloud or a verified custom domain); unset when the service has noneRAILWAY_PUBLIC_DOMAIN
SKIFFLY_PRIVATE_DOMAINhostname on the private network (the service slug, e.g. api)RAILWAY_PRIVATE_DOMAIN
SKIFFLY_SERVICE_NAMEservice nameRAILWAY_SERVICE_NAME
SKIFFLY_SERVICE_IDservice idRAILWAY_SERVICE_ID
SKIFFLY_PROJECT_IDproject idRAILWAY_PROJECT_ID
SKIFFLY_ENVIRONMENTenvironment slug (production, staging, pr-42)RAILWAY_ENVIRONMENT_NAME
SKIFFLY_ENVIRONMENT_IDenvironment idRAILWAY_ENVIRONMENT_ID
SKIFFLY_DEPLOYMENT_IDid of the running deploymentRAILWAY_DEPLOYMENT_ID
SKIFFLY_GIT_COMMIT_SHAcommit 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#

SyntaxResolves 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#

VariableMeaning
SKIFFLY_TOKENAPI token; overrides skiffly login
SKIFFLY_PROJECT_ID, SKIFFLY_ENVIRONMENT_ID, SKIFFLY_SERVICE_IDoverride the directory link
SKIFFLY_API_URLGraphQL endpoint
SKIFFLY_CONFIG_DIR, XDG_CONFIG_HOMEconfig location
SKIFFLY_DEBUG1 for stack traces

Read by the MCP server#

VariableMeaning
SKIFFLY_TOKENAPI token (required for npx @skiffly/mcp)
SKIFFLY_API_URLGraphQL endpoint
PORTlistening port of skiffly-mcp serve (HTTP transport)