Paperless-AI is an automated document analyzer for Paperless-ngx using OpenAI API and Ollama (Mistral, llama, phi 3, gemma 2) to automatically analyze and tag your documents. It features: Auto mode, Manual Mode, Ollama and OpenAI, a Chat function to query your documents with AI, and a modern and intuitive Web interface. In this step by step guide I will show you how to install Paperless-AIĀ on your Synology NAS using Docker and Portainer.
STEP 1
Please Support My work by Making a Donation.
ā ļøSTEP 2
Paperless-AI makes changes to the documents in your productive PaperlessNGX instance that cannot be easily undone. Do the configuration carefully and think twice. ā ļøMandatory: it’s mandatory to test the results beforehand in a separate development environment and be sure to back up your documents and metadata beforehand.
STEP 3
InstallĀ Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP. ā ļøAttention: Make sure you have installed the latest Portainer version.
STEP 4
InstallĀ PaperlessNGX using my step by step guide. If you already have PaperlessNGX installed on your Synology NAS, skip this STEP.
STEP 5
InstallĀ Ollama using my step by step guide. If you already have Ollama installed on your Synology NAS, skip this STEP. ā ļøAttention: This STEP is not mandatory. If you decide to use OpenAI API instead of Local LLM, you don’t have to install Ollama.
STEP 6
Go toĀ File StationĀ and open the docker folder. Inside the docker folder, create one new folder and name itĀ paperlessngxai. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.
STEP 7
Log into Portainer using your username and password. On the left sidebar in Portainer, click on StacksĀ thenĀ + Add stack. Follow the instructions in the image below.
STEP 8
In the Name field type in paperlessngxai. Follow the instructions in the image below.
services: paperlessngx-ai: image: clusterzx/paperless-ai container_name: PaperlessNGX-AI healthcheck: test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/3000' || exit 1 interval: 10s timeout: 5s retries: 3 start_period: 90s volumes: - /volume1/docker/paperlessngxai:/app/data:rw ports: - 3747:3000 restart: on-failure:5
STEP 9
Scroll down on the page until you see a button namedĀ Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.
STEP 10
If everything goes right, you will see the following message at the top right of your screen: āSuccess Stack successfully deployedā.
STEP 11
The installation process can take up to a few seconds/minutes. It will depend on your Internet speed connection. Now open your browser and type in http://Synology-ip-address:3747/setup Change the theme to Dark. Follow the instructions in the image below.
STEP 12
Log into your Paperless-NGX instance that you have previously installed at STEP 4. On the left sidebar, click on your name, then My Profile. Follow the instructions in the image below.
STEP 13
On the API Auth Token area, click the refresh icon, then Copy the auto-generated token in a safe place. You will need this token later at STEP 16. Click Save. Follow the instructions in the image below.
STEP 14
Log into your Ollama instance that you have previously installed at STEP 5. Select the llama3.2:latest model. Follow the instructions in the image below. ā ļøNote: Skip this STEP if you want to use OpenAI API instead of Ollama.
STEP 15
After you have selected the llama3.2:latest model, click Set as default. Follow the instructions in the image below. ā ļøNote: Skip this STEP if you want to use OpenAI API instead of Ollama.
STEP 16
Now open your browser and type in http://Synology-ip-address:3747/setup
In the User Settings area, add the details below:
Type in your Username and Password. Follow the instructions in the image below.
STEP 17
In the Connection Settings area, add the details below:
Paperless-ngx API URL: Type in your Paperless ngx local address or domain. ā ļøAttention: use the link without the slash at the end. The link should be http://yournasip:8777 and NOT http://yournasip:8777/ If you are using your own domain name, type in https://paperlessngx.yourname.synology.me and not https://paperlessngx.yourname.synology.me/
API Token: Type in your own Paperless ngx Token that you have previously generated at STEP 13.
In the AI Configuration area, add the details below:
AI Provider: If you decided to use Ollama instead of OpenAI, select Ollama (Local LLM) from the list.
Ollama API URL: Type in your Ollama local address. ā ļøAttention: use the link without the slash at the end. The link should be http://yournasip:11434Ā and NOT http://yournasip:11434/
Ollama Model: Type in llama3.2
In the Advanced Settings area, add the details below:
AI-Processed Tag Name: ai-processed
Prompt Description: Click on the Example.
Click Save Configuration.
STEP 18
Your configuration will be saved. Wait a few minutes for the Paperless-AI automatic restart.
STEP 19
Please Support My work by Making a Donation. Almost 99,9% of the people that install something using my guidesĀ forget to support my work, or justĀ ignoreĀ STEP 1. Iāve been very honest about this aspect of my work since the beginning: I donāt run any ADS, I donāt require subscriptions, paid or otherwise, I donāt collect IPs, emails, and I donāt have any referral links from Amazon or other merchants. I also donāt have any POP-UPs or COOKIES. I have repeatedly been told over the years how much I have contributed to the community. Itās something I love doing and have been honest about my passion since the beginning. But I also Need The Community to Support me Back to be able to continue doing this work.
STEP 21
Now open your browser and type in http://Synology-ip-address:3747/dashboard On the left sidebar, click Manual then select your Paperless NGX files and analyze them with AI. Follow the instructions in the image below. Note: Ollama can slow down your NAS. It’s better to use OpenAI API for better performance instead of Ollama.
Enjoy Paperless-AI!
If you encounter issues by using this container, make sure to check out the Common Docker issuesĀ article.
Note: If you want to run the Paperless-AI container over HTTPS, check How to Run Docker Containers Over HTTPS. In order to make Paperless-AI work via HTTPS, it’s mandatory to activate WebSocket. ā ļøWarning: I do NOT recommend running Paperless-AI via Reverse Proxy. This product should be used only on localhost. Why don’t I recommend running it via Reverse Proxy? Because if someone were to know your HTTPS address, then they can use your own API keys for free and charge you if you have a paid plan. Also, if someone knows your Reverse proxy address, they can have access to your Paperless-AI functions.
Note: Can I run Docker on my Synology NAS?Ā See the supported models.
Note: How to Back Up Docker Containers on your Synology NAS.
Note: Find outĀ how to update the Paperless-AI container with the latest image.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.
This post was updated on Saturday / January 18th, 2025 at 12:44 AM