How to Install and Use Paperless-ngx on Ubuntu (Complete Digital Document Management Guide)
Last Updated: July 11th, 2026
This comprehensive tutorial shows you how to install, configure, secure, and use Paperless-ngx on an Ubuntu server. Paperless-ngx is an open-source, community-driven document management system that transforms your physical paper documents into a searchable, digitized archive. By leveraging optical character recognition (OCR), automated tagging, and an intuitive web interface, it lets you conquer household or office paperwork for good.
What Is Paperless-ngx?
Paperless-ngx is a self-hosted document management system designed to index, archive, and retrieve all your paper files digitally. When you scan a physical receipt, tax form, or invoice, Paperless-ngx runs powerful OCR routines to extract every single word from the page. It automatically recognizes correspondents, titles, and dates, and can even suggest tags using machine learning. Self-hosting ensures your sensitive financial records, medical documents, and personal IDs stay secure on hardware you own and control.
Paperless-ngx Features
- Advanced OCR Engine: Automatically scans and indexes text in PDF documents, images, and scanned files across dozens of languages.
- Intelligent Tagging & Correspondents: Automatically categorizes incoming documents based on predefined rules and past behavior.
- Consuming from Anywhere: Features a dedicated consumption folder, email polling (IMAP integration), and companion mobile apps to ingest files instantly.
- Lightning-Fast Search: Search through thousands of pages of documents in milliseconds using complex boolean query terms.
- Multi-User Support: Create granular permission tiers and share specific document views with family members or team colleagues.
Requirements & Prerequisites
You will need an Ubuntu server (22.04, 24.04 LTS, or newer) with administrative sudo privileges, Docker and Docker Compose installed, a valid domain name, and an active TLS/SSL certificate (Let's Encrypt). A robust CPU core allocation helps accelerate background OCR processing tasks.
Step 1: Install Docker and Docker Compose
Paperless-ngx and its underlying database/redis stack run smoothly inside isolated containers. Log into your Ubuntu server and install Docker:
sudo apt update
sudo apt install -y docker.io docker-compose-v2
sudo systemctl start docker
sudo systemctl enable docker
Step 2: Create a Docker Compose Configuration for Paperless-ngx
Create a dedicated directory for your Paperless deployment and set up your environment mapping files:
mkdir -p ~/paperless-ngx && cd ~/paperless-ngx
sudo nano docker-compose.yml
Paste the following production container configuration into the file:
services:
webserver:
image: ghcr.io/paperless-ngx/paperless-ngx:latest
restart: always
depends_on:
- db
- broker
ports:
- 127.0.0.1:8000:8000
volumes:
- data:/usr/src/paperless/data
- media:/usr/src/paperless/media
- ./consume:/usr/src/paperless/consume
- export:/usr/src/paperless/export
environment:
- PAPERLESS_REDIS=redis://broker:6379
- PAPERLESS_TIME_ZONE=UTC
- PAPERLESS_OCR_LANGUAGE=eng
db:
image: postgres:15-alpine
restart: always
volumes:
- dbdata:/var/lib/postgresql/data
environment:
- POSTGRES_DB=paperless
- POSTGRES_USER=paperless
- POSTGRES_PASSWORD=SuperSecureDatabasePassword123
broker:
image: redis:7-alpine
restart: always
volumes:
- redisdata:/data
volumes:
data:
media:
dbdata:
redisdata:
export:
Save and close the file, then spin up your containers in the background:
sudo docker compose up -d
Step 3: Create the Superuser Account
Once the container initializes, execute a command inside the webserver container to create your primary administrative login:
sudo docker compose exec webserver python manage.py createsuperuser
Follow the terminal prompts to define your admin username, email address, and secure password.
Step 4: Configure an Nginx Reverse Proxy
Route public requests securely from your custom domain (e.g., paper.example.com) to the local container port 8000:
sudo apt install -y nginx
sudo nano /etc/nginx/conf.d/paperless.conf
Add the following server block configuration:
server {
listen 80;
server_name paper.example.com;
client_max_body_size 64M;
location / {
proxy_pass http://127.0.0.1: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;
}
}
Test syntax and reload Nginx:
sudo nginx -t
sudo systemctl reload nginx
Step 5: Secure with Let’s Encrypt HTTPS
Obtain an official SSL/TLS certificate via Certbot:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx --agree-tos --redirect --email [email protected] -d paper.example.com
Step 6: Consuming and Managing Documents
Open your browser and navigate to https://paper.example.com. Log in using your superuser credentials.
- Adding Files via Consume Folder: Drop any scanned PDF or JPEG file directly into your local
~/paperless-ngx/consumedirectory. The background worker container automatically pulls the file in, runs the OCR pipeline, indexes the text, and stores the processed artifact safely. - Using the Web Dashboard: Navigate to the **Documents** tab to view your parsed files. Edit correspondents, assign custom tags, set document types (e.g., Invoice, Medical, Tax), and test the real-time search engine by looking for any specific word contained inside your files.