Skip to main content

Overview

Gitea Package Registry provides a unified platform for hosting multiple package types. The Packages API allows you to manage packages, versions, and files across all supported package formats.

Supported Package Types

Gitea supports the following package registries:
  • alpine - Alpine Linux packages
  • cargo - Rust crates
  • chef - Chef cookbooks
  • composer - PHP packages
  • conan - C/C++ packages
  • conda - Conda packages
  • container - Docker/OCI container images
  • cran - R packages
  • debian - Debian packages
  • generic - Generic file storage
  • go - Go modules
  • helm - Kubernetes Helm charts
  • maven - Java Maven artifacts
  • npm - Node.js packages
  • nuget - .NET packages
  • pub - Dart packages
  • pypi - Python packages
  • rpm - RPM packages
  • rubygems - Ruby gems
  • swift - Swift packages
  • vagrant - Vagrant boxes

Packages

List Packages

List all packages for an owner (user or organization).
string
required
Package owner (username or organization name)
string
Filter by package type (npm, maven, container, etc.)
string
Search query to filter packages by name
integer
Page number for pagination (default: 1)
integer
Number of items per page (default: 30)
array
integer
Package ID
string
Package type
string
Package name
string
Latest version
object
User who created the package
string
Creation timestamp
object
Linked repository (if any)

Get Package

Get details about a specific package version.
string
required
Package type
string
required
Package name
string
required
Package version
integer
Package version ID
string
Package name
string
Package version
string
Package type
array
Files included in this version
object
Package-specific metadata (varies by type)

Delete Package

Delete a specific package version.
Deleting a package version is permanent and cannot be undone.

Package Versions

List Package Versions

List all versions of a specific package.
array
List of all versions for the package

Get Latest Version

Get the latest version of a package.

Package Files

List Package Files

List all files in a package version.
array
integer
File ID
string
Filename
integer
File size in bytes
string
MD5 hash
string
SHA-256 hash
string
SHA-512 hash
Link a package to a repository for better organization.
string
required
Name of the repository to link to
Remove the link between a package and a repository.

Package Type Specific Examples

Docker/Container Images

Container images use the standard Docker Registry API v2 protocol.
Container images are accessed at: gitea.example.com/owner/image:tag

npm Packages

Publish and install npm packages from Gitea.

Maven Artifacts

Configure Maven to use Gitea as a repository.

PyPI Packages

Publish Python packages to Gitea.

NuGet Packages

Manage .NET packages with NuGet.

Generic Packages

Upload arbitrary files as generic packages.

Helm Charts

Manage Kubernetes Helm charts.

Cargo Crates

Publish Rust crates to Gitea.

Package Metadata

Each package type stores specific metadata:
  • Package description
  • Dependencies
  • Keywords
  • License
  • Author information

Authentication

Package registry endpoints support multiple authentication methods:

Token Authentication

Basic Authentication

Package Tool Authentication

Most package managers support credential storage:

Storage and Cleanup

Package Retention

Administrators can configure automatic cleanup rules:
  • Retention days for old versions
  • Maximum number of versions to keep
  • Pattern-based cleanup rules

Storage Quotas

Package storage may be limited by:
  • Per-user quotas
  • Organization quotas
  • Global instance limits

Best Practices

  • Use semantic versioning for your packages
  • Link packages to repositories for better traceability
  • Set up cleanup rules to manage storage costs
  • Use scoped packages for npm to avoid naming conflicts
  • Include comprehensive metadata for better discoverability
  • Deleting packages can break dependent projects
  • Consider using deprecation instead of deletion
  • Always verify checksums when downloading packages

Package Registry Configuration

Server administrators can configure package registry settings in app.ini:

Error Handling

Common error responses:
  • 404 Not Found: Package or version doesn’t exist
  • 409 Conflict: Package version already exists
  • 413 Payload Too Large: Package exceeds size limits
  • 422 Unprocessable Entity: Invalid package format or metadata
  • 403 Forbidden: Insufficient permissions

Rate Limiting

Package registry endpoints may be subject to rate limiting to prevent abuse. Check response headers:
  • X-RateLimit-Limit: Maximum requests per time window
  • X-RateLimit-Remaining: Remaining requests
  • X-RateLimit-Reset: Time when limit resets