Logo
Riven

Deploying / Build & Start Commands

Build & Start Commands

Every deploy runs two commands: one to build your app, one to start it. Riven fills these in automatically based on your framework, but you can change them anytime.

The two commands

When Riven deploys your app, it runs two steps in order:

  • Build command — turns your source code into something runnable (compiles, bundles, installs dependencies).
  • Start command — actually runs your app so it can serve requests.

Riven detects sensible defaults for both, so most apps deploy without you touching them. You'd only change these if your project does something non-standard.

Build command

The build command runs first, inside a clean container. It's where your app gets compiled and its dependencies installed. Common examples:

  • npm run build — for Vite, Next.js, and most Node apps.
  • pip install -r requirements.txt — for Python apps.

Riven picks the right install command for you too — npm ci, yarn, or pnpm install — based on the lockfile in your repo.

i

If your build needs environment variables (like a frontend baking in an API URL), those are handled at build time. See Environment Variables for how build-time and runtime variables differ.

Start command

After the build succeeds, the start command runs your app. This is the process that stays alive and serves requests:

  • node server.js — for a Node/Express API.
  • gunicorn app.wsgi — for a Django app.
  • npm run start — for Next.js in server mode.

Your app should listen on the port Riven provides (available as the PORT environment variable). Riven routes traffic to that port.

Static sites

Static sites (like a Vite + React app) work a little differently. They build into plain HTML, CSS, and JS files — there's no server process to keep running. Riven serves those files directly.

So for static sites, the build command is what matters. The start command is used to preview the built output locally during setup, but in production your files are served straight from Riven's CDN.

Defaults by framework

Here's what Riven fills in automatically:

FrameworkBuildStart
Vite + Reactnpm run buildnpm run preview
Next.jsnpm run buildnpm run start
Djangopip install -r requirements.txtgunicorn
Expressnpm installnpm run start

These are starting points — if your app uses different commands, just override them.

Overriding commands

To change either command, go to your service's Settings → Build and edit the Build or Start command. Save, then redeploy for the change to take effect.

Changing a build or start command needs a redeploy to apply. Rivenwill prompt you to redeploy right after you save.


Next steps