How to Self-Host Paperless-ngx on a VPS (Complete Guide)
Self-hosting Paperless-ngx, a document management system, on a Virtual Private Server (VPS) can streamline your workflow and enhance data privacy. This guide will walk you through the steps required to install Paperless-ngx using Docker on a VPS, making it accessible for developers and homelab enthusiasts alike.
What is Paperless-ngx?
Paperless-ngx is an open-source application that enables you to scan, upload, and manage your documents effortlessly. Built on top of the Paperless ethos, this modern variant offers improved features and a more user-friendly interface. By self-hosting, you maintain control over your documents without relying on third-party services.
Choosing a VPS Provider
Before you get started, you need to choose a VPS provider. Below is a comparison of some top options:
| Provider | Price (EUR/USD) | Features |
|---|---|---|
| Contabo VPS | 5.99 EUR/mo | SSD storage, configurable CPU and RAM |
| Hetzner Cloud | 4.15 EUR/mo | High performance, great scalability |
| DigitalOcean | 6 USD/mo | User-friendly UI, managed services |
| Vultr | 6 USD/mo | Fast SSDs, global availability |
| Linode (Akamai) | 5 USD/mo | Simple pricing, great documentation |
You can find a full VPS comparison here.
System Requirements
Before installation, ensure that your VPS meets the following requirements:
- At least 2GB RAM (4GB recommended)
- 20GB SSD storage
- A domain name (optional but recommended)
- Docker and Docker Compose installed
Step-by-Step Installation Guide
Step 1: Set Up Your VPS
Provision your chosen VPS. For example, you can create a new instance with Hetzner Cloud for 4.15 EUR/mo or use Contabo for only 5.99 EUR/mo.
-
Connect to your server using SSH:
ssh root@your_server_ip -
Update your system:
apt update && apt upgrade -y
Step 2: Install Docker and Docker Compose
You need to have Docker and Docker Compose installed on your VPS. Use the following commands:
-
Install Docker:
apt install -y docker.io systemctl start docker systemctl enable docker -
Install Docker Compose:
apt install -y docker-compose
Step 3: Set Up Paperless-ngx
-
Create a directory for Paperless-ngx:
mkdir ~/paperless cd ~/paperless -
Create a
docker-compose.ymlfile:version: '3.7' services: paperless-ngx: image: ghcr.io/jfcherng/paperless-ngx:latest restart: always volumes: - ./data:/usr/src/paperless/data ports: - "8000:8000" environment: PAPERLESS_REDIS: redis://redis:6379 PAPERLESS_DBHOST: db PAPERLESS_DBUSER: paperless PAPERLESS_DBPASS: password redis: image: redis:latest restart: always db: image: postgres:latest restart: always environment: POSTGRES_USER: paperless POSTGRES_PASSWORD: password POSTGRES_DB: paperless volumes: - ./postgres:/var/lib/postgresql/data -
Launch Paperless-ngx:
docker-compose up -d
Step 4: Accessing the Application
Once the containers are up and running, you can access Paperless-ngx by navigating to http://your_server_ip:8000 in your web browser. You may want to set up a reverse proxy using Nginx or Traefik for actual domain use.
FAQs
1. What are the benefits of self-hosting Paperless-ngx?
Self-hosting Paperless-ngx on a VPS provides enhanced data control and privacy, as your documents are stored on your own server rather than on third-party services. This approach ensures you are in charge of your backup and security practices. Additionally, you can customize the application to fit your specific workflow needs without limitations imposed by hosted solutions.
2. How much storage do I need for Paperless-ngx?
While the minimum recommended storage is around 20GB, it ultimately depends on the amount of documents you plan to manage. If youโre dealing with high-resolution files or a large number of documents, consider scaling up your storage accordingly. Leveraging a VPS provider like DigitalOcean or Vultr for scalable storage options is also a wise choice for growing file sizes.
3. Can I run other applications on the same VPS?
Yes, you can run multiple applications on the same VPS by using Docker to isolate each service. Each application can run in its own container, preventing resource conflicts. However, ensure that your VPS has enough resources (CPU, RAM, and disk space) to handle these applications simultaneously. Itโs advisable to monitor your serverโs performance regularly to avoid overload issues.
In conclusion, self hosting Paperless-ngx on a VPS is a rewarding project offering various benefits for document management, especially for developers and homelab enthusiasts. By following this guide, you can achieve a self-reliant, efficient system for organizing your documents securely.