Come hang with us on Discord and chat directly with the team!Discordtop-bar-close-icon

2026-04-30

How to Install Paperless ngx on Ubuntu VPS with Docker, Nginx, and SSL

tutorial
img

Introduction

Paperless-ngx is one of the most practical open-source document management systems for creating a searchable digital archive. It helps you store, organize, and retrieve scanned files with OCR, tagging, and fast full-text search. If you want secure access from anywhere, installing Paperless-ngx on an Ubuntu VPS is a reliable and affordable approach.

This tutorial explains how to deploy Paperless-ngx on Ubuntu, connect it to a subdomain, place it behind Nginx as a reverse proxy, and secure it with an SSL certificate from Let’s Encrypt. By the end, you will have a production-ready Paperless-ngx VPS setup that is accessible over HTTPS.

Why install Paperless-ngx on a VPS?

Running Paperless-ngx on a VPS gives you a flexible cloud-based document archive without needing to buy dedicated hardware. Compared with a local NAS or self-hosted desktop machine, a virtual private server is often cheaper to start with and easier to test.

  • Lower upfront cost than buying on-premise hardware
  • Accessible from any location through the web
  • Easy to scale as your document archive grows
  • Well suited for secure remote access
  • Ideal for trying Paperless-ngx before investing further

For best results, choose an Ubuntu VPS with at least 2 GB of RAM and preferably 2 CPU cores.

Step 1: Provision an Ubuntu VPS

Start by ordering a Linux VPS from your preferred hosting provider. Ubuntu 20.04 or newer is recommended for a smooth Paperless-ngx installation. Some providers offer Docker as a preinstalled option, which can save time later.

When your server is ready, keep the following details available:

  • Server IP address
  • Root username
  • Root password or SSH key

If you are choosing a plan, select a data center close to your users for better performance.

Step 2: Point a subdomain to your VPS

To make your Paperless-ngx instance easy to access, create a subdomain such as paperless.yourdomain.com. In your DNS settings, add an A record pointing that subdomain to your VPS IP address.

You can also create another A record for www.paperless.yourdomain.com if you want both versions to resolve correctly.

After saving the records, DNS propagation may take some time. Once complete, your subdomain should resolve to the server in a browser or DNS lookup tool.

Step 3: Connect to the server and create a sudo user

For security, it is better to install and manage Paperless-ngx with a regular user that has administrative privileges instead of using the root account directly.

Log in to your Ubuntu VPS over SSH as root:

ssh root@YOUR_SERVER_IP

Create a new user:

sudo adduser demo

Verify the user exists:

id demo

Grant sudo privileges:

sudo usermod -a -G sudo demo

Switch to the new user:

su -l demo

Update package information:

sudo apt update

Step 4: Install Docker on Ubuntu

Paperless-ngx is commonly deployed with Docker, which makes installation and maintenance much easier. First, check whether Docker is already available:

docker -v

If Docker is not installed, add the official Docker repository and install the required packages.

sudo apt-get update

sudo apt-get install ca-certificates curl gnupg

sudo install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo $VERSION_CODENAME) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update

Install Docker Engine and related components:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Run a test container to confirm Docker is working properly:

sudo docker run hello-world

Step 5: Install Paperless-ngx

Once Docker is ready, you can deploy Paperless-ngx using the official installation script. This is one of the fastest ways to get a working instance on Ubuntu.

bash -c "$(curl --location --silent --show-error https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/install-paperless-ngx.sh)"

During the setup process, you will be prompted for several configuration options.

Important Paperless-ngx configuration choices

  • URL: Enter your full subdomain, such as https://paperless.yourdomain.com
  • Port: Keep the default value of 8000 unless you have a reason to change it
  • Time zone: Set the correct server time zone so document dates are accurate
  • Database: PostgreSQL is the best default choice for most VPS deployments
  • Apache Tika: Enable it if you want support for Office files like Word, Excel, or PowerPoint
  • OCR language: Use the correct ISO 639-2 codes, such as eng or eng+deu
  • Folders: You can keep defaults, but dedicated paths like ./media, ./data, and ./database can make management easier
  • Login credentials: Create the initial Paperless-ngx admin username and password

After installation, Paperless-ngx should be available on port 8000. At this stage, you can usually access it through a URL like http://paperless.yourdomain.com:8000.

Step 6: Set up Nginx as a reverse proxy

To access Paperless-ngx without manually adding port 8000, configure Nginx as a reverse proxy. This also prepares the server for HTTPS.

Install Nginx:

sudo apt update

sudo apt install nginx

Allow HTTP traffic through the firewall:

sudo ufw allow 'Nginx HTTP'

Check the Nginx service status:

systemctl status nginx

Create a dedicated Nginx site configuration:

sudo nano /etc/nginx/sites-available/paperless.yourdomain.com

Add a reverse proxy configuration that forwards requests to the Paperless-ngx web server on port 8000. Be sure to replace the domain name with your own.

client_max_body_size 10M;

server {

listen 80;

listen [::]:80;

server_name paperless.yourdomain.com www.paperless.yourdomain.com;

location / {

proxy_pass http://localhost:8000;

proxy_http_version 1.1;

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "upgrade";

proxy_redirect off;

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-Host $server_name;

}

}

Enable the site by creating a symbolic link:

sudo ln -s /etc/nginx/sites-available/paperless.yourdomain.com /etc/nginx/sites-enabled/

Test the Nginx configuration:

sudo nginx -t

Apply the changes:

sudo systemctl restart nginx

At this point, your Paperless-ngx installation should be reachable on the subdomain without adding the port manually.

Step 7: Enable HTTPS with Let’s Encrypt SSL

Securing your Paperless-ngx server with SSL is strongly recommended. Let’s Encrypt and Certbot provide a free and widely trusted way to enable HTTPS on Ubuntu.

Install Snap if it is not already present:

sudo apt install snapd

Install Certbot:

sudo snap install --classic certbot

Make the certbot command globally available:

sudo ln -s /snap/bin/certbot /usr/bin/certbot

Allow HTTPS in the firewall:

sudo ufw allow 'Nginx Full'

Remove the HTTP-only rule if no longer needed:

sudo ufw delete allow 'Nginx HTTP'

Request and install the SSL certificate for your domain:

sudo certbot --nginx -d paperless.yourdomain.com -d www.paperless.yourdomain.com

Follow the prompts to enter your email address and accept the terms. Certbot will automatically update your Nginx configuration and enable HTTPS redirection.

After completion, visiting your subdomain should redirect users to the secure https:// version.

Best practices for a stable Paperless-ngx VPS setup

  • Use strong passwords for both the Linux user and Paperless-ngx admin account
  • Keep Ubuntu packages updated regularly
  • Back up the media, data, and database directories
  • Use PostgreSQL unless you have a lightweight test environment
  • Enable Apache Tika only if you need Office document support
  • Review firewall rules and only expose required services
  • Consider enabling multi-factor authentication inside Paperless-ngx

Conclusion

You now have a complete Paperless-ngx installation on Ubuntu VPS with Docker, Nginx reverse proxy, and SSL encryption. This setup gives you a secure, web-accessible document management system that can handle OCR, search, and structured archiving from almost any device.

If you plan to build a serious digital filing workflow, this VPS deployment is a strong foundation. From here, you can connect a scanner, automate document ingestion through the consume folder, and further strengthen security with backups and two-factor authentication.

With the right configuration, Paperless-ngx can become the central hub for your paperless office or personal document archive.