In this installation method you use a special papermerge command startetc to generate a bunch of configuration files in <papermerge-proj>/run/etc folder. Then only with one single command:

systemctl --user start papermerge

you start a full fledged staging environment with nginx, gunicorn, one worker and recurring commands running as services on a single machine. I really love this method and I use in my local development environment. This method relies on systemd and its --user argument.

Package Dependencies

You will need to install os specific packages first.

Make sure that your machine has both nginx and systemd available:

nginx -V
systemd --version

Web App

Clone main papermerge project:

git clone --depth 1 --branch v1.3.0 papermerge-proj

Create python’s virtual environment .env:

cd papermerge-proj
python3 -m venv .venv

Activate python’s virtual environment:

source .venv/bin/activate

Install required python packages (now you are in papermerge-proj directory):

# while in <papermerge-proj> folder
pip install -r requirements.txt

Rename file config/settings/ to config/settings/ This file is default for DJANGO_SETTINGS_MODULE and it is included in .gitignore.

In project root directory create and add there MEDIA_DIR for example. In case you leave empty - default values will be used.

Then, as in any django based project, run migrations and create super user:

cd <papermerge-proj>
./ migrate
./ collectstatic
./ createsuperuser

Run startetc command:

./ startetc

Just out of curiousity, have a look <papermerge-proj>/run at folder generated by startetc command. Folder <papermerge-proj> should have following structure:

├── etc
│   ├──
│   ├── nginx.conf
│   ├── papermerge.env
│   └── systemd
│       ├── papermerge.service
│       ├──
│       ├── mg_nginx.service
│       ├── worker.service
├── log
└── tmp

Systemd can be used to manage user services. For that –user flag is used. User services must be referenced in ~/.config/systemd/user folder.

Create ~/.config/systemd/user if you don’t have it. Then reference (create symbolic links) <papermerge-proj>/run/etc/systemd/ units in ~/.config/systemd/user folder:

cd ~/.config/systemd/user
ln -s <papermerge-proj>/run/etc/systemd/* .


Path <papermerge-proj>/run/etc/systemd/* must be absolute.

Start papermerge:

systemctl --user start