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