Skip to main content
HugBucket is configured entirely through environment variables. The table below is a quick-reference summary; detailed descriptions follow.

Quick reference


Required variables

string
required
Selects the gateway protocol. Must be either s3 or ftp. The process exits with an error if this variable is missing or empty.
string
required
Your Hugging Face API token. Used to authenticate all requests to the Hugging Face storage backend and to resolve your namespace via /api/whoami-v2 at startup.
Generate a token with write access at huggingface.co/settings/tokens.

S3 authentication

These variables apply only when MODE=s3. They define the credentials that S3 clients must present when connecting to the HugBucket S3 endpoint.
string
default:""
The access key ID that S3 clients must supply. Maps to the Hugging Face token internally.
string
default:""
The secret access key that S3 clients must supply alongside AWS_ACCESS_KEY_ID.
If both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are left empty, S3 authentication is disabled — any client can connect without credentials. Set both to non-empty values in production.
Setting only one of the two S3 credentials does not produce an error but will leave the gateway in an inconsistent authentication state. Always set both or neither.

FTP settings

These variables apply only when MODE=ftp.
string
default:""
The FTP username clients must authenticate with. Must be set together with FTP_PASSWORD.
string
default:""
The FTP password clients must authenticate with. Must be set together with FTP_USERNAME.
Leave both FTP_USERNAME and FTP_PASSWORD empty to allow anonymous FTP access. Setting only one of the two is a configuration error and will cause the server to refuse to start.

Internal configuration defaults

The following settings are defined in the Config dataclass (hugbucket/config.py) and cannot currently be overridden via environment variables. They are documented here for reference.

Network

Xet CDC (content-defined chunking)

Upload

Cache