2020-05-24 17:08:10 -04:00
---
stage: Package
group: Package
2020-11-26 01:09:20 -05:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2020-05-24 17:08:10 -04:00
---
2020-07-21 14:09:45 -04:00
# GitLab Package Registry administration
2019-09-17 08:06:48 -04:00
2020-11-17 19:09:02 -05:00
GitLab Packages allows organizations to use GitLab as a private repository
2019-09-17 08:06:48 -04:00
for a variety of common package managers. Users are able to build and publish
packages, which can be easily consumed as a dependency in downstream projects.
The Packages feature allows GitLab to act as a repository for the following:
2020-11-09 19:08:52 -05:00
The Package Registry supports the following formats:
< div class = "row" >
< div class = "col-md-9" >
< table align = "left" style = "width:50%" >
< tr style = "background:#dfdfdf" > < th > Package type< / th > < th > GitLab version< / th > < / tr >
< tr > < td > < a href = "https://docs.gitlab.com/ee/user/packages/composer_repository/index.html" > Composer< / a > < / td > < td > 13.2+< / td > < / tr >
< tr > < td > < a href = "https://docs.gitlab.com/ee/user/packages/conan_repository/index.html" > Conan< / a > < / td > < td > 12.6+< / td > < / tr >
< tr > < td > < a href = "https://docs.gitlab.com/ee/user/packages/go_proxy/index.html" > Go< / a > < / td > < td > 13.1+< / td > < / tr >
< tr > < td > < a href = "https://docs.gitlab.com/ee/user/packages/maven_repository/index.html" > Maven< / a > < / td > < td > 11.3+< / td > < / tr >
2021-02-12 22:08:45 -05:00
< tr > < td > < a href = "https://docs.gitlab.com/ee/user/packages/npm_registry/index.html" > npm< / a > < / td > < td > 11.7+< / td > < / tr >
2020-11-09 19:08:52 -05:00
< tr > < td > < a href = "https://docs.gitlab.com/ee/user/packages/nuget_repository/index.html" > NuGet< / a > < / td > < td > 12.8+< / td > < / tr >
< tr > < td > < a href = "https://docs.gitlab.com/ee/user/packages/pypi_repository/index.html" > PyPI< / a > < / td > < td > 12.10+< / td > < / tr >
< tr > < td > < a href = "https://docs.gitlab.com/ee/user/packages/generic_packages/index.html" > Generic packages< / a > < / td > < td > 13.5+< / td > < / tr >
< / table >
< / div >
< / div >
## Accepting contributions
2020-11-29 22:09:25 -05:00
The below table lists formats that are not supported, but are accepting Community contributions for. Consider contributing to GitLab. This [development documentation ](../../development/packages.md )
guides you through the process.
2020-11-09 19:08:52 -05:00
2021-01-29 13:09:17 -05:00
<!-- vale gitlab.Spelling = NO -->
2020-11-09 19:08:52 -05:00
| Format | Status |
| ------ | ------ |
| Chef | [#36889 ](https://gitlab.com/gitlab-org/gitlab/-/issues/36889 ) |
| CocoaPods | [#36890 ](https://gitlab.com/gitlab-org/gitlab/-/issues/36890 ) |
| Conda | [#36891 ](https://gitlab.com/gitlab-org/gitlab/-/issues/36891 ) |
| CRAN | [#36892 ](https://gitlab.com/gitlab-org/gitlab/-/issues/36892 ) |
2021-02-17 16:09:06 -05:00
| Debian | [Draft: Merge Request ](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50438 ) |
2020-11-09 19:08:52 -05:00
| Opkg | [#36894 ](https://gitlab.com/gitlab-org/gitlab/-/issues/36894 ) |
| P2 | [#36895 ](https://gitlab.com/gitlab-org/gitlab/-/issues/36895 ) |
| Puppet | [#36897 ](https://gitlab.com/gitlab-org/gitlab/-/issues/36897 ) |
| RPM | [#5932 ](https://gitlab.com/gitlab-org/gitlab/-/issues/5932 ) |
| RubyGems | [#803 ](https://gitlab.com/gitlab-org/gitlab/-/issues/803 ) |
| SBT | [#36898 ](https://gitlab.com/gitlab-org/gitlab/-/issues/36898 ) |
2021-02-17 16:09:06 -05:00
| Terraform | [Draft: Merge Request ](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18834 ) |
2020-11-09 19:08:52 -05:00
| Vagrant | [#36899 ](https://gitlab.com/gitlab-org/gitlab/-/issues/36899 ) |
2019-09-17 08:06:48 -04:00
2021-01-29 13:09:17 -05:00
<!-- vale gitlab.Spelling = YES -->
2019-09-17 08:06:48 -04:00
## Enabling the Packages feature
2020-12-04 16:09:29 -05:00
NOTE:
2019-09-17 08:06:48 -04:00
After the Packages feature is enabled, the repositories are available
2020-12-03 16:09:35 -05:00
for all new projects by default. To enable it for existing projects, users
2020-11-29 22:09:25 -05:00
explicitly do so in the project's settings.
2019-09-17 08:06:48 -04:00
To enable the Packages feature:
**Omnibus GitLab installations**
1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
```ruby
gitlab_rails['packages_enabled'] = true
```
1. Save the file and [reconfigure GitLab ](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab" ) for the changes to take effect.
**Installations from source**
2020-11-29 22:09:25 -05:00
1. After the installation is complete, you configure the `packages`
2019-09-17 08:06:48 -04:00
section in `config/gitlab.yml` . Set to `true` to enable it:
```yaml
packages:
enabled: true
```
1. [Restart GitLab ](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab" ) for the changes to take effect.
2020-11-09 19:08:52 -05:00
**Helm Chart installations**
2020-11-29 22:09:25 -05:00
1. After the installation is complete, you configure the `packages`
2020-11-09 19:08:52 -05:00
section in `global.appConfig.packages` . Set to `true` to enable it:
```yaml
packages:
enabled: true
```
1. [Restart GitLab ](../restart_gitlab.md#helm-chart-installations "How to reconfigure Helm GitLab" ) for the changes to take effect.
2019-09-17 08:06:48 -04:00
## Changing the storage path
By default, the packages are stored locally, but you can change the default
local location or even use object storage.
### Changing the local storage path
The packages for Omnibus GitLab installations are stored under
`/var/opt/gitlab/gitlab-rails/shared/packages/` and for source
2020-03-23 23:09:28 -04:00
installations under `shared/packages/` (relative to the Git home directory).
2019-09-17 08:06:48 -04:00
To change the local storage path:
**Omnibus GitLab installations**
1. Edit `/etc/gitlab/gitlab.rb` and add the following line:
```ruby
gitlab_rails['packages_storage_path'] = "/mnt/packages"
```
1. Save the file and [reconfigure GitLab ](../restart_gitlab.md#omnibus-gitlab-reconfigure )
for the changes to take effect.
**Installations from source**
1. Edit the `packages` section in `config/gitlab.yml` :
```yaml
packages:
enabled: true
storage_path: shared/packages
```
1. Save the file and [restart GitLab ](../restart_gitlab.md#installations-from-source ) for the changes to take effect.
### Using object storage
Instead of relying on the local storage, you can use an object storage to
2020-04-09 11:09:29 -04:00
store packages.
[Read more about using object storage with GitLab ](../object_storage.md ).
2019-09-17 08:06:48 -04:00
2020-12-04 16:09:29 -05:00
NOTE:
2020-12-11 01:10:17 -05:00
We recommend using the [consolidated object storage settings ](../object_storage.md#consolidated-object-storage-configuration ). The following instructions apply to the original configuration format.
2020-07-12 23:09:12 -04:00
2019-09-17 08:06:48 -04:00
**Omnibus GitLab installations**
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines (uncomment where
necessary):
```ruby
gitlab_rails['packages_enabled'] = true
gitlab_rails['packages_object_store_enabled'] = true
gitlab_rails['packages_object_store_remote_directory'] = "packages" # The bucket name.
gitlab_rails['packages_object_store_direct_upload'] = false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
gitlab_rails['packages_object_store_background_upload'] = true # Temporary option to limit automatic upload (Default: true).
gitlab_rails['packages_object_store_proxy_download'] = false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
gitlab_rails['packages_object_store_connection'] = {
##
## If the provider is AWS S3, uncomment the following
##
#'provider' => 'AWS',
#'region' => 'eu-west-1',
#'aws_access_key_id' => 'AWS_ACCESS_KEY_ID',
#'aws_secret_access_key' => 'AWS_SECRET_ACCESS_KEY',
2020-09-09 20:08:32 -04:00
## If an IAM profile is being used with AWS, omit the aws_access_key_id and aws_secret_access_key and uncomment
#'use_iam_profile' => true,
2019-09-17 08:06:48 -04:00
##
## If the provider is other than AWS (an S3-compatible one), uncomment the following
##
#'host' => 's3.amazonaws.com',
#'aws_signature_version' => 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
#'endpoint' => 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
#'path_style' => false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
}
```
2020-03-15 23:09:14 -04:00
2019-09-17 08:06:48 -04:00
1. Save the file and [reconfigure GitLab ](../restart_gitlab.md#omnibus-gitlab-reconfigure )
for the changes to take effect.
**Installations from source**
1. Edit the `packages` section in `config/gitlab.yml` (uncomment where necessary):
```yaml
2020-09-28 17:10:29 -04:00
packages:
enabled: true
##
## The location where build packages are stored (default: shared/packages).
##
# storage_path: shared/packages
object_store:
enabled: false
remote_directory: packages # The bucket name.
# direct_upload: false # Use Object Storage directly for uploads instead of background uploads if enabled (Default: false).
# background_upload: true # Temporary option to limit automatic upload (Default: true).
# proxy_download: false # Passthrough all downloads via GitLab instead of using Redirects to Object Storage.
connection:
2019-09-17 08:06:48 -04:00
##
2020-09-28 17:10:29 -04:00
## If the provider is AWS S3, use the following:
2019-09-17 08:06:48 -04:00
##
2020-09-28 17:10:29 -04:00
provider: AWS
region: us-east-1
aws_access_key_id: AWS_ACCESS_KEY_ID
aws_secret_access_key: AWS_SECRET_ACCESS_KEY
##
## If the provider is other than AWS (an S3-compatible one), comment out the previous 4 lines and use the following instead:
##
# host: 's3.amazonaws.com' # default: s3.amazonaws.com.
# aws_signature_version: 4 # For creation of signed URLs. Set to 2 if provider does not support v4.
# endpoint: 'https://s3.amazonaws.com' # Useful for S3-compliant services such as DigitalOcean Spaces.
# path_style: false # If true, use 'host/bucket_name/object' instead of 'bucket_name.host/object'.
2019-09-17 08:06:48 -04:00
```
1. Save the file and [restart GitLab ](../restart_gitlab.md#installations-from-source ) for the changes to take effect.
### Migrating local packages to object storage
After [configuring the object storage ](#using-object-storage ), you may use the
following task to migrate existing packages from the local storage to the remote one.
2020-11-29 22:09:25 -05:00
The processing is done in a background worker and requires **no downtime** .
2019-09-17 08:06:48 -04:00
For Omnibus GitLab:
2020-01-30 10:09:15 -05:00
```shell
2019-09-17 08:06:48 -04:00
sudo gitlab-rake "gitlab:packages:migrate"
```
For installations from source:
2020-01-30 10:09:15 -05:00
```shell
2019-09-17 08:06:48 -04:00
RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:packages:migrate
```