Refer to your company Checklist and replace with the name of your devpi server. Do the same for the username and password.


Salt requires two separate bits of information in your pillar. The first is the server configuration. Here is an example file:

  port: 4040
  ssl: False
  # letsencrypt: True

The domain name is the server where your devpi service is running.

The port number is the one on which the local devpi service is running. The port is used when the service is started by supervisor. For details, see:

The ssl is set to False and the letsencrypt key is commented out so we can generate the LetsEncrypt certificate. They will both be set back to True after the certificate is generated.

The second piece of information required in your pillar is the configuration of pip. Here is an example file:



To create a Let’s Encrypt certificate, see the devpi section in Obtain and configure ssl certificate on nginx with letsencrypt.

If you are creating your own SSL certificate (Create SSL Certificate):

Copy the SSL certificate from your workstation to the server:

scp server.key
scp ssl-unified.crt

Create the folder for the certificates and update permissions:

sudo -i
mkdir -p /srv/ssl/devpi/
chown www-data:www-data /srv/ssl
chmod 0400 /srv/ssl
chown www-data:www-data /srv/ssl/devpi
chmod 0400 /srv/ssl/devpi

mv /home/patrick/repo/temp/server.key /srv/ssl/devpi/
mv /home/patrick/repo/temp/ssl-unified.crt /srv/ssl/devpi/
chown www-data:www-data /srv/ssl/devpi/*
chmod 0400 /srv/ssl/devpi/*

Re-start the nginx server:

service nginx restart

Initial Configuration

To configure after Salt has installed it on your server, run the following commands on your workstation:

# virtual environment
virtualenv --python=python3.4 venv-devpi-client
source venv-devpi-client/bin/activate
pip install --upgrade pip

pip install devpi-client


Use python 3 for devpi or you might get SSL certificate errors.


Create a password for the root user (change 123 to a password of your choice before adding to the Checklist):

devpi use --set-cfg
devpi login root --password ""
devpi user -m root password=789
devpi logoff

To log in later:

devpi login root --password "789"

Development Index


The user you create is used in the devpi URL e.g. for user bz the devpi URL will be

We need to create a user and an index for the user so we can upload our own packages (in this example, the user is bz):

devpi login root --password "789"

devpi user -c bz password=789
devpi login bz --password "789"
devpi index -c dev volatile=False


To delete the index: devpi index --delete dev


To configure your workstation to use devpi as it’s default index:

devpi use --set-cfg


I don’t know how to set the username or password

To remove the index (not sure if this works):

devpi use --delete


To upgrade the index to a new version:

sudo -i -u web
cd /home/web/repo/devpi
source venv_devpi/bin/activate
devpi-server --export /home/web/repo/backup/devpi/ --serverdir=/home/web/repo/devpi/data
mv /home/web/repo/devpi/data /home/web/repo/temp/
devpi-server --import /home/web/repo/backup/devpi/ --serverdir=/home/web/repo/devpi/data


The data folder needs to be removed before running the import command.


To solve any server side issues, start by using the --debug parameter in the /etc/supervisor/conf.d/devpi.conf file e.g:

/home/web/repo/devpi/venv_devpi/bin/devpi-server --serverdir=/home/web/repo/devpi/data --refresh=60 --port=4040 --host= --debug

Re-start the service using supervisorctl and check the logs in:


Bad Request

I kept getting a Bad request (400) error with no more information when running:

python clean sdist upload -r dev

For the first release of a module, use the devpi upload command. Subsequent releases will work using upload.


If the release procedure (python clean sdist upload -r dev) starts to throw some weird errors e.g:

running upload
Submitting dist/pkimber-my-app-0.0.03.tar.gz to http://your.server/bz/dev/
error: None

… then check the nginx error logs on the server:

tail /var/log/nginx/error.log