Connect Conan to Artifactory

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide

You can connect the Conan client to Artifactory to install and upload packages from Artifactory repositories. When you connect to a Conan repository through Artifactory, the repository URL must contain the /api/conan prefix in the path before the repository name.

Artifactory recommends using Conan V2. Conan V1 is supported as a legacy tool. For more information, see Use Conan V1 (Legacy).

"Remote" Terminology

The conan remote command connects the Conan client to a local or virtual Artifactory repository. In other words, your local or virtual Artifactory repository is your Conan remote.

In Artifactory, a remote repository is a caching proxy for a repository at a remote URL.

Prerequisite: Before connecting your Conan client to Artifactory, you must have an existing Conan repository in Artifactory. For more information, see Create a Conan Repository.

Logged in vs. Anonymous User: You can work with Conan and Artifactory as a logged-in user or anonymously. To work with Artifactory using Anonymous Access, configure that access under Admin | Security | General. For details, refer to Allow Anonymous Access.

To connect the Conan client to Artifactory:

  1. Run the following command to add the Artifactory repository to your Conan configuration:

    conan remote add <REMOTE_NAME> https://[JFrogPlatformURL]/artifactory/api/conan/<REPO_NAME>

    Where:

    • <REMOTE_NAME>: The local alias you want to set for the Artifactory repository

    • [JFrogPlatformURL]: The URL of your JPD

    • <REPO_NAME>: The name of the target repository in Artifactory

    For example:

    conan remote add artifactory https://company.jfrog.io/artifactory/api/conan/conan-virtual

    Tip

    Note that if you run this command copied directly from JFrog Set Me Up, the remote name will match the repository name. If you want to set a different remote name, change the value before running the command.

  2. To authenticate to Artifactory, run the following command:

    conan remote login -p <TOKEN> <REMOTE_NAME> <USERNAME>

    Where:

    • <TOKEN>: Your Artifactory identity token

    • <REMOTE_NAME>: The local alias of the Artifactory repository

    • <USERNAME>: Your Artifactory username

    For example:

    conan remote login -p gH5fLdFhJkLpA2sD4fG6hJ8kM1nB3cV5xZ7aW9qE2sR4t artifactory jeffryfrog

Note

You can also use JFrog Set me up to copy the snippet populated with your token and environment. For more information, see Use Artifactory Set Me Up for Configuring Package Manager Clients.

Next steps: