How To Install Calibre Server & Calibre Web On Ubuntu 22.04

Calibre is a free, open source and easy to use e-book manager. Calibre supports organizing existing e-books into virtual libraries, displaying, editing, creating and converting e-books, as well as syncing e-books with a variety of e-readers. Editing books is supported for EPUB and AZW3 formats.

First, we install Calibre and then Calibre Web.

1. Update and upgrade Ubuntu

$ sudo apt update -y && sudo apt upgrade -y

2. Reboot your server (if necessary):

$ sudo reboot now

3. Configure firewall ports (if necessary – ports 8081 and 8083 need to be allowed):

$ sudo ufw allow http
$ sudo ufw allow https
$ sudo ufw allow 8081
$ sudo ufw allow 8083

4. Create a new Calibre user

Create a new user for Calibre and give it superuser privileges:

$ sudo adduser calibre
$ sudo usermod -aG sudo calibre

Log out and log back in with the new user you just added.

5. Install dependencies

$ sudo pip3 install pyqt5
$ sudo apt-get install libgl1-mesa-glx libxdamage1 libegl1 libxkbcommon0 libopengl0 libxkbcommon-x11-0 libfontconfig

6. Download and install Calibre-server

$ sudo -v && wget -nv -O- | sudo sh /dev/stdin

You may notice some warnings about failed desktop integration, but these are safe to ignore, since you are installing Calibre on a remote server.

7. Create Calibre library directories

Log out and log back in with the new user you just added. Then make a directory for the Calibre library and uploads.

$ sudo mkdir calibre-library
$ sudo mkdir calibre-upload

Change ownership permissions of the directories:

$ sudo chown -R calibre:calibre calibre-library
$ sudo chown -R calibre:calibre calibre-upload
$ sudo chown -R calibre:calibre .config
$ sudo chmod ugo+rw calibre-upload

8. Add a sample e-book

Download a sample e-book to load into the upload directory:

$ cd calibre-upload
$ sudo wget -O heart.epub

Then add the e-book to the library:

$ sudo calibredb add ~/calibre-upload/* --library-path ~/calibre-library

9. Test the server

To test the server, launch with the following command (you can substitute the port 8180 with something else):

$ sudo calibre-server --port=8081 --enable-local-write ~/calibre-library

Then open your web browser and go to: or if using a local LAN, http://192.168.0.XX:8081 (replace ‘XX' with the coorect IP Address)

When you are satisfied everything works, go back to the command line and Ctrl+C to exit.

10. Add a log file

Add a log file and change its ownership permissions:

$ cd ~
$ sudo touch ~/calibre.log
$ sudo chown -R calibre:calibre ~/calibre.log

11. Add / Manage Calibre Users

$ sudo calibre-server --userdb /home/calibre/.config/calibre/server-users.sqlite --manage-users

Then follow the prompts. Repeat to add, edit or remove users.

12. Starting Calibre server at boot

$ sudo nano /etc/systemd/system/calibre-server.service

Add the code below changing User, Group, port and the location to the calibre-library directory (in this case /home/calibre/calibre-library):

Description=calibre content server


--port 8081 \
--enable-auth \


Ctrl+X to Save and Exit.

Then start the server with:

$ sudo systemctl start calibre-server.service

Check the status with:

$ sudo systemctl status calibre-server.service

Then to start at boot:

$ sudo systemctl enable calibre-server.service


If you have make any changes to calibre-server.service, reload:

$ sudo systemctl daemon-reload

To stop calibre-server:

$ sudo systemctl stop calibre-server.service

You can uninstall Calibre by running:

$ sudo calibre-uninstall

13. Installing Calibre-Web

Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database.

Make sure you are logged in as the user calibre. Make sure that we have a python version 3+ installed. Check your python version:

$ python3 --version

example output:

Python 3.10.12

Now simply install Calibre Web with the code below:

$ pip3 install calibreweb

Start Calibre-Web:

$ nohup cps

You can now close the terminal and Calibre Web will still run at or http://192.168.0.XX:8083 (replace ‘XX' with the coorect IP Address).

14. Starting Calibre-Web on boot

Start Calibre-Web as service under Linux with systemd:

$ sudo nano /etc/systemd/system/cps.service

Add this and replace the elements in {} like User, ExecStart and WorkingDirectory with your username, file and foldernames:


ExecStart={path to python} {/PATH/TO/ including}
WorkingDirectory={/PATH/OF/CPS.PY without}




ExecStart=/usr/bin/python3 /home/calibre/calibre-web/


Ctrl+X to Save and Exit.

Enable the service:

$ sudo systemctl enable cps.service

15. Optional features for installation with pip

Optional features of Calibre-Web can be installed with pip by executing pip install calibreweb[extraname]. The “[” and “]” are part of the command.

See the list of optional features here:


$ sudo pip3 install calibreweb[gmail]

When you go to or if using a local LAN, http://192.168.0.XX:8083 (replace ‘XX' with the coorect IP Address), you will have to set the location of the Calibre database.

This is where the metadata.db is. In this case, /home/calibre/calibre-library. Click submit. The default admin login is:

Username: admin
Password: admin123


1. You can add the path to your SSL certifile (for https) in Calibre Web at Admin settings > Basic Configuration > Server Configuration.

Moving calibre installation to a new server
Install Calibre on your new server.
Copy all contents of the calibre-library folder into the new calibre-library folder of the new server.
The most important thing to backup is the calibre library folder, that contains all your books and metadata. This is the folder you chose for your calibre library when you ran calibre for the first time. You can get the path to the library folder by clicking the calibre icon on the main toolbar. You must backup this complete folder with all its files and sub-folders.

You can switch calibre to using a backed up library folder by simply clicking the calibre icon on the toolbar and choosing your backup library folder. A backed up library folder backs up your custom columns and saved searches as well as all your books and metadata.

If you want to backup the calibre configuration/plugins, you have to backup the config directory. You can find this config directory via Preferences → Miscellaneous. Note that restoring configuration directories is not officially supported, but should work in most cases. Just copy the contents of the backup directory into the current configuration directory to restore.


For info on Calibre performance, see:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.