This is the most common enterprise setup. You maintain an internal Artifactory that acts as a read/write cache in front of Conan Center.
Setup:
# 1. Add your internal remote as primary conan remote add company https://artifactory.internal/ --insert 0
conan add remoteis a small but mighty command that unlocks the full potential of Conan’s decentralized package management. Whether you are pulling open-source libraries from Conan Center, sharing proprietary binaries within your team, or mixing multiple sources with priority rules, mastering this command is essential for any serious C++ developer using Conan.By understanding its syntax, options, and the critical concept of remote priority, you can design robust, efficient dependency workflows—from a single developer’s laptop to a large-scale enterprise CI/CD pipeline. Always remember: remotes give you control over where your binaries come from, and
conan add remoteis the key.Before diving into the command itself, it’s crucial to understand what a remote is. Think of it like a
git remotebut for binary packages. A Conan remote is a repository (typically an Artifactory server, a Conan Server instance, or even a local filesystem path) that stores pre-compiled Conan packages (called "binaries" or "packages"). conan add remoteWhen you run
conan install, Conan will:Remotes enable teams to share private binaries, access public packages from Conan Center, and create hybrid workflows combining multiple sources.
conan remote add conancenter https://center.conan.io
**Now, use the --remote flag in conan create or conan upload to send only your patched library to custom-vendor. All other libraries remain on Conan Center.
To see what remotes are currently active:
conan remote list
Output example:
conancenter: https://center.conan.io [SSL]
my-repo: https://my.repo.com/local [SSL]
The fundamental command structure is straightforward: This is the most common enterprise setup
conan remote add <remote-name> <remote-url>
Example:
conan remote add company https://artifactory.mycorp.com/artifactory/api/conan/conan-local
If successful, Conan returns no message—silence indicates success. To verify, use:
conan remote list
Let's walk through a practical CI/CD scenario where conan add remote is indispensable.
Scenario: You are a platform engineer. Your team just built a shared logging library called super_logger/1.2.0 and uploaded it to a private Artifactory server. Remotes enable teams to share private binaries, access
Developer’s Workflow:
In Conan 1.x, the command is conan remote add. In Conan 2.x, the command remains the same, but the underlying configuration file structure changed (from remotes.json to profiles and settings.yml integration). The command-line usage is identical for the most common operations.