Introduction

Paperless is an open-source document management system that allows you to organize, archive, and search your documents efficiently. This guide will walk you through the process of installing Paperless with Nginx on Debian and configuring it.

Prerequisites

Before you begin, ensure you have:

  1. A Debian server or desktop system
  2. Root or sudo access to the server
  3. Nginx installed

Step 1: Install Dependencies

Update the package index and install required dependencies:

sudo apt update
sudo apt install -y python3 python3-pip

Step 2: Install Paperless

Install Paperless using pip:

sudo pip3 install paperless-ng

Step 3: Configure Paperless

Create a directory for Paperless and navigate into it:

mkdir ~/paperless
cd ~/paperless

Generate the default configuration file:

paperless-ng configure

Edit the configuration file to specify your preferences:

nano paperless.conf

Save and close the file.

Step 4: Set Up Database

Install SQLite:

sudo apt install -y sqlite3

Create the SQLite database:

paperless-ng init

Step 5: Start Paperless

Start Paperless using the built-in server:

paperless-ng runserver

Access Paperless in a web browser by navigating to http://localhost:8000.

Step 6: Configure Nginx

Create a new Nginx server block configuration file for Paperless:

sudo nano /etc/nginx/sites-available/paperless

Add the following configuration:

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://localhost:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Enable the Paperless site and restart Nginx:

sudo ln -s /etc/nginx/sites-available/paperless /etc/nginx/sites-enabled/
sudo systemctl restart nginx

Conclusion

Congratulations! You have successfully installed Paperless with Nginx on Debian and configured it. You can now start organizing and managing your documents using Paperless.

Was this answer helpful? 0 Users Found This Useful (0 Votes)