Encryption with Google-owned and Google-managed encryption keys or
customer-managed encryption keys. Artifact Registry uses
Google-owned and Google-managed encryption keys by default.
Artifact Registry enforces organization policy constraints
that require CMEK to encrypt resources or limit which Cloud KMS
keys can be used for CMEK protection.
Create a repository using the Google Cloud console
Open the Repositories page in the Google Cloud console.
Specify the repository name. For each repository location in a project,
repository names must be unique.
Select the repository format.
If multiple repository modes are available, select Standard.
Maven only: Configure the version policy.
Choose a version policy:
None - No version policy. Store both release and snapshot packages.
Release - Store only release packages.
Snapshot - Store only snapshot packages.
If you want a snapshot repository to accept non-unique snapshots
that overwrite existing versions in the repository, select
Allow snapshot overwrites.
Under Location Type, choose the location for the repository:
Choose the location type: Region or Multi-Region. The list of
locations changes to reflect your selection.
In the Region or Multi-region list, select a location.
For information about location types and supported locations, see
Repository locations
Add a description for the repository. Descriptions help to
identify the purpose of the repository and the kind of artifacts
it contains.
Don't include sensitive data, since repository descriptions are
not encrypted.
If you want to use labels to organize your
repositories, click Add Label and enter the key-value pair for the
label. You can add, edit, or remove labels after you create the
repository.
In the Encryption section, choose the encryption mechanism for
the repository.
Google-managed encryption key - Encrypt repository content with a
Google-owned and Google-managed encryption key.
Customer-managed key - Encrypt repository content with a
key that you control through Cloud Key Management Service.
For key setup instructions, see
Setting up CMEK for repositories.
For Docker repositories, the Immutable image tags setting configures
your repository to use image tags that always point to the same image
digest. A user with the Artifact Registry administrator role can change this
setting after the repository is created.
By default this setting is disabled. Image tags are mutable, meaning that
the image digest that the tag points to can change.
If this setting is enabled, image tags are immutable. A tag must always
point to the same image digest.
To learn more about mutable and immutable image tags, see
Container image versions.
If you want to use cleanup policies to delete unused artifacts, in the
Cleanup policies section:
Select Dry run to test your policy before applying it.
Click Add policy to add a keep or delete policy to your repository.
Give your cleanup policy a descriptive name in the Name field.
In the Policy type section, select one of:
Conditional delete: deletes artifacts based on conditions you
define.
Conditional keep: keeps artifacts based on conditions you define.
Keep most recent versions: Keeps a set number of most recent
versions per package.
In the Artifact Analysis section, choose vulnerability scanning settings:
Enabled - Allow scanning in this repository. The Container Scanning
API must be enabled on your project.
When you enable the Container Scanning API, billing begins
immediately. After you enable the Container Scanning API on a project,
vulnerability scanning is enabled for all new and existing repositories.
When you push an image to Artifact Registry it's automatically scanned by
Artifact Analysis.
Disabled - Prevent scanning in this repository. If the Container
Scanning API is enabled on your project, scanning continues on other
repositories; this repository will be excluded.
REPOSITORY: the name of the repository. For each
repository location in a project, repository names must be unique.
LOCATION: the regional or multi-regional
location for the repository. You can omit this
flag if you set a default. To view a list
of supported locations, run the command:
gcloudartifactslocationslist
DESCRIPTION: a description of the repository.
Don't include sensitive data, since repository descriptions are not encrypted.
KMS-KEY: the full path to the Cloud KMS
encryption key, if you are using a
customer-managed encryption key to encrypt repository
contents. The path is in the format:
REPOSITORY: the name of the repository. For each
repository location in a project, repository names must be unique.
LOCATION: the regional
location for the repository. You can
omit this flag if you set a default location. To view a list
of supported locations, run the command:
gcloudartifactslocationslist
DESCRIPTION: a description of the repository. Don't
include sensitive data, since repository descriptions are not encrypted.
KMS-KEY: the full path to the Cloud KMS encryption
key, if you are using a customer-managed encryption key to
encrypt repository contents. The path is in the format:
KMS-PROJECT: the project where your key is stored.
KMS-LOCATION: the location of the key.
KEY-RING: the name of the key ring.
KEY: the name of the key.
--immutable-tags is an optional flag that configures your repository to
use tags that always point to the same image digest.
By default, when the --immutable-tags flag isn't passed, a tag can be
moved to another image digest. To learn more about
immutable and mutable image tags, see
Container image versions.
--async returns immediately, without waiting for the operation in
progress to complete.
--disable-vulnerability-scanning: is an optional flag that configures your
repository to disable automatic vulnerability scanning.
--allow-vulnerability-scanning: is an optional flag that configures your
repository to permit automatic vulnerability scanning. For more information,
see Enable or disable automatic scanning.
REPOSITORY: the name of the repository. For each
repository location in a project, repository names must be unique.
LOCATION: the regional or multi-regional
location for the repository. You can omit this
flag if you set a default. To view a list
of supported locations, run the command:
gcloudartifactslocationslist
DESCRIPTION: a description of the repository.
Don't include sensitive data, since repository descriptions are not encrypted.
KMS-KEY: the full path to the Cloud KMS
encryption key, if you are using a
customer-managed encryption key to encrypt repository
contents. The path is in the format:
REPOSITORY: the name of the repository. For each
repository location in a project, repository names must be unique.
LOCATION: the regional or multi-regional
location for the repository. You can omit this
flag if you set a default. To view a list
of supported locations, run the command:
gcloudartifactslocationslist
DESCRIPTION: a description of the repository.
Don't include sensitive data, since repository descriptions are not encrypted.
KMS-KEY: the full path to the Cloud KMS
encryption key, if you are using a
customer-managed encryption key to encrypt repository
contents. The path is in the format:
REPOSITORY: the name of the repository. For each
repository location in a project, repository names must be unique.
LOCATION: the regional or multi-regional
location for the repository. You can omit this
flag if you set a default. To view a list
of supported locations, run the command:
gcloudartifactslocationslist
DESCRIPTION: a description of the repository.
Don't include sensitive data, since repository descriptions are not encrypted.
KMS-KEY: the full path to the Cloud KMS
encryption key, if you are using a
customer-managed encryption key to encrypt repository
contents. The path is in the format:
KMS-PROJECT: the project where your key is stored.
KMS-LOCATION: the location of the key.
KEY-RING: the name of the key ring.
KEY: the name of the key.
--async: returns immediately, without waiting for the operation in
progress to complete.
Maven
By default, Maven repositories store both
snapshot and release versions of packages. You can specify a
version policy to create a snapshot or release repository.
To create a repository that stores snapshots and releases, run the
command:
REPOSITORY: the name of the repository. For each
repository location in a project, repository names must be unique.
LOCATION: the regional or multi-regional
location for the repository. You can omit this
flag if you set a default. To view a list
of supported locations, run the command:
gcloudartifactslocationslist
DESCRIPTION: a description of the repository.
Don't include sensitive data, since repository descriptions are not encrypted.
KMS-KEY: the full path to the Cloud KMS
encryption key, if you are using a
customer-managed encryption key to encrypt repository
contents. The path is in the format:
The following flags are specific to Maven repositories:
--version-policy=VERSION-POLICY
Specifies the types of packages to store in the repository. You can set
VERSION-POLICY to:
None - No version policy. Store both release and snapshot packages.
If you do not include the --version-policy flag in your command,
this is the default setting.
Release - Store only release packages.
Snapshot - Store only snapshot packages.
--allow-snapshot-overwrites
For snapshot repositories only. If you specify this flag, you can
publish non-unique snapshots that overwrite existing versions in the
repository.
Note: Maven 3 only supports unique snapshots. If you are using
snapshot repositories, we recommend using unique snapshots only.
REPOSITORY: the name of the repository. For each
repository location in a project, repository names must be unique.
LOCATION: the regional or multi-regional
location for the repository. You can omit this
flag if you set a default. To view a list
of supported locations, run the command:
gcloudartifactslocationslist
DESCRIPTION: a description of the repository.
Don't include sensitive data, since repository descriptions are not encrypted.
KMS-KEY: the full path to the Cloud KMS
encryption key, if you are using a
customer-managed encryption key to encrypt repository
contents. The path is in the format:
REPOSITORY: the name of the repository. For each
repository location in a project, repository names must be unique.
LOCATION: the regional or multi-regional
location for the repository. You can omit this
flag if you set a default. To view a list
of supported locations, run the command:
gcloudartifactslocationslist
DESCRIPTION: a description of the repository.
Don't include sensitive data, since repository descriptions are not encrypted.
KMS-KEY: the full path to the Cloud KMS
encryption key, if you are using a
customer-managed encryption key to encrypt repository
contents. The path is in the format:
REPOSITORY: the name of the repository. For each
repository location in a project, repository names must be unique.
LOCATION: the regional or multi-regional
location for the repository. You can omit this
flag if you set a default. To view a list
of supported locations, run the command:
gcloudartifactslocationslist
DESCRIPTION: a description of the repository.
Don't include sensitive data, since repository descriptions are not encrypted.
KMS-KEY: the full path to the Cloud KMS
encryption key, if you are using a
customer-managed encryption key to encrypt repository
contents. The path is in the format:
REPOSITORY: the name of the repository. For each
repository location in a project, repository names must be unique.
LOCATION: the regional or multi-regional
location for the repository. You can omit this
flag if you set a default. To view a list
of supported locations, run the command:
gcloudartifactslocationslist
DESCRIPTION: a description of the repository.
Don't include sensitive data, since repository descriptions are not encrypted.
KMS-KEY: the full path to the Cloud KMS
encryption key, if you are using a
customer-managed encryption key to encrypt repository
contents. The path is in the format:
DESCRIPTION is the optional description for the repository.
Do not include sensitive data, since repository descriptions are
not encrypted.
KEYis the name of the Cloud Key Management Service key, if you are using
customer-managed encryption keys (CMEK) for encryption. Omit
this argument to use the default setting, Google-owned and Google-managed encryption keys
DRY_RUN_STATUS determines if cleanup policies delete
artifacts, or only log which artifacts would be deleted if setting
cleanup policies on the repository. Omit if you don't want to add
cleanup policies to the repository.
true: sets the policies to run in dry run mode. No artifacts are
deleted in dry run mode.
false: applies the cleanup policies. Artifacts are deleted or
kept depending on the policies.
PKG_PREFIX, PKG_PREFIX_N are package prefixes
to apply the policy to.
TIME_SINCE_UPLOAD is the time since an artifact version
was uploaded to the repository, specified as a duration. You can specify
durations of seconds, minutes, hours, or days by appending s, m, h,
or d respectively.
KEEP_COUNT is the number of versions of an artifact to
keep in your repository.
DESCRIPTION is the optional description for the repository.
Do not include sensitive data, since repository descriptions are
not encrypted.
KEYis the name of the Cloud Key Management Service key, if you are using
customer-managed encryption keys (CMEK) for encryption. Omit
this argument to use the default setting, Google-owned and Google-managed encryption keys
DRY_RUN_STATUS determines if cleanup policies delete
artifacts, or only log which artifacts would be deleted if setting
cleanup policies on the repository. Omit if you don't want to add
cleanup policies to the repository.
true: sets the policies to run in dry run mode. No artifacts are
deleted in dry run mode.
false: applies the cleanup policies. Artifacts are deleted or
kept depending on the policies.
TAG_STATE is the tag state to apply the policy to. Values
are tagged, untagged, and any. any applies to both tagged and
untagged artifacts. If a repository has immutable tags enabled, tagged
artifacts can't be deleted.
TAG_PREFIX, TAG_PREFIX_N are tag prefixes to
apply the policy to.
PKG_PREFIX, PKG_PREFIX_N are package prefixes
to apply the policy to.
TIME_SINCE_UPLOAD is the time since an artifact version
was uploaded to the repository, specified as a duration. You can specify
durations of seconds, minutes, hours, or days by appending s, m, h,
or d respectively.
KEEP_COUNT is the number of versions of an artifact to
keep in your repository.
DESCRIPTION is the optional description for the repository.
Do not include sensitive data, since repository descriptions are
not encrypted.
KEYis the name of the Cloud Key Management Service key, if you are using
customer-managed encryption keys (CMEK) for encryption. Omit
this argument to use the default setting, Google-owned and Google-managed encryption keys
DRY_RUN_STATUS determines if cleanup policies delete
artifacts, or only log which artifacts would be deleted if setting
cleanup policies on the repository. Omit if you don't want to add
cleanup policies to the repository.
true: sets the policies to run in dry run mode. No artifacts are
deleted in dry run mode.
false: applies the cleanup policies. Artifacts are deleted or
kept depending on the policies.
TAG_STATE is the tag state to apply the policy to. Values
are tagged, untagged, and any. any applies to both tagged and
untagged artifacts. If a repository has immutable tags enabled, tagged
artifacts can't be deleted.
TAG_PREFIX, TAG_PREFIX_N are tag prefixes to
apply the policy to.
PKG_PREFIX, PKG_PREFIX_N are package prefixes
to apply the policy to.
TIME_SINCE_UPLOAD is the time since an artifact version
was uploaded to the repository, specified as a duration. You can specify
durations of seconds, minutes, hours, or days by appending s, m, h,
or d respectively.
KEEP_COUNT is the number of versions of an artifact to
keep in your repository.
DESCRIPTION is the optional description for the repository.
Do not include sensitive data, since repository descriptions are
not encrypted.
KEYis the name of the Cloud Key Management Service key, if you are using
customer-managed encryption keys (CMEK) for encryption. Omit
this argument to use the default setting, Google-owned and Google-managed encryption keys
DRY_RUN_STATUS determines if cleanup policies delete
artifacts, or only log which artifacts would be deleted if setting
cleanup policies on the repository. Omit if you don't want to add
cleanup policies to the repository.
true: sets the policies to run in dry run mode. No artifacts are
deleted in dry run mode.
false: applies the cleanup policies. Artifacts are deleted or
kept depending on the policies.
TAG_STATE is the tag state to apply the policy to. Values
are tagged, untagged, and any. any applies to both tagged and
untagged artifacts. If a repository has immutable tags enabled, tagged
artifacts can't be deleted.
TAG_PREFIX, TAG_PREFIX_N are tag prefixes to
apply the policy to.
PKG_PREFIX, PKG_PREFIX_N are package prefixes
to apply the policy to.
TIME_SINCE_UPLOAD is the time since an artifact version
was uploaded to the repository, specified as a duration. You can specify
durations of seconds, minutes, hours, or days by appending s, m, h,
or d respectively.
KEEP_COUNT is the number of versions of an artifact to
keep in your repository.
DESCRIPTION is the optional description for the repository.
Do not include sensitive data, since repository descriptions are
not encrypted.
KEYis the name of the Cloud Key Management Service key, if you are using
customer-managed encryption keys (CMEK) for encryption. Omit
this argument to use the default setting, Google-owned and Google-managed encryption keys
DRY_RUN_STATUS determines if cleanup policies delete
artifacts, or only log which artifacts would be deleted if setting
cleanup policies on the repository. Omit if you don't want to add
cleanup policies to the repository.
true: sets the policies to run in dry run mode. No artifacts are
deleted in dry run mode.
false: applies the cleanup policies. Artifacts are deleted or
kept depending on the policies.
TAG_STATE is the tag state to apply the policy to. Values
are tagged, untagged, and any. any applies to both tagged and
untagged artifacts. If a repository has immutable tags enabled, tagged
artifacts can't be deleted.
TAG_PREFIX, TAG_PREFIX_N are tag prefixes to
apply the policy to.
PKG_PREFIX, PKG_PREFIX_N are package prefixes
to apply the policy to.
TIME_SINCE_UPLOAD is the time since an artifact version
was uploaded to the repository, specified as a duration. You can specify
durations of seconds, minutes, hours, or days by appending s, m, h,
or d respectively.
KEEP_COUNT is the number of versions of an artifact to
keep in your repository.
Maven
If you do not specify a version policy, Artifact Registry
creates a Maven repository that stores both
snapshot and release versions of packages by default.
DESCRIPTION is the optional description for the repository.
Do not include sensitive data, since repository descriptions are
not encrypted.
KEYis the name of the Cloud Key Management Service key, if you are using
customer-managed encryption keys (CMEK) for encryption. Omit
this argument to use the default setting, Google-owned and Google-managed encryption keys
DRY_RUN_STATUS determines if cleanup policies delete
artifacts, or only log which artifacts would be deleted if setting
cleanup policies on the repository. Omit if you don't want to add
cleanup policies to the repository.
true: sets the policies to run in dry run mode. No artifacts are
deleted in dry run mode.
false: applies the cleanup policies. Artifacts are deleted or
kept depending on the policies.
TAG_STATE is the tag state to apply the policy to. Values
are tagged, untagged, and any. any applies to both tagged and
untagged artifacts. If a repository has immutable tags enabled, tagged
artifacts can't be deleted.
TAG_PREFIX, TAG_PREFIX_N are tag prefixes to
apply the policy to.
PKG_PREFIX, PKG_PREFIX_N are package prefixes
to apply the policy to.
TIME_SINCE_UPLOAD is the time since an artifact version
was uploaded to the repository, specified as a duration. You can specify
durations of seconds, minutes, hours, or days by appending s, m, h,
or d respectively.
KEEP_COUNT is the number of versions of an artifact to
keep in your repository.
To store snapshot and release versions in different
repositories, specify a version policy for the
repository using a maven_config block. This block supports the
following settings:
version_policy sets the version policy with one of the following values:
VERSION_POLICY_UNSPECIFIED: Store snapshot and release packages. This
is the default setting.
RELEASE: Store release packages only.
SNAPSHOT: Store snapshot packages only.
allow_snapshot_overwrites configures a repository with a SNAPSHOT
version policy to accept non-unique snapshots that overwrite existing
versions in the repository.
The following example defines a Maven repository with a release version
policy.
DESCRIPTION is the optional description for the repository.
Do not include sensitive data, since repository descriptions are
not encrypted.
KEYis the name of the Cloud Key Management Service key, if you are using
customer-managed encryption keys (CMEK) for encryption. Omit
this argument to use the default setting, Google-owned and Google-managed encryption keys
DRY_RUN_STATUS determines if cleanup policies delete
artifacts, or only log which artifacts would be deleted if setting
cleanup policies on the repository. Omit if you don't want to add
cleanup policies to the repository.
true: sets the policies to run in dry run mode. No artifacts are
deleted in dry run mode.
false: applies the cleanup policies. Artifacts are deleted or
kept depending on the policies.
TAG_STATE is the tag state to apply the policy to. Values
are tagged, untagged, and any. any applies to both tagged and
untagged artifacts. If a repository has immutable tags enabled, tagged
artifacts can't be deleted.
TAG_PREFIX, TAG_PREFIX_N are tag prefixes to
apply the policy to.
PKG_PREFIX, PKG_PREFIX_N are package prefixes
to apply the policy to.
TIME_SINCE_UPLOAD is the time since an artifact version
was uploaded to the repository, specified as a duration. You can specify
durations of seconds, minutes, hours, or days by appending s, m, h,
or d respectively.
KEEP_COUNT is the number of versions of an artifact to
keep in your repository.
DESCRIPTION is the optional description for the repository.
Do not include sensitive data, since repository descriptions are
not encrypted.
KEYis the name of the Cloud Key Management Service key, if you are using
customer-managed encryption keys (CMEK) for encryption. Omit
this argument to use the default setting, Google-owned and Google-managed encryption keys
DRY_RUN_STATUS determines if cleanup policies delete
artifacts, or only log which artifacts would be deleted if setting
cleanup policies on the repository. Omit if you don't want to add
cleanup policies to the repository.
true: sets the policies to run in dry run mode. No artifacts are
deleted in dry run mode.
false: applies the cleanup policies. Artifacts are deleted or
kept depending on the policies.
TAG_STATE is the tag state to apply the policy to. Values
are tagged, untagged, and any. any applies to both tagged and
untagged artifacts. If a repository has immutable tags enabled, tagged
artifacts can't be deleted.
TAG_PREFIX, TAG_PREFIX_N are tag prefixes to
apply the policy to.
PKG_PREFIX, PKG_PREFIX_N are package prefixes
to apply the policy to.
TIME_SINCE_UPLOAD is the time since an artifact version
was uploaded to the repository, specified as a duration. You can specify
durations of seconds, minutes, hours, or days by appending s, m, h,
or d respectively.
KEEP_COUNT is the number of versions of an artifact to
keep in your repository.
DESCRIPTION is the optional description for the repository.
Do not include sensitive data, since repository descriptions are
not encrypted.
KEYis the name of the Cloud Key Management Service key, if you are using
customer-managed encryption keys (CMEK) for encryption. Omit
this argument to use the default setting, Google-owned and Google-managed encryption keys
DRY_RUN_STATUS determines if cleanup policies delete
artifacts, or only log which artifacts would be deleted if setting
cleanup policies on the repository. Omit if you don't want to add
cleanup policies to the repository.
true: sets the policies to run in dry run mode. No artifacts are
deleted in dry run mode.
false: applies the cleanup policies. Artifacts are deleted or
kept depending on the policies.
PKG_PREFIX, PKG_PREFIX_N are package prefixes
to apply the policy to.
TIME_SINCE_UPLOAD is the time since an artifact version
was uploaded to the repository, specified as a duration. You can specify
durations of seconds, minutes, hours, or days by appending s, m, h,
or d respectively.
KEEP_COUNT is the number of versions of an artifact to
keep in your repository.
Artifact Registry creates your repository. Run the following command to view
a description of the repository:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-09 UTC."],[],[]]