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).
owner
string
required
Package owner (username or organization name)
type
string
Filter by package type (npm, maven, container, etc.)
q
string
Search query to filter packages by name
page
integer
Page number for pagination (default: 1)
limit
integer
Number of items per page (default: 30)
packages
array
id
integer
Package ID
type
string
Package type
name
string
Package name
version
string
Latest version
creator
object
User who created the package
created_at
string
Creation timestamp
repository
object
Linked repository (if any)

Get Package

Get details about a specific package version.
type
string
required
Package type
name
string
required
Package name
version
string
required
Package version
id
integer
Package version ID
name
string
Package name
version
string
Package version
type
string
Package type
files
array
Files included in this version
metadata
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.
versions
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.
files
array
id
integer
File ID
name
string
Filename
size
integer
File size in bytes
hash_md5
string
MD5 hash
hash_sha256
string
SHA-256 hash
hash_sha512
string
SHA-512 hash
Link a package to a repository for better organization.
repo_name
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