---
title: "Conan (C++)"
order: 21
---

[Conan](https://conan.io) is a binary management system for C++ that allows retrieval of precompiled binaries usable by different compilers and platforms, as well as the ability to build from sources when a precompiled binary is not available.

While Conan does not have self-describing package files like most packaging systems, its recipes are roughly analogous to packages in ProGet.

A Conan feed in ProGet acts like a private Conan repository where you can store your own recipes (and their packages). You can also create connectors to [Conan Center](https://center.conan.io) and other Conan V2 repositories that let you use third-party recipes through your Conan feed and create a curated list of approved recipes.

Conan feeds are available in ProGet 2024.22+.

## Prerequisites: Build Profile

Before installing packages you will need to configure a build profile. You can create a default profile with the [`conan profile detect`](https://docs.conan.io/2/reference/commands/profile.html) command or specify your own profile with `--profile:build=«myprofile»`

## Adding a Conan feed as a Remote

Before installing or publishing a recipe to your ProGet Conan feed, you will need to add your feed as a remote:

```bash
conan remote add «remote-name» https://«proget-server»/conan/«feed-name»/
```

If you are using a self-signed certificate with ProGet, you will also need to add the `--insecure` argument:

```bash
conan remote add «remote-name» https://«proget-server»/conan/«feed-name»/ --insecure
```

### Proxy All Conan Requests Through ProGet

When you add another remote to Conan, it will still use [Conan Center](https://center.conan.io) unless you explicitly disable it. This would allow developers to still install packages directly from Conan Center. To make sure all requests are made to your ProGet feed instead, disable Conan Center:

```bash
conan remote disable conancenter
```

### Authenticated Feeds { #authenticate-to-feed }

If your require authentication, Conan will prompt for login credentials, or you can explicitly log in using the [`conan remote auth`](https://docs.conan.io/2/reference/commands/remote.html) command.

When prompted for a user name and password, it's possible to use your ProGet username and password for authentication. However we highly recommend [Creating a ProGet API Key](/docs/proget/reference-api/proget-apikeys) for authentication purposes, using `api` as the username and the API key as the password. 

## Creating and Publishing Packages

Unlike many other packaging system, Conan does not have self-contained archive files. Instead, you use Conan to create a package in your local cache, and then you publish that recipe to an external repository like ProGet.

Creating and publishing Conan packages to ProGet is covered in [HOWTO: Create and Publish Conan Packages to a Private Repository in ProGet](docs/conan/howto-conan-publish.md). You can also follow the [Creating Packages tutorial](https://docs.conan.io/2/tutorial/creating_packages.html) in the official documentation for more detail.

### Publishing Packages to ProGet

Once you have created a package in your local cache, you can publish it to ProGet using the [`conan upload`](https://docs.conan.io/1/reference/commands/creator/upload.html) command:

```bash
conan upload -r «remote-name» «package-name»
```

Due to the complexity of the Conan package model, you cannot use any other tools to upload packages, only the Conan CLI.

## Installing Packages from a ProGet Feed

To install packages from a Conan feed created in ProGet, use the [`install`](https://docs.conan.io/1/reference/commands/consumer/install.html) command:

```bash
$ conan install --requires=«package-name»/«version» -r=«remote-name»
```

### Installing with Conan 1.x

Installing packages with Conan version 1.x requires slightly different syntax when installing packages:

```bash
$ conan install «package-name»/«version»@
```

## Technical Limitations

 - ProGet only implements the Conan V2 API. Conan V1 has been deprecated for some time and is no longer supported by the Conan CLI.
 - The Conan API does not have the capability to list metadata remotely, so ProGet does not show connector results while browsing Conan feeds in the ProGet UI. However, connectors fully support proxying or caching, so if you have your feed configured to cache connector packages, they will be added to your feed as they are used.
 - Since Conan doesn't exactly have package files, the drop path import function only works with files stored in a very specific directory structure that mimics how ProGet stores Conan files - this allows you to import from another ProGet feed or instance if necessary.
