> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/artifact-registry/new-to-artifact-registry/quickstart/generic-quickstart.md).

# Generic

{% @harness-package-selector/package-selector platforms="%5B%7B%22label%22%3A%22Docker%22%2C%22slug%22%3A%22docker%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fdocker-quickstart%22%7D%2C%7B%22label%22%3A%22Helm%22%2C%22slug%22%3A%22helm%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fhelm-quickstart%22%7D%2C%7B%22label%22%3A%22Helm%20HTTP%22%2C%22slug%22%3A%22helm-http%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fhelm-http-quickstart%22%7D%2C%7B%22label%22%3A%22Generic%22%2C%22slug%22%3A%22generic%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fgeneric-quickstart%22%7D%2C%7B%22label%22%3A%22Raw%20File%22%2C%22slug%22%3A%22raw-file%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fraw-file-quickstart%22%7D%2C%7B%22label%22%3A%22Maven%22%2C%22slug%22%3A%22maven%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fmaven-quickstart%22%7D%2C%7B%22label%22%3A%22Python%22%2C%22slug%22%3A%22python%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fpython-quickstart%22%7D%2C%7B%22label%22%3A%22NPM%22%2C%22slug%22%3A%22npm%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fnpm-quickstart%22%7D%2C%7B%22label%22%3A%22Nuget%22%2C%22slug%22%3A%22nuget%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fnuget-quickstart%22%7D%2C%7B%22label%22%3A%22RPM%22%2C%22slug%22%3A%22rpm%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Frpm-quickstart%22%7D%2C%7B%22label%22%3A%22Debian%22%2C%22slug%22%3A%22debian%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fdebian-quickstart%22%7D%2C%7B%22label%22%3A%22Alpine%22%2C%22slug%22%3A%22alpine%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Falpine-quickstart%22%7D%2C%7B%22label%22%3A%22Wolfi%22%2C%22slug%22%3A%22wolfi%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fwolfi-quickstart%22%7D%2C%7B%22label%22%3A%22Cargo%22%2C%22slug%22%3A%22cargo%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fcargo-quickstart%22%7D%2C%7B%22label%22%3A%22Conan%22%2C%22slug%22%3A%22conan%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fconan-quickstart%22%7D%2C%7B%22label%22%3A%22Go%22%2C%22slug%22%3A%22go%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fgo-quickstart%22%7D%2C%7B%22label%22%3A%22Hugging%20Face%22%2C%22slug%22%3A%22hugging-face%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fhugging-face-quickstart%22%7D%2C%7B%22label%22%3A%22Conda%22%2C%22slug%22%3A%22conda%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fconda-quickstart%22%7D%2C%7B%22label%22%3A%22Dart%22%2C%22slug%22%3A%22dart%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fdart-quickstart%22%7D%2C%7B%22label%22%3A%22PHP%20Composer%22%2C%22slug%22%3A%22php-composer%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fphp-composer-quickstart%22%7D%2C%7B%22label%22%3A%22Swift%22%2C%22slug%22%3A%22swift%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fswift-quickstart%22%7D%2C%7B%22label%22%3A%22Puppet%22%2C%22slug%22%3A%22puppet%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fpuppet-quickstart%22%7D%2C%7B%22label%22%3A%22Terraform%22%2C%22slug%22%3A%22terraform%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fterraform-quickstart%22%7D%2C%7B%22label%22%3A%22R%20(CRAN)%22%2C%22slug%22%3A%22r-cran%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fr-cran-quickstart%22%7D%2C%7B%22label%22%3A%22RubyGems%22%2C%22slug%22%3A%22rubygems%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Frubygems-quickstart%22%7D%5D" selectedPlatform="generic" %}

Use a Generic repository to store raw files of any type. Common file types include archives (`.zip`, `.war`, `.tar`), Windows binaries (`.exe`, `.dll`, `.msi`), PowerShell scripts, JARs, test reports, configuration files, and plain binaries. Generic repositories accept arbitrary files, so you can also store binaries and any other artifact type that does not fit a language-specific registry.

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* Access to a Harness account with appropriate permissions to create registries and connectors.

***

### Create a Generic Artifact Registry <a href="#create-a-generic-artifact-registry" id="create-a-generic-artifact-registry"></a>

{% tabs %}
{% tab title="Interactive Guide" %}
{% embed url="<https://app.tango.us/app/embed/164b9ffd-9e35-4ea0-9a65-fbedb8e097e5?skipCover=false&defaultListView=false&skipBranding=false&makeViewOnly=true&hideAuthorAndDetails=true>" %}
Create a Generic Artifact Registry in Harness
{% endembed %}
{% endtab %}

{% tab title="Step-by-Step" %}

1. Navigate to the Artifact Registry module in your Harness project.
2. Click on **New Artifact Registry**.
3. In the Registry Type dropdown, select **Generic Registry**.
4. Provide a **Registry Name**.
5. Optionally, add a Description and Labels for better organization.
6. Choose visibility between **Public** and **Private**.
7. Click **Create Registry** to finalize.

{% hint style="info" %}
**REGISTRY NAME CRITERIA**

Your registry name must start with a letter and can include `lowercase alphanumerics`, `_`, `.` and `-`.
{% endhint %}
{% endtab %}
{% endtabs %}

***

### Configure an Upstream Proxy (Optional) <a href="#configure-an-upstream-proxy-optional" id="configure-an-upstream-proxy-optional"></a>

An upstream proxy allows your registry to fetch artifacts from external sources if they are not available locally.

{% tabs %}
{% tab title="Interactive Guide" %}

#### Create an upstream proxy

{% embed url="<https://app.tango.us/app/embed/51d6a548-3869-40a5-af42-eea6db6895bb?skipCover=false&defaultListView=false&skipBranding=false&makeViewOnly=false&hideAuthorAndDetails=true>" %}
Create Upstream Proxy in Harness
{% endembed %}

#### Configure the upstream proxy in your registry

{% embed url="<https://app.tango.us/app/embed/5c02ee96-95a4-4523-bb5f-541d08529917?skipCover=true&defaultListView=false&skipBranding=false&makeViewOnly=false&hideAuthorAndDetails=true>" %}
Configure Upstream Proxies in Harness
{% endembed %}
{% endtab %}

{% tab title="Step-by-Step" %}

#### Create an upstream proxy

1. Navigate to the Artifact Registry module in your Harness project.
2. Click on **New Artifact Registry**.
3. In the Registry Type dropdown, select **Generic Registry**.
4. Provide a **Registry Name**.
5. Optionally, add a Description and Labels for better organization.
6. Choose visibility between **Public** and **Private**.
7. Provide the URL of the custom source for your **Remote registry**.
8. Click **Create Registry** to finalize.

{% hint style="info" %}
**REGISTRY NAME CRITERIA**

Your registry name must start with a letter and can include `lowercase alphanumerics`, `_`, `.` and `-`.
{% endhint %}

#### Configure the upstream proxy in your registry

1. Navigate to the Artifact Registry module in your Harness project.
2. Select an existing Artifact Registry.
3. Select the **Configuration** tab.
4. Under **Advanced (Optional)**, select **Configure Upstream**.
5. Select from the list of compatible proxies to add them to your registry.
6. Click **Save** to save the configuration.
   {% endtab %}
   {% endtabs %}

***

### Custom URL and API path mapping <a href="#custom-url-and-api-path-mapping" id="custom-url-and-api-path-mapping"></a>

When you configure a custom upstream URL, the URL you provide serves as the base path. Your custom URL should point to a publicly accessible location with a logical folder structure where artifacts are stored.

**Example:** If you configure your custom URL as:

```
https://www.nuget.org/api/v2/package/
```

When downloading artifact `Newtonsoft.Json` version `10.0.3`, the upstream registry resolves to:

```
https://www.nuget.org/api/v2/package/Newtonsoft.Json/10.0.3
```

Include the complete API path and folder structure in your custom URL. This way, you only need to specify the artifact name and version during download operations.

#### How the Harness API URL maps to the upstream URL <a href="#how-the-harness-api-url-maps-to-the-upstream-url" id="how-the-harness-api-url-maps-to-the-upstream-url"></a>

```
https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/generic/<ARTIFACT_NAME>/<VERSION>/<NESTED_PATH>
```

* **`ARTIFACT_NAME`**: The artifact name you want displayed in Harness Artifact Registry. This is used by Harness for internal tracking and does not get passed to the upstream URL.
* **`VERSION`**: The artifact version you want displayed in Harness Artifact Registry. This is also used by Harness internally and does not get passed to the upstream URL.
* **`NESTED_PATH`**: Everything after `ARTIFACT_NAME/VERSION` is passed directly to your custom base URL for resolution.

**Example:**

Custom URL configured on the upstream proxy:

```
https://www.nuget.org/api/v2/package/
```

To cache `Newtonsoft.Json` version `10.0.3` from this source into HAR with a display name of `my-nuget-pkg` at version `1.0`:

```bash
curl --location 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/generic/my-nuget-pkg/1.0/Newtonsoft.Json/10.0.3' \
--header 'x-api-key: <API_KEY>' -J -O
```

In this request:

* `my-nuget-pkg` = artifact name shown in HAR (used by Harness)
* `1.0` = version shown in HAR (used by Harness)
* `Newtonsoft.Json/10.0.3` = nested path passed to the custom base URL, resolving to `https://www.nuget.org/api/v2/package/Newtonsoft.Json/10.0.3`

***

### Generic Client Setup <a href="#generic-client-setup" id="generic-client-setup"></a>

Follow these instructions to upload, download, and manage Generic artifacts using curl commands.

#### Generate Identity Token <a href="#generate-identity-token" id="generate-identity-token"></a>

An identity token will serve as the password for uploading and downloading artifacts.

1. Navigate to your Harness project.
2. Go to **Artifact Registry** and select your Generic registry.
3. Click on **Setup Client** or **Authentication**.
4. Generate an identity token (API key) that you'll use in the commands below.

#### Upload and Download Artifacts <a href="#upload-and-download-artifacts" id="upload-and-download-artifacts"></a>

**Upload an Artifact**

Use this curl command to push an artifact:

```bash
curl --location --request PUT 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/generic/<ARTIFACT_NAME>/<VERSION>' \
--form 'filename="<FILENAME>"' \
--form 'file=@"<FILE_PATH>"' \
--form 'description="<DESC>"' \
--header 'x-api-key: <API_KEY>'
```

{% hint style="info" %}
**CORRECT URL PATH**

The generic registry endpoint uses `/generic/` in the path. Do not use `/tools/generic/` or `/tools/files/` as those are different endpoints.
{% endhint %}

**Parameters:**

* `<ACCOUNT_ID>`: Your account identifier
* `<REGISTRY_NAME>`: Name of your registry
* `<ARTIFACT_NAME>`: Name of your artifact/package
* `<VERSION>`: Version of the artifact
* `<FILENAME>`: Name for the uploaded file
* `<FILE_PATH>`: Local path to the file you want to upload
* `<DESC>`: Optional description of the artifact
* `<API_KEY>`: Your generated identity token

**Download an Artifact**

Use this curl command to download an artifact:

```bash
curl --location 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/generic/<ARTIFACT_NAME>/<VERSION>?filename=<FILENAME>' \
--header 'x-api-key: <API_KEY>' -J -O
```

**Parameters:**

* `<ACCOUNT_ID>`: Your account identifier
* `<ARTIFACT_NAME>`: Name of your artifact/package
* `<VERSION>`: Version of the artifact
* `<FILENAME>`: Name of the file to download
* `<API_KEY>`: Your generated identity token

***

#### File Operations <a href="#file-operations" id="file-operations"></a>

These operations support both nested and flat file paths, allowing you to organize files within packages using directory structures.

**Upload a File to a Specific Path**

Upload a file to a specific path within the package:

```bash
curl -XPUT 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/generic/<ARTIFACT_NAME>/<VERSION>/<NESTED_FILE_PATH>' \
--header 'x-api-key: <API_KEY>' -T '<FILE_PATH>'
```

**Example with nested path:**

```bash
curl -XPUT 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/generic/<ARTIFACT_NAME>/<VERSION>/<NESTED_FILE_PATH>' \
--header 'x-api-key: <API_KEY>' -T '<FILE_PATH>'
```

**Download a File from a Specific Path**

Download a file from a specific path within the package:

```bash
curl --location 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/generic/<ARTIFACT_NAME>/<VERSION>/<NESTED_FILE_PATH>' \
--header 'x-api-key: <API_KEY>' -J -O
```

**Get File Metadata**

Retrieve file metadata using a HEAD request:

```bash
curl --location --head 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/generic/<ARTIFACT_NAME>/<VERSION>/<NESTED_FILE_PATH>' \
--header 'x-api-key: <API_KEY>'
```

**Delete a File**

Delete a file from a specific path within the package:

```bash
curl --location --request DELETE 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/generic/<ARTIFACT_NAME>/<VERSION>/<NESTED_FILE_PATH>' \
--header 'x-api-key: <API_KEY>'
```

{% hint style="info" %}
**NESTED VS FLAT PATHS**

File operations support both nested paths (e.g., `config/prod/settings.json`) and flat paths (e.g., `settings.json`), giving you flexibility in how you organize your artifacts.
{% endhint %}

***

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>I get a 413 Request Entity Too Large error when uploading to a generic registry</summary>

The maximum file size for a single upload to a generic registry is 5 TiB. This limit cannot be changed from the Harness UI. If you receive a 413 error for a file smaller than 5 TiB, contact Harness Support.

</details>
