Paperless-ngx "Bare Metal" installieren (Debian 11/12): Unterschied zwischen den Versionen

Aus RT-Wiki - IT-Notizbuch
Zur Navigation springen Zur Suche springen
KKeine Bearbeitungszusammenfassung
KKeine Bearbeitungszusammenfassung
Zeile 24: Zeile 24:
</syntaxhighlight>
</syntaxhighlight>
===Python 3.11 installieren===
===Python 3.11 installieren===
'''Debian 11:'''<syntaxhighlight lang="bash">
'''Debian 11:'''
:<syntaxhighlight lang="bash">
wget https://www.python.org/ftp/python/3.11.11/Python-3.11.11.tgz
wget https://www.python.org/ftp/python/3.11.11/Python-3.11.11.tgz
tar -xvf Python-3.11.11.tgz
tar -xvf Python-3.11.11.tgz
Zeile 32: Zeile 33:
sudo make install
sudo make install
</syntaxhighlight>
</syntaxhighlight>
'''Debian 12:'''<syntaxhighlight lang="bash">
'''Debian 12:'''
:<syntaxhighlight lang="bash">
sudo apt install python3.11 python3.11-venv python3-pip
sudo apt install python3.11 python3.11-venv python3-pip
</syntaxhighlight>
</syntaxhighlight>
Zeile 88: Zeile 90:
GRANT ALL ON SCHEMA public TO paperless;
GRANT ALL ON SCHEMA public TO paperless;
\q
\q
</syntaxhighlight>Frontend Build<syntaxhighlight lang="bash">
</syntaxhighlight>Frontend:<syntaxhighlight lang="bash">
cd src-ui
cd src-ui


Zeile 103: Zeile 105:


sudo -Hu paperless ng build --configuration production
sudo -Hu paperless ng build --configuration production
</syntaxhighlight>Backend:<syntaxhighlight lang="bash">
cd ../src
</syntaxhighlight>'''Debian 11:'''<syntaxhighlight lang="bash">
sudo -Hu paperless python3 manage.py migrate
sudo -Hu paperless python3 manage.py createsuperuser
sudo -Hu paperless python3 manage.py collectstatic
</syntaxhighlight>'''Debian 12:'''<syntaxhighlight lang="bash">
sudo -Hu paperless /opt/paperless/venv/bin/python3 manage.py migrate
sudo -Hu paperless /opt/paperless/venv/bin/python3 manage.py createsuperuser
sudo -Hu paperless /opt/paperless/venv/bin/python3 manage.py collectstatic
</syntaxhighlight>Systemd Services anlegen:<syntaxhighlight lang="bash">
cd ../scripts
</syntaxhighlight>'''Debian 12:'''<syntaxhighlight lang="bash">
sudo vi paperless-consumer.service
</syntaxhighlight>ExcecStart ersetzen:<syntaxhighlight lang="bash">
ExecStart=/opt/paperless/venv/bin/python3 manage.py document_consumer
</syntaxhighlight>
</syntaxhighlight>

Version vom 22. März 2025, 21:15 Uhr

Testumgebung
OS Debian 11.11/12.10
paperless-ngx (Dev) 2.15.0

Anleitung für die "Bare Metal" Installation von paperless-ngx mit dem Quellcode vom Dev-Branch auf Debian 11 und 12.

Abhängigkeiten installieren

Das System auf den neusten Stand bringen:

sudo apt update
sudo apt upgrade
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libpq-dev libsqlite3-dev wget libbz2-dev pkg-config libgdbm-compat-dev liblzma-dev tk-dev uuid-dev

Python 3.11 installieren

Debian 11:

wget https://www.python.org/ftp/python/3.11.11/Python-3.11.11.tgz
tar -xvf Python-3.11.11.tgz
cd Python-3.11.11
./configure --enable-optimizations
make -j$(nproc)
sudo make install

Debian 12:

sudo apt install python3.11 python3.11-venv python3-pip

Ghostscript 10.05 installieren

wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10050/ghostscript-10.05.0.tar.gz
tar -xvf ghostscript-10.05.0.tar.gz
cd ghostscript-10.05.0
./configure --without-x
make -j$(nproc)
sudo make install
sudo apt install imagemagick fonts-liberation gnupg libpq-dev default-libmysqlclient-dev pkg-config libmagic-dev libzbar0 poppler-utils
sudo apt install unpaper icc-profiles-free qpdf liblept5 libxml2 pngquant zlib1g tesseract-ocr python3-setuptools python3-wheel

sudo apt install redis git curl

Paperless Benutzer erstellen und Repository klonen:

sudo adduser paperless --system --home /opt/paperless --group
cd /opt/paperless
sudo -Hu paperless git clone https://github.com/paperless-ngx/paperless-ngx.git .
sudo -Hu paperless mkdir consume media

Debian 11:

sudo -Hu paperless pip3 install uv
sudo -Hu paperless uv export --no-dev --all-extras --format requirements-txt --output-file requirements.txt
sudo -Hu paperless pip3 install -r requirements.txt

Debian 12:

sudo -Hu paperless python3 -m venv /opt/paperless/venv
sudo -Hu paperless /opt/paperless/venv/bin/pip3 install uv
sudo -Hu paperless /opt/paperless/venv/bin/uv export --no-dev --all-extras --format requirements-txt --output-file requirements.txt
sudo -Hu paperless /opt/paperless/venv/bin/pip3 install -r requirements.txt
sudo -Hu paperless cp paperless.conf.example paperless.conf
sudo -Hu paperless vi paperless.conf
PAPERLESS_SECRET_KEY=change-me

PAPERLESS_CONSUMPTION_DIR=/mnt/paperless-store/consume
PAPERLESS_DATA_DIR=/mnt/paperless-store/data
PAPERLESS_MEDIA_ROOT=/mnt/paperless-store/media

Wenn du postgresql statt sqlite verwendet möchtest:

PAPERLESS_DBHOST=127.0.0.1 # Use postgresql
PAPERLESS_DBNAME=db_paperless
#PAPERLESS_DBUSER=paperless
PAPERLESS_DBPASS=<password>
sudo apt install postgresql
sudo -u postgres psql
CREATE DATABASE db_paperless;
CREATE USER paperless WITH ENCRYPTED PASSWORD '<password>';
GRANT ALL ON DATABASE db_paperless TO paperless;
\c db_paperless
GRANT ALL ON SCHEMA public TO paperless;
\q

Frontend:

cd src-ui

Debian 11:

sudo curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs

Debian 12:

sudo apt install nodejs
sudo apt install npm
sudo npm install -g @angular/cli
sudo npm install -g pnpm
sudo -Hu paperless pnpm install

sudo -Hu paperless ng build --configuration production

Backend:

cd ../src

Debian 11:

sudo -Hu paperless python3 manage.py migrate
sudo -Hu paperless python3 manage.py createsuperuser
sudo -Hu paperless python3 manage.py collectstatic

Debian 12:

sudo -Hu paperless /opt/paperless/venv/bin/python3 manage.py migrate
sudo -Hu paperless /opt/paperless/venv/bin/python3 manage.py createsuperuser
sudo -Hu paperless /opt/paperless/venv/bin/python3 manage.py collectstatic

Systemd Services anlegen:

cd ../scripts

Debian 12:

sudo vi paperless-consumer.service

ExcecStart ersetzen:

ExecStart=/opt/paperless/venv/bin/python3 manage.py document_consumer