conan remote add myremote https://new-url.com --force # OR conan remote remove myremote conan remote add myremote https://new-url.com
In the modern C++ ecosystem, managing dependencies efficiently is no longer a luxury—it's a necessity. Conan, the open-source, decentralized package manager, has become the industry standard for handling C and C++ libraries. At the heart of Conan’s flexibility lies its ability to interact with multiple remotes —servers hosting pre-built or source-only packages.
The review of this command is incomplete without acknowledging the significant improvements made in the transition from Conan 1 to Conan 2.
conan remote add local-test http://localhost:8081/artifactory/api/conan/test-repo --no-secure Use code with caution. 3. Prioritizing a Remote (Inserting at Index 0)
conan remote add <NAME> <URL>
Ensure your remotes are exhaustive or use conan lockfiles to pin exact revisions.
Imagine your company hosts an internal Artifactory server. To add it to your Conan client, run: conan remote add company-internal https://mycompany.com Use code with caution. Example 2: Forcing a Remote to Have Top Priority
If you try to add a remote name that already exists, use conan remote update or conan remote add --force .
Always set your internal secure remote to index 0 . This prevents "dependency confusion attacks," ensuring your client fetches proprietary packages from your private server rather than attempting to look for them on public registries. conan add remote
The command conan add remote is deceptively simple, but it is the foundation of every non-trivial Conan workflow. By mastering its flags ( --insert , --force ) and integrating it with careful remote ordering, you can build C++ projects that are both flexible and reproducible.
This creates a new remote entry in your local configuration. By default, the remote is appended to the end of your remote list, meaning it will be queried after any existing remotes.
When configuring Conan remotes within automated CI/CD pipelines (such as GitHub Actions, GitLab CI, or Jenkins), manual logins are impossible. Follow these workflows:
: Conan comes preconfigured with ConanCenter ( https://center2.conan.io ), the official public repository for open-source C/C++ packages. Starting from Conan version 2.9.2, the default remote has been updated to https://center2.conan.io ; the previous https://center.conan.io is now frozen and no longer receives updates. conan remote add myremote https://new-url
For projects constrained to Conan 1.x, running the command registers the registry endpoint similarly: conan remote add corporate-share https://company.local Use code with caution. 3. Disabling SSL Verification (Insecure Testing)
| Command | Purpose | |---------|---------| | conan remote add | Add a new remote | | conan remote remove | Delete a remote | | conan remote update | Change URL of existing remote | | conan remote rename | Change name of existing remote | | conan remote list | Show all remotes with order and SSL settings | | conan remote list-refs | Show which remote contributed which package (debugging) |
: Disables SSL certificate verification. Use this only for local testing or self-signed certificates within a secure VPN. Step-by-Step Examples