Hosting your own simple repository#

If you wish to host your own simple repository [1], you can either use a software package like devpi or you can simply create the proper directory structure and use any web server that can serve static files and generate an autoindex.

In either case, since you’ll be hosting a repository that is likely not in your user’s default repositories, you should instruct them in your project’s description to configure their installer appropriately. For example with pip:

python3 -m pip install --extra-index-url https://python.example.com/ foobar
py -m pip install --extra-index-url https://python.example.com/ foobar

In addition, it is highly recommended that you serve your repository with valid HTTPS. At this time, the security of your user’s installations depends on all repositories using a valid HTTPS setup.

“Manual” repository#

The directory layout is fairly simple, within a root directory you need to create a directory for each project. This directory should be the normalized name of the project. Within each of these directories simply place each of the downloadable files. If you have the projects “Foo” (with the versions 1.0 and 2.0) and “bar” (with the version 0.1) You should end up with a structure that looks like:

.
├── bar
│   └── bar-0.1.tar.gz
└── foo
    ├── Foo-1.0.tar.gz
    └── Foo-2.0.tar.gz

Once you have this layout, simply configure your webserver to serve the root directory with autoindex enabled. For an example using the built in Web server in Twisted, you would simply run twistd -n web --path . and then instruct users to add the URL to their installer’s configuration.

Existing projects#

Project

Package upload

PyPI fall-through [2]

Additional notes

devpi

multiple indexes with inheritance, with syncing, replication, fail-over; mirroring

simpleindex

pypiserver

pypiprivate

PyPI Cloud

unmaintained; also cached proxying; authentication, authorisation

pywharf

unmaintained; serve files in GitHub

Pulp-python

also mirroring, proxying; plugin for Pulp

pip2pi

also mirroring; manual synchronisation

dumb-pypi

not a server, but a static file site generator

http.server

standard-library

Apache

using mod_rewrite and mod_cache_disk, you can cache requests to package indexes through an Apache server