# Zerops

> Deploy Nitro apps to [Zerops](https://zerops.io).

**Preset:** `zerops`

<read-more></read-more>

Zerops supports deploying both static and server-side rendered apps with a simple configuration file in your project root.

## Project setup

Projects and services can be added through the [Zerops dashboard](https://app.zerops.io) by clicking **Import a project**, or imported using `zerops-project-import.yaml`.

<code-group>

```yml [zerops-project-import.yaml (node.js)]
project:
  name: nitro-app

services:
  - hostname: app
    type: nodejs@22
    enableSubdomainAccess: true
```

```yml [zerops-project-import.yaml (static)]
project:
  name: nitro-app

services:
  - hostname: app
    type: static
    enableSubdomainAccess: true
```
</code-group>

Then create a `zerops.yaml` config in your project root:

<code-group>

```yml [zerops.yaml (node.js)]
zerops:
  - setup: app
    build:
      base: nodejs@22
      envVariables:
        NITRO_PRESET: zerops
      buildCommands:
        - pnpm i
        - pnpm run build
      deployFiles:
        - .output
        - package.json
        - node_modules
    run:
      base: nodejs@22
      ports:
        - port: 3000
          httpSupport: true
      start: node .output/server/index.mjs
```

```yml [zerops.yaml (static)]
zerops:
  - setup: app
    build:
      base: nodejs@22
      envVariables:
        NITRO_PRESET: zerops-static
      buildCommands:
        - pnpm i
        - pnpm build
      deployFiles:
        - .zerops/output/static/~
    run:
      base: static
```
</code-group>

Now you can trigger the [build & deploy pipeline using the Zerops CLI](#building-deploying-your-app) or by connecting the app service with your [GitHub](https://docs.zerops.io/references/github-integration/) / [GitLab](https://docs.zerops.io/references/gitlab-integration) repository from inside the service detail.

## Build and deploy

Open [Settings > Access Token Management](https://app.zerops.io/settings/token-management) in the Zerops app and generate a new access token.

Log in using your access token with the following command:

<pm-x></pm-x>

Navigate to the root of your app (where `zerops.yaml` is located) and run the following command to trigger the deploy:

<pm-x></pm-x>

Your code can be deployed automatically on each commit or a new tag by connecting the service with your [GitHub](https://docs.zerops.io/references/github-integration/) / [GitLab](https://docs.zerops.io/references/gitlab-integration) repository. This connection can be set up in the service detail.
