π Star this repo to keep your docs in line and your chaos in check.
βββ β§ βββ
π Got rogue PDFs or rebellious receipts? Cast them into the fire and Enter π₯HADESπ₯.
Paperless-ngx transforms your mountains of paper clutter into a sleek, searchable, digital archive. Deploy it on your Synology NAS and enjoy the magic of AI-powered document management. No more hunting for receipts like a pirate searching for treasure! π΄ββ οΈπ
This repository adapts the guides from Lixandru Marius Bogdan to create a complete all-in-one deployment for Paperless-ngx and Paperless-AI. It allows you to deploy all services seamlessly onto a Synology NAS using Container Manager or Portainer.
- π Paperless-ngx Setup
- π€ Paperless-ngx AI Setup
- π₯οΈ Portainer Guide
Alternatively, you can use my π³ Docker Compose deployment for Portainer to deploy and manage Portainer on your NAS before setting up this project.
This setup supports:
- OCR-Powered Search π - Scan, search, and retrieve documents with ease.
- AI-Powered Categorization π€ - Let Paperless-ngx AI auto-sort and tag your documents.
- Office File Support π - Convert and manage
.docx
,.pdf
, and other formats. - Synology NAS Friendly π - Deploy with DSM Container Manager or Portainer.
This project uses Docker IPAM (IP Address Management) to manage container networking. To ensure smooth communication, you may need to configure your firewall to allow access based on the defined subnet.
You can configure the following settings in your .env
file:
# Define the subnet range for the network
COMPOSE_NETWORK_SUBNET="${COMPOSE_NETWORK_SUBNET:-172.24.0.0/16}"
# Define the IP range for containers
COMPOSE_NETWORK_IP_RANGE="${COMPOSE_NETWORK_IP_RANGE:-172.24.5.0/24}"
# Define the network gateway
COMPOSE_NETWORK_GATEWAY="${COMPOSE_NETWORK_GATEWAY:-172.24.5.254}"
To allow communication for this Docker network, update the Synology Firewall settings:
- Open Control Panel β Security (under Connectivity).
- Navigate to the Firewall tab β Click Edit Rules.
- Click Create to add a new rule:
- Ports: Select
All
- Source IP: Select
Specific IP
- Click
Select
β ChooseSubnet
- Enter
172.24.0.0
for IP Address and255.255.0.0
for Subnet mask/Prefix length - Action: Select
Allow
- Ports: Select
- Click OK to apply the changes.
This ensures that containers using this Docker network can communicate without restrictions.
For more details, check the Docker Compose IPAM documentation.
This guide walks you through deploying Paperless-ngx using DSM Container Manager (recommended for Synology NAS). You can also use Portainer if you prefer a different UI.
No need to manually create foldersβthis project automatically sets them up in the config
directory:
config/
βββ paperless-ai/
βββ paperless-ngx/
β βββ consume/
β βββ data/
β βββ db/
β βββ export/
β βββ media/
β βββ redis/
β βββ trash/
A sample environment file is already included! Simply copy it and update the values as needed:
cp example.env .env
vim .env # Edit with your settings
- Open DSM Container Manager.
- Navigate to Projects β Click Create.
- Select Import YAML and browse to the
docker-compose.yml
file in the project root. - Click Next β Review settings β Click Apply.
If you prefer Portainer, follow these steps:
- Go to Stacks in Portainer.
- Click Add Stack β Name it
paperless
. - Browse to the
docker-compose.yml
file in the project root. - Click Deploy the Stack.
Once deployed, open your browser and access the service:
- Paperless-ngx:
https://paperlessngx.yourname.synology.me
Log in with your admin credentials and start managing documents! π
The full docker-compose.yml
file is included in the project root. Check it out if you want to tweak or customize your deployment.
- Ensure your firewall rules allow access to the subnet defined in
COMPOSE_NETWORK_SUBNET
. - Make sure your
.env
file has the correctPAPERLESS_REDIS
value. - Run
docker logs paperless
to check for errors. - Try restarting the stack with
docker compose down && docker compose up -d
.
If you see the following warning in Redis logs:
WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328.
This means that Linux memory overcommit is disabled, which can cause Redis to fail under low memory conditions. To fix this, update your system configuration:
sudo vim /etc/sysctl.conf
Add these lines to make the changes persistent:
vm.overcommit_memory = 1
Then apply the changes:
sudo sysctl vm.overcommit_memory=1
Or reboot your NAS for the changes to take effect.
If you see this warning:
WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
This means the system's TCP connection backlog is too low, which could cause Redis to drop connections under high load. To fix it:
sudo vim /etc/sysctl.conf
Add this line:
net.core.somaxconn = 65535
Then apply the changes:
sudo sysctl net.core.somaxconn=65535
Or reboot your NAS for the changes to take effect.
- Ensure the correct NAS IP and port are used.
- Run
docker ps
to check if all containers are running.
Congratulations! π You've set up Paperless-ngx, and Paperless-AI on your Synology NAS. Now you can manage documents efficiently using AI models. πποΈπ€
For more advanced configurations, check out the official Paperless-ngx documentation and Paperless-AI documentation.