Configure your private registry in ~/.cargo/config.toml (or .cargo/config.toml in your project) and add the registry name to your Cargo.toml dependencies.
- Add your registry configuration to
~/.cargo/config.tomlwith your registry URL and authentication token.
[registries.my-private-registry]
index = "https://github.com/my-org/my-registry-index.git"
[registry.my-private-registry]
token = "YOUR_AUTH_TOKEN"
- Specify the registry in your
Cargo.tomlfile for the specific crate you want to pull from it.
[dependencies]
my-private-crate = { version = "1.0", registry = "my-private-registry" }
- Run
cargo buildto fetch the crate from your configured private registry.
cargo build