This host proxies and caches packages from
pypi.org. Point pip, Poetry, or uv here to speed up installs
and cut outbound rate-limit hits. Replace mirror.example.com
below with this server's actual hostname.
Write the mirror into pip's user config so every
pip install uses it by default.
pip config set global.index-url https://mirror.example.com/simple/
# confirm it took
pip config get global.index-url
This writes to ~/.config/pip/pip.conf
(Linux/macOS) or %APPDATA%\pip\pip.ini (Windows).
Scope the mirror to a single project — safer for teams and reproducible in CI.
[global]
index-url = https://mirror.example.com/simple/
trusted-host = mirror.example.com
Or pass it inline without any config file:
pip install -i https://mirror.example.com/simple/ requests
[[tool.poetry.source]]
name = "mirror"
url = "https://mirror.example.com/simple/"
priority = "primary"
export UV_INDEX_URL=https://mirror.example.com/simple/
No repo changes needed — set this in your pipeline's environment.
export PIP_INDEX_URL=https://mirror.example.com/simple/
pip config get global.index-url
curl -s https://mirror.example.com/simple/ -o /dev/null -w "%{http_code}\n"
# install something and time it
time pip install requests --no-cache-dir
| Check | Expected result |
|---|---|
pip config get global.index-url | Prints https://mirror.example.com/simple/ |
GET /simple/ | 200 — mirror is reachable |
| First install of a package | Slower — cache miss, fetched from upstream and stored |
| Repeat install | Fast — served from local cache |
pypi.org.
twine upload still goes straight to the real index — this
mirror only accelerates installs. If it's served over plain HTTP
internally, add its host to trusted-host as shown above,
or terminate TLS in front of it.