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

# Self Host on Railway

> Self-host Evidence on Railway from a GitHub repo.

Railway builds the `Dockerfile` from a connected repo.

<Steps>
  <Step title="Add a Dockerfile">
    ```docker filename="Dockerfile" theme={null}
    FROM evidencedev/serve:latest
    COPY --chown=evidence:evidence . /project
    ```
  </Step>

  <Step title="Modify and commit connection.yaml">
    The project must use a [direct connector](/cli/connections), with secrets replaced by `${VAR}` environment references:

    ```yaml filename="connection.yaml" theme={null}
    type: snowflake
    account: xy12345.us-east-1
    user: ${SNOWFLAKE_USER}
    private_key: ${SNOWFLAKE_PRIVATE_KEY}
    warehouse: COMPUTE_WH
    database: ANALYTICS
    ```

    `connection.yaml` is gitignored by default. Once its secrets are `${VAR}` placeholders, remove it from `.gitignore` and commit it — the container reads it at runtime.
  </Step>

  <Step title="Create the service">
    In the Railway dashboard: **New Project → Deploy from GitHub repo**, and select the project's repo. Railway detects the `Dockerfile` automatically.
  </Step>

  <Step title="Set service variables">
    On the service, open the **Variables** tab and add:

    * `EVIDENCE_BASIC_USER` — HTTP Basic Auth username
    * `EVIDENCE_BASIC_PASSWORD` — HTTP Basic Auth password
    * every `${VAR}` referenced in `connection.yaml`, here `SNOWFLAKE_USER` and `SNOWFLAKE_PRIVATE_KEY`

    Use plain **service variables** — shared variables are for referencing values across multiple services. Mark secrets as sealed to hide their values after saving. No `PORT` variable is needed — Railway provides one and the image binds to it automatically.
  </Step>
</Steps>
