# Railway

Railway builds the hub from the repository (`railway.json` points it at `deploy/Dockerfile`).

1. In Railway, choose **New project → Deploy from GitHub repo** and pick OpenKedai (or your fork).
2. In the service, add a **Volume** mounted at `/data`. Without it, every deploy erases the
   hub's shops.
3. Under **Variables**, add `OPENKEDAI_DATA_DIR=/data`.
4. Under **Settings → Networking**, choose **Generate Domain**. The hub uses that address in
   pairing codes on its own.
5. Redeploy, then find `Setup code: …` in the **Deploy Logs**, open the domain, and choose **Set
   up a new shop**.

## Settings

Under **Variables**; see [Configuration](https://docs.openkedai.com/self-hosting/configuration/). For backups to S3-compatible storage,
add the `OPENKEDAI_BACKUP_S3_…` variables ([Backups](https://docs.openkedai.com/self-hosting/backups/)).

## Updating

Railway deploys new commits of the branch it follows. Turn that off under **Settings** to update
on your own schedule.

## Good to know

- One replica only: the data is on its volume.
- A Railway template (one-click deploy with the volume already set up) will come with the first
  release.
