1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-02-07 06:30:06 +00:00

Add running as root instruction

Blondel MONDESIR 2024-10-08 21:10:00 -04:00
parent b4a6f672fe
commit 1bb172403e

@ -4,51 +4,57 @@ If you want to manually install Calibre-Web (“from source”), follow the inst
_These instructions assume a Debian-based Linux distribution (Ubuntu, Raspberry Pi OS...)_
1. **Install git, imagemagick, netifaces, pip, venv, and cryptography:**
1. **Switch to a root shell**:
- `sudo -i`
- `sudo apt install git imagemagick python3-netifaces python3-pip python3-venv python3-cryptography`
2. **Install git, imagemagick, netifaces, pip, venv, and cryptography:**
- `apt install git imagemagick python3-netifaces python3-pip python3-venv python3-cryptography`
**PRO TIPS**:
- On **Ubuntu** and **Debian**, `python3-cryptography` is installed by default, unlike on Raspberry Pi OS.
- Installing `python3-cryptography` is not required if you plan to install a newer version using pip as described in Step 4.
2. **Download and extract Calibre-Web:**
- `sudo mkdir -p /opt`
3. **Download and extract Calibre-Web:**
- `mkdir -p /opt`
- `cd /opt`
- `sudo git clone https://github.com/janeczku/calibre-web`
- `git clone https://github.com/janeczku/calibre-web`
- `cd calibre-web`
3. **Create a virtual environment** for Calibre-Web:
- `sudo python3 -m venv venv`
4. **Create a virtual environment** for Calibre-Web:
- `python3 -m venv venv`
4. **Install dependencies** by running:
- `sudo ./venv/bin/python3 -m pip install -r requirements.txt`
5. **Install dependencies** by running:
- `./venv/bin/python3 -m pip install -r requirements.txt`
**PRO TIP:**
- **If you want a more recent version of `cryptography`** than your OS offers:
- `sudo ./venv/bin/python3 -m pip install cryptography`
- `./venv/bin/python3 -m pip install cryptography`
5. **Run Calibre-Web** with the command:
- `sudo ./venv/bin/python3 cps.py`
6. **Run Calibre-Web** with the command:
- `./venv/bin/python3 cps.py`
**PRO TIP:**
- Or use `nohup ./venv/bin/python3 cps.py` if you want to exit the terminal window.
6. **[Try it out!](https://github.com/janeczku/calibre-web#quick-start)**
7. **[Try it out!](https://github.com/janeczku/calibre-web#quick-start)**
8. **Exit the root shell when finished**:
- `exit`
#### Additional Issues and Considerations:
**Raspberry Pi (Raspberry Pi OS)**:
Depending on your version of pip, the installation might fail with `Failed to build cryptography`. If you encounter this issue, try:
1. Updating pip:
- `sudo ./venv/bin/python3 -m pip install --upgrade pip`
- `./venv/bin/python3 -m pip install --upgrade pip`
2. If the error persists, install `cargo`:
- `sudo apt install cargo`
- `apt install cargo`
3. Then, try installing Calibre-Web again.
**Ubuntu**:
On some Ubuntu versions, you may encounter the error `can't combine user with prefix`. This is a [known bug](https://github.com/pypa/pip/issues/3826) and can be resolved by installing the requirements with the `--system` flag:
- `sudo ./venv/bin/python3 -m pip install --system -r requirements.txt`
- `./venv/bin/python3 -m pip install --system -r requirements.txt`
**Configuration Files**:
All configuration files (settings database, log files) are stored in the Calibre-Web root folder (in this example, `/opt/calibre-web`). Additional config files, such as those for Google Drive or Gmail integration, should be placed there as well.