Skip to content

docs(start): Add Railway instructions #4910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/start/framework/react/hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ When a TanStack Start application is being deployed, the `target` value in the T
- [`netlify`](#netlify): Deploy to Netlify
- [`vercel`](#vercel): Deploy to Vercel
- [`cloudflare-pages`](#cloudflare-pages): Deploy to Cloudflare Pages
- [`railway`](#railway): Deploy to Railway
- [`node-server`](#nodejs): Deploy to a Node.js server
- [`bun`](#bun): Deploy to a Bun server
- ... and more to come!
Expand Down Expand Up @@ -108,6 +109,41 @@ directory = "./.output/public"

Deploy your application to Cloudflare Workers using their one-click deployment process, and you're ready to go!

### Railway

Railway automatically detects Build and Start commands when building and deploying to a service.

Set the `target` value to `node-server` in your `vite.config.ts` file.

```ts
// vite.config.ts
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import { defineConfig } from 'vite'

export default defineConfig({
plugins: [tanstackStart({ target: 'node-server' })],
})
```

Ensure `build` and `start` npm scripts are present in your `package.json` file:

```json
"build": "vite build",
"start": "node .output/server/index.mjs"
```

Then you can run the following command to build your application:

```sh
npm run build
```

You can start your application by running:

```sh
npm run start
```

### Node.js

Set the `target` value to `node-server` in your `vite.config.ts` file.
Expand Down