> ## Documentation Index
> Fetch the complete documentation index at: https://docs.servbase.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Build Settings, Package Managers, and Automatic Deploys

> Configure the root directory, package manager (npm, pnpm, yarn, bun), install, build, output and start commands for React, Next.js and Node apps, and deploy automatically on every push.

React, Next.js, Node.js and Express apps share the same build settings, similar to Vercel or Cloudflare Pages. Set them when you create the app, and change them later in the app's **Settings** tab.

## Settings

| Setting | Used for | Default when empty |
| - | - | - |
| Package manager | All | `npm` (also `pnpm`, `yarn`, `bun`) |
| Root directory | Monorepos | Repository root |
| Install command | All | `npm ci` with a lockfile, otherwise `npm install` (or the chosen manager's install) |
| Build command | All | `<manager> run build` for static sites and Next.js; Node apps build only if `package.json` has a `build` script |
| Output directory | React, static Next.js | Auto-detected: `dist`, `build` or `out` |
| Start command | Node, Express, Next.js SSR | `<manager> start` |

Your server must listen on the port in the `PORT` environment variable.

### Static Next.js

For Next.js in CSR or SSG mode, set `output: "export"` in `next.config.js`. Servbase builds the app and serves the `out` folder.

## How builds are isolated

Install and build commands run on the node **as your app's own user, inside a sandbox**:

* only the build folder is writable, and the system is read-only;
* other apps, other users and the server's files are not visible;
* privilege escalation (for example `sudo`) is blocked;
* memory, processes, CPU and build time are limited.

Package registries remain reachable so dependencies can install.

## Automatic deploys (CI/CD)

Every app deployed from GitHub (static HTML, PHP, Python, Node.js, Next.js and React) deploys automatically when someone pushes to the app's branch.

* Automatic deploys are **on by default**. Switch them off in the app's **Settings** tab.
* Change the deployed branch in the same place.
* You get a notification when a push starts a deployment, and the deployment appears in the app's **Deployments** list.

For PHP apps, a redeploy keeps the running app's `.env`, `storage/` (Laravel) and `writable/` (CodeIgniter), so uploads, sessions and logs survive. Static HTML and PHP apps uploaded without GitHub are still updated through the file manager.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.