You will need to generate a [personal access token](../../../user/profile/personal_access_tokens.md) with the scope set to `api` for repository authentication.
Alternatively, you can set the `CONAN_LOGIN_USERNAME` and `CONAN_PASSWORD` in your local conan config to be used when connecting to the `gitlab` remote. The examples here show the username and password inline.
Next, you'll need to set your Conan remote to point to the GitLab Package Registry.
## Setting the Conan remote to the GitLab Package Registry
After you authenticate to the [GitLab Conan Repository](#authenticating-to-the-gitlab-conan-repository),
Once the remote is set, you can use the remote when running Conan commands:
```sh
conan search Hello* --all --remote=gitlab
```
## Supported CLI commands
The GitLab Conan repository supports the following Conan CLI commands:
-`conan upload`: Upload your recipe and package files to the GitLab Package Registry.
-`conan install`: Install a conan package from the GitLab Package Registry, this includes using the `conan.txt` file.
-`conan search`: Search the GitLab Package Registry for public packages, and private packages you have permission to view.
-`conan info`: View the info on a given package from the GitLab Package Registry.
-`conan remove`: Delete the package from the GitLab Package Registry.
## Uploading a package
First you need to [create your Conan package locally](https://docs.conan.io/en/latest/creating_packages/getting_started.html). In order to work with the GitLab Package Registry, a specific [naming convention](#package-recipe-naming-convention) must be followed.
Ensure you have a project created on GitLab and that the personal access token you are using has the correct permissions for write access to the container registry by selecting the `api` [scope](../../../user/profile/personal_access_tokens.md#limiting-scopes-of-a-personal-access-token).
You can upload your package to the GitLab Package Registry using the `conan upload` command:
| `gitlab-org/gitlab-ce` | `my-package/1.0.0@foo/stable` | No |
NOTE: **Note:**
A future iteration will extend support to [project and group level](https://gitlab.com/gitlab-org/gitlab/issues/11679) remotes which will allow for more flexible naming conventions.
## Installing a package
Add the conan package to the `[requires]` section of your `conan.txt` file and they will be installed when you run `conan install` within your project.
## Removing a package
There are two ways to remove a Conan package from the GitLab Package Registry.