# Self-host

`veryfront build` and `veryfront serve` run your app on your own machine or server with Node.js 22.3 or later.

## Before you start

You need a project on your machine. See [Work locally](/docs/projects/local.md).

## Build and serve

**Code**

1. In your project's folder, build it. The output goes to `dist`, or the folder `-o` names:

```bash
npx veryfront build
```

2. Start the production server. It listens on port 3000 and every interface by default:

```bash
npx veryfront serve --port 8787
```

3. Request the home page. You should now see the answer `200`:

```bash
curl -o /dev/null -w "%{http_code}\n" http://localhost:8787/
```

### Try it in a sandbox

```playground
step: The project on your machine | npm create -y veryfront@latest support-desk -- --template minimal --yes && cd support-desk
step: Build it | npx veryfront build
step: Start the production server | nohup npx veryfront serve --port 8787 > serve.log 2>&1 &
step: Wait until it answers | until curl -s -o /dev/null http://localhost:8787/; do sleep 2; done; tail -5 serve.log
check: curl -o /dev/null -w "%{http_code}\n" http://localhost:8787/
expect: 200
```

## Next steps

* [Deploy from CLI](/docs/deployment/cli.md)
* [Connect a worker](/docs/runtime/runtimes.md)
