Railway

This covers Railway-specific setup. Refer to Cloud Deployment for the full list of services, environment variables, and domains.

1. Create services

In the Railway dashboard, create three services and one database:

ServiceDockerfile PathRoot Directory
servercore/server/Dockerfile/ (repo root)
uiui/Dockerfileui/
docsdocs/Dockerfiledocs/
Postgres— (Railway-managed plugin)

Link the Postgres plugin to the server service.

2. Set environment variables

Server service:

VariableValue
AILERON_DATABASE_URL${{Postgres.DATABASE_URL}} (Railway variable reference)
AILERON_JWT_SIGNING_KEYGenerate with openssl rand -hex 32
GOOGLE_CLIENT_IDFrom Google Cloud Console (optional)
GOOGLE_CLIENT_SECRETFrom Google Cloud Console (optional)
GITHUB_OAUTH_CLIENT_IDFrom GitHub Developer Settings (optional)
GITHUB_OAUTH_CLIENT_SECRETFrom GitHub Developer Settings (optional)

UI service:

VariableValue
PUBLIC_API_BASEhttps://api.withaileron.ai
PUBLIC_POSTHOG_KEYPostHog project API key (optional)

Branch deploys inherit service variables automatically. OAuth is not available on branch deploys (use email/password login instead).

3. Configure domains

Add custom domains in each service’s Settings > Networking > Custom Domain. Create matching DNS records on Cloudflare (DNS only, not proxied, so Railway can issue TLS certificates).

DomainRailway ServiceDNS Record
api.withaileron.aiserverCNAME to Railway target
app.withaileron.aiuiCNAME to Railway target

4. Register OAuth callback URLs

  • Google: https://api.withaileron.ai/auth/google/callback
  • GitHub: https://api.withaileron.ai/auth/github/callback

5. Deploy

Push to the branch Railway is watching. The Dockerfile builds the image, and on startup the entrypoint applies schema migrations automatically.

6. Verify

curl https://api.withaileron.ai/v1/health