Lightweight Enterprise Private npm Registry
One binary, zero debt.
Grape is a lightweight, high-performance private npm registry written in Go, fully compatible with npm/yarn/pnpm/bun clients. Compared to Verdaccio, it offers lower resource usage, stronger permission control, and a modern Web UI.
| Feature | Description |
|---|---|
| 🚀 Single Binary | No Node.js required, download and run |
| 📦 npm Compatible | Full support for npm/yarn/pnpm/bun |
| 🔀 Multi-Upstream Routing | Route by scope to different upstreams |
| 🔐 User Authentication | JWT auth with SQLite persistence |
| 💾 Data Persistence | SQLite storage, survives restarts |
| 🗄️ Smart Caching | Auto-cache public packages |
| 🌐 Modern Web UI | High-impact 'Vineyard' design (Glassmorphism, Inter font) |
| 🌍 Full i18n | Multi-language support (English/Chinese) out of the box |
| 🪶 Lightweight | Memory usage < 10MB, binary size ~20MB |
| 🔔 Webhook Notifications | Package publish/delete events |
| 📊 Prometheus Metrics | Built-in monitoring support |
| 🎫 CI/CD Tokens | Dedicated tokens for automation |
| 💾 Backup & Restore | Web UI and CLI support |
| 🔒 Package-level ACL | Fine-grained access control |
# Linux (x86_64)
curl -sL https://github.com/xiaodou997/grape/releases/latest/download/grape-linux-amd64.tar.gz | tar xz
./grape-linux-amd64
# Linux (ARM64)
curl -sL https://github.com/xiaodou997/grape/releases/latest/download/grape-linux-arm64.tar.gz | tar xz
./grape-linux-arm64
# Access Web UI
open http://localhost:4873# Pull and run
docker pull ghcr.io/xiaodou997/grape:latest
docker run -d --name grape -p 4873:4873 -p 4874:4874 ghcr.io/xiaodou997/grape:latest
# View logs
docker logs -f grapegit clone https://github.com/xiaodou997/grape.git
cd grape
make build
./bin/grape# Set registry globally
npm set registry http://localhost:4874
# Or for specific scope (recommended)
npm set @mycompany:registry http://localhost:4874# Public packages (auto-cached from upstream)
npm install lodash
npm install express
# Scoped packages
npm install @mycompany/utils# Login (default: admin / admin)
npm login --registry http://localhost:4874
# Publish
npm publish --registry http://localhost:4874Grape uses a dual-port architecture:
| Port | Purpose |
|---|---|
| 4873 | Web UI + Admin API |
| 4874 | npm Registry API |
This separation ensures:
- Web UI access on standard port
- Clean npm registry API compatibility
- Independent scaling if needed
# config.yaml
server:
host: "0.0.0.0"
web_port: 4873 # Web UI
api_port: 4874 # npm API
registry:
upstreams:
- name: "npmjs"
url: "https://registry.npmjs.org"
scope: ""
timeout: 30s
enabled: true
auth:
jwt_secret: "your-secret-key-change-in-production"
jwt_expiry: 24h
storage:
type: "local"
path: "./data"
database:
type: "sqlite"
dsn: "./data/grape.db"- 📊 Intelligent Dashboard - Integrated system metrics and recent activities
- 👤 User Management - Modern workspace for team collaboration
- 🎫 Token Management - Secure CI/CD tokens with easy copy-paste
- 💾 Backup & Restore - Aligned visual cards for data protection
- 🗑️ Garbage Collection - Clean up old packages with VS Code style previews
Default credentials: admin / admin
⚠️ Change the default password immediately in production!
| Tag Pattern | Example | Build Artifacts |
|---|---|---|
v* |
v1.0.0 |
Linux binaries + Docker image |
beta-v* |
beta-v1.0.0 |
Linux binaries only (pre-release) |
# Stable release
git tag v1.0.0 && git push origin v1.0.0
# Beta release
git tag beta-v1.0.0 && git push origin beta-v1.0.0| Feature | Description |
|---|---|
| 🚀 Single Binary | Written in Go, no runtime dependencies |
| 🪶 Lightweight | Memory usage < 10MB, minimal footprint |
| 🔀 Multi-Upstream | Route packages by scope to different registries |
| 💾 Data Persistence | SQLite database, survives restarts |
| 🔐 Modern Auth | JWT authentication with database-backed users |
| 🎫 CI/CD Tokens | Dedicated tokens for automated publishing |
| 🌐 Modern Web UI | Vue 3 + Element Plus admin interface |
| 📊 Prometheus Ready | Built-in metrics for monitoring |
| 💾 Backup & Restore | Export/import data via Web UI or CLI |
| 🔒 Package ACL | Fine-grained access control per package |
| 🗑️ Garbage Collection | Clean up old versions automatically |
grape/
├── cmd/grape/ # Application entry
├── internal/
│ ├── auth/ # Authentication (JWT + SQLite)
│ ├── config/ # Configuration (Viper)
│ ├── db/ # Database models (GORM)
│ ├── logger/ # Logging (Zap)
│ ├── metrics/ # Prometheus metrics
│ ├── registry/ # npm registry core
│ ├── server/ # HTTP server (Gin)
│ ├── storage/ # Storage abstraction
│ ├── webhook/ # Webhook notifications
│ └── web/ # Embedded frontend
├── web/ # Frontend source (Vue 3)
├── configs/ # Configuration examples
└── docs/ # Documentation
# Quick start - build and run with hot reload
cd grape
make dev
# Then open http://localhost:4873Development workflow:
make dev- Builds frontend and starts backend with Air- Edit Go code → Air auto-reloads
- Edit Vue/TS code → Re-run
make devto rebuild frontend - Access at
http://localhost:4873
Other commands:
make build # Build production binary
make test # Run tests
make run # Run without building (requires built frontend)📖 See Development Guide for details
- Usage Guide - Package manager configuration
- API Reference - Complete API documentation
- Deployment - Production deployment guide
- Development - Developer guide
- Change JWT secret - Set a strong
auth.jwt_secret - Change default password - Modify admin password immediately
- Use HTTPS - Configure reverse proxy (nginx/caddy)
- Restrict network access - Only allow trusted networks
- Disable self-registration - Set
auth.allow_registration: false
- RBAC permission model
- PostgreSQL support
- Audit logs
- Package scope permissions
- Redis caching
- S3/MinIO storage
- Performance optimization
- LDAP/OIDC integration
- High availability cluster
- Helm Chart
Contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- npm - JavaScript package manager
- Verdaccio - Inspiration source
- Gin - Go web framework
- Vue 3 - Frontend framework
- Element Plus - UI component library
Made with ❤️ by the Grape Team
🍇 Light as air, powerful as a mountain