# Nx Remote Cache

Avrea provides a [self-hosted remote cache](https://nx.dev/docs/guides/tasks--caching/self-hosted-caching)
endpoint for [Nx](https://nx.dev) monorepos. Task outputs are cached so that
unchanged projects skip builds, tests, and lint entirely.

Requires Nx 20.8 or newer. The self-hosted remote cache and Nx Cloud are
mutually exclusive. A workspace connected to Nx Cloud uses Cloud instead.

## On Avrea runners

Nx environment variables are pre-configured:

```bash
NX_SELF_HOSTED_REMOTE_CACHE_SERVER="http://cache.avrea.com:8290/nx-build"
NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN="unused"
```

Your workflow needs no changes:

```yaml title="workflow.yml"
jobs:
  build:
    runs-on: avrea-ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 24
      - run: pnpm install --frozen-lockfile
      - run: pnpm nx run-many -t build
```

## Manual setup

Set the environment variables in your workflow:

```yaml
env:
  NX_SELF_HOSTED_REMOTE_CACHE_SERVER: "http://cache.avrea.com:8290/nx-build"
  NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN: "unused"
```

No changes to `nx.json` are required.