Skip to content

Setup Service on Linux

Ozzie Isaacs edited this page Nov 20, 2021 · 9 revisions

Start Calibre-Web as service under Linux with systemd

If you want to get Calibre-Web started automatically after reboot follow this instructions. Create a file cps.service as root in the folder /etc/systemd/system with the following content:

Replace the elements in {} like User, ExecStart and WorkingDirectory with your username and file- and foldernames.

Service file for installation from source

[Unit]
Description=Calibre-Web

[Service]
Type=simple
User={Username}
ExecStart={path to python} {/PATH/TO/cps.py including cps.py}
WorkingDirectory={/PATH/OF/CPS.PY without cps.py}

[Install]
WantedBy=multi-user.target

Service file for installation via pip

Find the location of the calibre-web starterfile cps, this should be something like /home/<user>/.local/bin/cps. Another option is using {path to correct pythoninstance} -m cps as starterfile. The correct python instance depends on how you installed calibre-web (e.g. virtual environment, system interpreter)

[Unit]
Description=Calibre-Web

[Service]
Type=simple
User={Username}
ExecStart={path to starterfile}

[Install]
WantedBy=multi-user.target

Start Service

sudo systemctl enable cps.service

enables the service.