Skip to content


Work-in-Progress Documentation

The content on this page is not yet fully finished.

Tracking issue:

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

You can set additional registries that are picked up for use from the DUB_REGISTRY environment variable, separated by semicolons.


# note: you don't have to include the default registries like these, only include your own registries.
env DUB_REGISTRY=';' dub build

--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: September 16, 2023
Created: September 1, 2023