This feature is in preview. See the Conan stability section for more information.

The .conanrc file can be placed in the folder where you are running Conan or any parent folder. This file is used to set up the Conan user home directory by defining the conan_home value. This value will take precedence over the CONAN_HOME environment variable in case it’s also defined. Below are some examples of how you can define the Conan user home in the .conanrc file:

Set the Conan home to an absolute folder:

# accepts comments

Set the Conan home to a relative folder inside the current folder:


Set the Conan home to a relative folder outside the current folder:


Set the Conan home to a path containing the ~ symbol, which will be expanded to the system’s user home:


Be aware that the .conanrc file is searched for in all parent folders. For example, in this structure:

|-- project1
|-- project2

If you are running from the folder project1, the parent folders are traversed recursively until a .conanrc file is found, in case it exists.