Create verdaccio private npm repository with docker

This article will show you the process of setup private npm repository on RHEL8 server

Install docker if you don’t have

Prepare scripts to run docker container on RHEL 8

# Default command to start a docker container from veredaccio official site (
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio

# If you need run verdaccio with HTTPS, use below commands
docker run -it --rm --name verdaccio \
  --env "VERDACCIO_PROTOCOL=https" -p 4873:4873

Run docker container with your SSL enabled domain

Prepare config yaml file for verdaccio
# config.yaml
  key: /verdaccio/certs/verdaccio-key.pem
  cert: /verdaccio/certs/verdaccio-cert.pem
storage: /verdaccio/storage
Upate docker scripts to run verdaccio
docker rm verdaccio; 
docker run -d \
  -p 4873:4873 \
  --rm --name verdaccio \
  -v $PWD/conf:/verdaccio/conf \
  -v $PWD/storage:/verdaccio/storage \
  -v $PWD/certs:/verdaccio/certs \

Open firewall for verdaccio

# Update firewall configuration
sudo firewall-cmd --permanent --add-port=4873/tcp                               

# Reload firewall
sudo firewall-cmd --reload


Scroll to Top