> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy to Railway

> Deploy PraisonAI to Railway in one command

Deploy your agents to Railway with a starter `railway.json` and a single deploy command.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph "Railway Deploy"
        Create[💻 create --template railway] --> Edit[📝 Edit railway.json]
        Edit --> Deploy[🚀 deploy railway]
        Deploy --> App[✅ Railway service]
    end

    classDef cli fill:#6366F1,stroke:#7C90A0,color:#fff
    classDef edit fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef ok fill:#10B981,stroke:#7C90A0,color:#fff

    class Create cli
    class Edit edit
    class Deploy,App ok
```

<Warning>
  Starter templates ship in the git checkout, **not** in the PyPI wheel (`MANIFEST.in` excludes `infra/`). Run `create` from a monorepo checkout, or set `PRAISONAI_STARTERS_ROOT` / `PRAISONAI_INFRA_ROOT`.
</Warning>

## Quick Start

<Steps>
  <Step title="Scaffold the project">
    The starter drops `railway.json` and `agents.yaml` into the current directory.

    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai deploy create --template railway
    ```
  </Step>

  <Step title="Authenticate with Railway">
    Log in with the Railway CLI.

    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    railway login
    ```
  </Step>

  <Step title="Deploy">
    Push the service to Railway.

    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai deploy railway
    ```
  </Step>
</Steps>

***

## How It Works

The command shells out to `railway up --detach`.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant CLI as deploy railway
    participant Railway as railway CLI

    User->>CLI: praisonai deploy railway
    CLI->>Railway: railway up --detach
    Railway-->>User: Deploy initiated
```

***

## Command Options

| Argument            | Default       | Description           |
| ------------------- | ------------- | --------------------- |
| `FILE` (positional) | `agents.yaml` | Agent file to deploy. |

***

## Starter `railway.json`

The `railway` starter deploys the prebuilt image (no Dockerfile needed).

| Setting              | Value        |
| -------------------- | ------------ |
| `healthcheckPath`    | `/health`    |
| `healthcheckTimeout` | `300`        |
| `restartPolicyType`  | `ON_FAILURE` |

<Note>
  Set the service's source image to `ghcr.io/mervinpraison/praisonai` in Railway settings (pin a version tag for production). The image already exposes `/health` on port 8005.
</Note>

***

## Doctor

Check Railway readiness before deploying.

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy doctor --provider railway
```

<Note>
  `deploy doctor --provider railway` now checks the Railway CLI — previously this reported "Unknown provider".
</Note>

***

## Best Practices

<AccordionGroup>
  <Accordion title="Pin the image tag for production">
    Use a released `ghcr.io/mervinpraison/praisonai` tag instead of `latest` in the Railway service settings.
  </Accordion>

  <Accordion title="Store secrets as Railway variables">
    Add `OPENAI_API_KEY` and other secrets as service variables in the Railway dashboard, not in Git.
  </Accordion>

  <Accordion title="Destroy from the dashboard">
    `praisonai deploy destroy` is not automated for Railway — remove the service in the Railway dashboard or run `railway down` manually.
  </Accordion>
</AccordionGroup>

***

## Related

<CardGroup cols={2}>
  <Card title="Deploy Templates" icon="file-code" href="/docs/docs/features/create-templates">
    Scaffold the railway starter.
  </Card>

  <Card title="Deploy to Render" icon="server" href="/docs/docs/features/render">
    Another one-command PaaS target.
  </Card>
</CardGroup>
