Lightweight, self-hosted remote cache server for Nx monorepos. Pure Go, filesystem storage.
7.2K
Lightweight self-hosted remote cache server for Nx monorepos, written in Go.
Implements the official Nx Remote Cache OpenAPI specification (available since Nx 20.8+), allowing you to run your own private, fast, and secure task cache without depending on Nx Cloud.
Perfect for teams wanting full control over caching infrastructure, air-gapped environments, or cost-free remote caching.
docker pull enxtur/nx-caching-server:latest
docker run -d \
--name nx-cache \
-p 8090:8090 \
-v $(pwd)/nx-cache-data:/data \
-e STORAGE_DIR=/data \
-e AUTH_TOKEN=your-secure-token-123 \
-e CLEANUP_THRESHOLD=24h \
enxtur/nx-caching-server:latest
# No auth
export NX_SELF_HOSTED_REMOTE_CACHE_SERVER=http://your-server:8090
# With auth
export NX_SELF_HOSTED_REMOTE_CACHE_SERVER=http://your-server:8090
export NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN=your-secure-token-123
Run your builds — Nx will hit/read/write to your server automatically:
npx nx run-many --target=build --all
| Variable | Description | Default | Example |
|---|---|---|---|
STORAGE_DIR | Path where cache files are stored | /tmp | /data |
CLEANUP_THRESHOLD | Remove entries older than this duration (hours only) | 1h | 24h, 168h (1 week) |
PORT | Listening port | 8090 | 8080 |
AUTH_TOKEN | If set, requires Authorization: Bearer <token> | (disabled) | super-secret-xyz |
services:
nx-cache:
image: enxtur/nx-caching-server:latest
restart: unless-stopped
ports:
- "8090:8090"
volumes:
- ./nx-cache-data:/data
environment:
- STORAGE_DIR=/data
- AUTH_TOKEN=your-secure-token-123
- CLEANUP_THRESHOLD=48h
GitHub repo (source + Dockerfile): https://github.com/enxtur/nx-caching-server
(Feel free to star, fork, or contribute!)
Pulls: Growing steadily — thank you for using it!
Feedback, issues, and PRs are very welcome.
Happy caching! 🚀
Content type
Image
Digest
sha256:0e2bbdcf6…
Size
8.6 MB
Last updated
3 days ago
docker pull enxtur/nx-caching-server