---
title: "Deploy React | Vite SPA Starter That Actually Has a Start Command"
description: "React 19 on Vite, served as static files with SPA routing and health check"
category: "Starters"
url: https://railway.com/deploy/react-or-vite-spa-starter-that-actually-
---

# Deploy React | Vite SPA Starter That Actually Has a Start Command

React 19 on Vite, served as static files with SPA routing and health check

**[Deploy React | Vite SPA Starter That Actually Has a Start Command on Railway](https://railway.com/template/react-or-vite-spa-starter-that-actually-)**

- **Creator:** Pavel Volkov's Projects
- **Category:** Starters
- **Total deploys:** 2

## Template content

### Web

- **Source:** https://github.com/ak40u/react-vite-railway-starter
- **Public domain:** Yes

## Documentation

# Deploy and Host a React App on Railway

A React 19 single-page app, built with Vite and served as static files.

## About Hosting React

The Create React App template on Railway still builds with react-scripts 5.0.1 and React 18, from a repository last touched in July 2024. Two things are wrong with it, and the second is the one that actually stops deployments.

**Create React App is retired.** The React team deprecated it in February 2025 and now points people at Vite for this exact kind of app. react-scripts carries a large tree of unmaintained transitive dependencies, and Railway refuses to build when the committed lockfile contains a HIGH advisory.

**There is nothing to run after the build.** That project defines only `dev` and `build` scripts. No `start`. So even a build that somehow succeeds leaves the platform with nothing to launch.

This template builds with Vite and ships a start command that serves the built output.

## Common Use Cases

- A React front end deployed on its own, talking to an API you host separately
- A dashboard or marketing page where a full server framework would be overkill
- A starting point for a client-side app that will grow routing and state

## Dependencies for React Hosting

- Nothing. It is one service with no database and no volume.

### Deployment Dependencies

- Vite: https://vite.dev
- React: https://react.dev
- Source: https://github.com/ak40u/react-vite-railway-starter

### Implementation Details

The repository includes a 60-line `server.js` rather than a static-server dependency. A built React app needs exactly three things - correct content types, a fallback to index.html so client-side routes survive a refresh, and a port it can be told about - and that is short enough to read in one sitting. Keeping it dependency-free also means nothing can quietly pull an advisory into the lockfile and block a future build.

Two details in it worth keeping if you rewrite it:

- Assets under /assets are fingerprinted by Vite, so they are served `immutable`. index.html is served `no-cache` - otherwise a deploy leaves browsers pinned to the previous build, loading asset URLs that no longer exist.
- Request paths are normalised before being joined to the build directory, so `..` cannot escape it.

| Variable | Why |
|---|---|
| PORT | The port the server binds; Railway routes the public domain to it |

Build and deploy settings, including the health check on /healthz, live in railway.json in the repository, so they travel with your code when you fork it.

## Why Deploy React on Railway?

Push, and the build and the static server are both handled. No bucket to configure, no CDN to point at it, and a health check that tells you honestly whether the app came up.

## Similar templates

- [open-excalidraw](https://railway.com/deploy/open-excalidraw) — Self-hostable collaborative drawing built on Excalidraw
- [caring-vibrancy](https://railway.com/deploy/caring-vibrancy) — Deploy and Host caring-vibrancy with Railway
- [Appsmith](https://railway.com/deploy/appsmith-1) — Low-code platform for internal tools, dashboards, and admin panels.

Open this page in a browser: https://railway.com/deploy/react-or-vite-spa-starter-that-actually-
