# Try on a Railway VM (/docs/cli/try-on-railway)

`try` runs a project on a free, temporary Linux VM from [Railway](https://railway.com/free-vm) instead of your machine, and prints its preview URL. There is no database, Docker, or Railway account to set up. It needs CLI 0.18.0 or newer; `pnpm clubedge try` inside a project needs 0.19.0.

<Callout type="warn">
  Experimental. Railway can change or pause its free VM; when it is unavailable, the CLI says so and nothing is created.
</Callout>

## Try a new project [#try-a-new-project]

```npm
npx @clubedge/create-clubedge-app try
```

The CLI creates the project on the VM, starts its database, migrates, and starts the app. When the app answers, it prints the preview URL and opens it in your browser. Sign up, open the dashboard, and look around.

The VM has no Docker, so the project uses `--infra local` (PGlite, an in-process PostgreSQL) and Better Auth, with email off. Choose the rest with the usual flags:

```sh
pnpm dlx @clubedge/create-clubedge-app try --framework tanstack-start
pnpm dlx @clubedge/create-clubedge-app try --auth none --cache memory
```

With `--infra neon` (CLI 0.30.0 or newer), the CLI creates a free [Neon database](./neon.mdx) on your machine first, and the VM migrates it and runs the app against it. Run `pnpm dlx @clubedge/create-clubedge-app neon claim` afterwards, outside a project, to keep it.

Other `--infra` options and `--auth supabase` are refused, since they need Docker or a Supabase project.

## Try the project you're working on [#try-the-project-youre-working-on]

Inside a project, `try` uploads it instead, so you can share work in progress without deploying:

```sh
pnpm clubedge try
```

It uploads what Git would commit: tracked files, plus untracked files that are not ignored. It never uploads `.env` files other than examples, `node_modules`, or build output, and if Git cannot list a repository's files, it uploads nothing. On the VM, the env file is made from `.env.example`, as when a project is created; set anything else after you claim the VM.

```sh
pnpm clubedge try --dry-run   # list the files, upload nothing
```

The project must use `infra local`, `neon`, or `none`, and not Supabase Auth. With `neon`, the VM gets `DATABASE_URL` and `DATABASE_URL_DIRECT` from your env file. `pnpm clubedge add infra local` and `pnpm clubedge add auth better-auth` switch it; see [Change a project](./change-a-project.mdx).

## The VM [#the-vm]

- **60 minutes, then claim it to keep it.** The CLI prints a claim link. Opening it within 24 hours moves the VM, its files, and its URL into a Railway account. Keep the link private: whoever opens it takes over the VM.
- **Private until claimed.** Until you claim the VM, only you can open the preview, from the IP address that created it. Another device on mobile data, a VPN, or anyone you send the link to gets Railway's "Access denied" page. Claiming makes the URL shareable: at the end of a run, the CLI asks **Share the preview with others?**, and **Claim the VM** opens the claim page.
- **3 per day.** Railway allows 3 free VMs per network per day.
- **Your machine stays clean.** The CLI asks before creating anything (`--yes` agrees), keeps its own SSH key in its config directory (`~/.config/clubedge`, or `%APPDATA%\clubedge` on Windows; `$XDG_CONFIG_HOME/clubedge` when `XDG_CONFIG_HOME` is set) apart from `~/.ssh`, and connects only to Railway's known host key. If Railway changes its key before a CLI release catches up, the CLI refuses to connect and names the new key; set `CLUBEDGE_RAILWAY_HOST_KEY` to it (several, comma-separated) to trust it. Railway's [terms](https://railway.com/legal/terms) apply.

| Flag | Effect |
| --- | --- |
| `--yes` | Agree without the prompt |
| `--no-open` | Don't open the preview in the browser |
| `--claim` | Open the claim page when the app is ready, without the prompt |
| `--status` | Show the last VM's preview, time left, and claim link; create nothing |
| `--dry-run` | Show what would happen; create nothing |
| `--framework`, module flags, `--ref` | Choose the new project, as for `create` |

At the end, the CLI prints commands for the VM:

- **Status**: `pnpm dlx @clubedge/create-clubedge-app try --status`.
- **Local**: an `ssh -N -L 3000:127.0.0.1:3000` command that forwards the app to [http://localhost:3000](http://localhost:3000), so you can open it from any network before claiming the VM.
- **Shell** and **Logs**: open a shell on the VM, or follow the app's log.
