Skip to content


Configuring mirrors

As a user you might be interested in configuring DUB registry mirrors for a number of reasons:

  • you want to pick mirrors geographically closer to you for better response time and possibly bandwidth
  • you are running package mirrors publicly in your region or just for your infrastructure
  • you are hosting a private registry

Mirrors are collected from multiple sources:

Built-in mirrors

Persistent dub.settings.json

You can configure registry mirrors on a per-package or system-wide setting.

See the registryUrls setting for more info.

DUB_REGISTRY environment variable

--registry=VALUE CLI argument

Registry priority

Hosting Registries



To build the dub-registry project, then clone it and then run dub build

git clone
cd dub-registry
dub build

Running as standalone registry

Running in mirror mode

Last update: August 5, 2022
Created: August 5, 2022