NPG deployment with Traefik reverse proxy, automatic HTTPS via Let's Encrypt, and compression. Perfect for production deployments with zero SSL configuration.
- NPG proxy server with automatic HTTPS
- Traefik reverse proxy with Let's Encrypt integration
- Automatic compression for optimal npm performance
- Persistent storage for packages, certificates, and malware database
- HTTP to HTTPS redirect for security
- Health checks for container monitoring
Configure your domains:
# Edit .env file with your actual domains
nano .env
# Required settings:
# NPG_DOMAIN=npg.yourdomain.com
# ACME_EMAIL=admin@yourdomain.comStart the services:
docker compose up -dConfigure npm/pnpm:
echo "registry=https://npg.yourdomain.com/npm/" >> ~/.npmrcTest the installation:
npm install lodashConfiguration is managed through the .env file:
| Variable | Description |
|---|---|
NPG_DOMAIN |
Required - Domain for NPG service |
ACME_EMAIL |
Required - Email for Let's Encrypt certificates |
TRAEFIK_DOMAIN |
Optional - Domain for Traefik dashboard |
PROXY_URL |
NPG proxy URL (should match NPG_DOMAIN) |
- Let's Encrypt certificates with TLS challenge
- Automatic certificate renewal
- HTTP to HTTPS redirect
- Automatic gzip compression for all responses
- Essential for npm metadata performance
Access at https://traefik.yourdomain.com/dashboard/ (if TRAEFIK_DOMAIN is set)
Point your domains to the server:
npg.yourdomain.com A YOUR_SERVER_IP
traefik.yourdomain.com A YOUR_SERVER_IP # Optional
- Certificates stored in Docker volume
traefik_letsencrypt - Traefik dashboard protected by default
- NPG only accessible via HTTPS
- No ports exposed except 80/443