Why run a private registry?
- Team packages — publish shared utilities, component libraries, or internal tooling that shouldn’t be exposed on the public registry.
- Personal projects — maintain private packages across multiple personal projects without paying for a hosted registry.
- Proxy caching — Verdaccio can act as a transparent proxy for the public registry, caching packages locally for faster installs and offline resilience.
Prerequisites
You need Docker and Docker Compose installed on your server:Setup
Create a project directory
Create a directory for your Verdaccio deployment and set up the subdirectories that will be mounted as volumes:The
conf directory will hold the Verdaccio configuration file. The storage directory will hold published packages. The plugins directory is for any optional plugins.Add the config.yaml file
Create This configuration allows anyone to read packages, requires authentication to publish, and proxies missing packages from the public NPM registry automatically.
./conf/config.yaml with the following minimal configuration:Create the Docker Compose file
Create a Replace
docker-compose.yml file in your project directory:http://npm.demo.com in VERDACCIO_PUBLIC_URL with your actual domain or server IP. Verdaccio will be available on port 10001 of your host.Start the registry
Start Verdaccio in detached mode:Verify it’s running:You should see Verdaccio report that it’s listening on port 4873. Open
http://your-server:10001 in a browser to confirm the web interface is accessible.Configure npm to use your registry
Point your npm client at the private registry. You can do this globally or per-project.Globally — affects all npm commands on your machine:Per-project — add a To revert to the public registry at any time:
.npmrc file at the root of your project:Verifying package resolution
You can confirm that Verdaccio is correctly proxying public packages by installing any public package through your registry. The first request will fetch and cache it from the public NPM registry; subsequent requests will be served from your local cache../storage directory — you should see the cached package appear there.