A commented apt-proxy.yaml showing common configuration keys with examples,
defaults and inline notes. Not a directly-runnable example —
copy it, trim what you don't need, then point apt-proxy at it.
Pick one of the locations apt-proxy auto-discovers:
./apt-proxy.yaml(current working directory)/etc/apt-proxy/apt-proxy.yaml(system-wide)~/.config/apt-proxy/apt-proxy.yaml(per-user)~/.apt-proxy.yaml(per-user, legacy)
Or pass it explicitly:
apt-proxy --config=/path/to/apt-proxy.yaml
# or
APT_PROXY_CONFIG_FILE=/path/to/apt-proxy.yaml apt-proxyCLI flags > Environment variables > Config file > Built-in defaults
So a flag (e.g. --port=8000) always wins over the same key in this YAML.
server:— bind host/port and debug logging.cache:— local cache directory, size cap, TTL, cleanup interval and integrity. Nonpositive YAML cache size/TTL/cleanup fields retain defaults; explicit CLI or environment0disables the corresponding backend control.resources:— object size, combined temporary payload copies, active upstream downloads and disk headroom; zero selects bounded defaults.storage:— switch between local disk and S3-compatible object storage. See../s3-otterio/for a runnable S3 example.download:— upstream fetch deadline and unknown-length spool budgets; zero selects bounded defaults, not unlimited downloads.mirrors:— pin upstream mirrors per distro (full URL or shortcut likecn:tsinghua).tls:— terminate HTTPS at apt-proxy itself.security:— management API authentication/rate limiting and independent connection-peer CIDR lists for package downloads.upstream_access:— optional direct repository connection policy for downloads, mirror probes and Ubuntu geo discovery. Enabled policies bypass environment forward proxies; S3 and telemetry clients are outside its scope.mode:— restrict to a single distro family or serve them all.
Download/resource limits, download CIDR lists and upstream access policy are YAML-only. Restart the daemon after changing them; mirror refresh does not reload these settings. See download limits, download access and upstream access, resource limits and cache integrity for their scope and examples. For optional policies absent from this template, see runtime mirror health and shared repository cache.