Skip to content

Install

What the app needs, the three ways to install it, and how it stays up to date. Once it is installed, Configure connects it to Paperless-ngx. To see it at work first, without touching your own servers, try the demo.

Try it in three minutes

One command starts a real Paperless-ngx and a real Nextcloud in Docker on your own machine, with five synthetic documents, Paperless Sync and this app set up, and ends with a search that finds the documents. Your own Nextcloud and Paperless stay untouched:

git clone https://github.com/Dennis-Otto/paperless-unified-search.git
cd paperless-unified-search
bash demo/seed.sh

It needs Docker with Compose and Bash, Git Bash on Windows, and generates the passwords of the demo on your machine. Both web interfaces listen on 127.0.0.1 alone. Once the script prints the accounts, sign in as jamie at http://localhost:8180 and search for invoice: the home insurance renewal is among the results, because its text says "invoice", while its title doesn't. The guide of the demo says what else to try, and how to remove it again.

What the demo sets up: You run bash demo/seed.sh. It generates the secret key of Paperless and the passwords of the demo into demo/.env, and starts Paperless-ngx with Redis and Nextcloud with its background jobs in Docker, on 127.0.0.1 alone. Paperless reads five synthetic letters. Paperless Sync, a pinned signed release, writes each one into the files of the archive account paperless, which shares the archive read-only with jamie. occ paperless_unified_search:setup connects the app to Paperless, with the API token through a pipe. A search as jamie for invoice shows three Paperless documents, and the script prints the addresses and the accounts to sign in with.What the demo sets up: You run bash demo/seed.sh. It generates the secret key of Paperless and the passwords of the demo into demo/.env, and starts Paperless-ngx with Redis and Nextcloud with its background jobs in Docker, on 127.0.0.1 alone. Paperless reads five synthetic letters. Paperless Sync, a pinned signed release, writes each one into the files of the archive account paperless, which shares the archive read-only with jamie. occ paperless_unified_search:setup connects the app to Paperless, with the API token through a pipe. A search as jamie for invoice shows three Paperless documents, and the script prints the addresses and the accounts to sign in with.

The demo at work, as jamie: the archive that Paperless Sync wrote into Nextcloud, a search for "invoice", and below the files the Paperless documents, the two invoices and the home insurance renewal, whose text says "invoice". The renewal opens in Nextcloud's viewer.

Recorded from the real Paperless-ngx and Nextcloud of the demo, by bash scripts/screenshots.sh --demo.

What it needs

Needs
Nextcloud 33 to 35
PHP 8.2 or newer, as the release of Nextcloud supports it
Paperless-ngx Paperless-ngx 2.16 or newer, 3.x included, with its REST API; Compatibility lists the versions that the tests cover
The network The Nextcloud server reaches Paperless over HTTP or HTTPS, connects within 3 seconds and gets every answer within 10. The browsers and the apps of the users never talk to Paperless
A Paperless account One that may view the documents to search, with an API token, as Configure sets it up
The archive Every document as a file of one Nextcloud account, the archive account, with the marker [P<ID>] in its name, such as the files of Paperless Sync or of any other synchronization

The app adds no table to the database of Nextcloud and needs no extension of PHP beyond those of Nextcloud. It registers one background job, which asks Paperless every five minutes for new documents while users ask for notifications about new documents: these notifications come only while Nextcloud's background jobs run, best by cron. Nobody needs an account in Paperless to find its documents: Nextcloud's shares decide who sees which one.

From the App Store

As an administrator of Nextcloud, open Apps, search for Paperless Unified Search and select Download and enable. The App Store lists the app under Integration, Files and Search.

occ does the same on the command line: app:install downloads the app from the App Store and enables it. Run it as the user of the web server, in the way that fits your installation:

# Nextcloud on a server of its own
sudo -u www-data php /var/www/nextcloud/occ app:install paperless_unified_search
# The Docker image of Nextcloud, whose service in compose.yaml is app
docker compose exec --user www-data app php occ app:install paperless_unified_search
# Nextcloud All-in-One
sudo docker exec --user www-data nextcloud-aio-nextcloud php occ app:install paperless_unified_search
# The snap of Nextcloud
sudo nextcloud.occ app:install paperless_unified_search

The rest of this documentation writes occ for whichever of these commands fits.

By hand, from a signed release

Where Nextcloud can't reach the App Store, as behind a firewall that lets no request out, install the package of a release:

  1. Download the package and its signature from the latest release, in the browser or with the GitHub CLI:

    gh release download --repo Dennis-Otto/paperless-unified-search \
      --pattern 'paperless_unified_search.tar.gz*'
    
  2. Check that the package is the one that the release workflow built and signed, before you unpack it: its build provenance, and its signature with the certificate of the app that the Nextcloud App Store issued.

    gh attestation verify paperless_unified_search.tar.gz --repo Dennis-Otto/paperless-unified-search
    curl -fsSLO https://raw.githubusercontent.com/nextcloud/app-certificate-requests/master/paperless_unified_search/paperless_unified_search.crt
    openssl x509 -in paperless_unified_search.crt -pubkey -noout > paperless_unified_search.pub
    openssl dgst -sha512 -verify paperless_unified_search.pub \
      -signature paperless_unified_search.tar.gz.sig paperless_unified_search.tar.gz
    

    The last command says Verified OK. Verify a release in the security policy also checks the release itself and its SBOM.

  3. Unpack it into a folder of apps that Nextcloud may write to, custom_apps in the Docker image of Nextcloud and apps in most other installations (apps_paths in config.php names them), and give it to the user of the web server:

    sudo tar -xzf paperless_unified_search.tar.gz -C /var/www/nextcloud/apps
    sudo chown -R www-data:www-data /var/www/nextcloud/apps/paperless_unified_search
    
  4. Enable it:

    occ app:enable paperless_unified_search
    

The package carries the signature of every one of its files, so Nextcloud's check of the integrity of its code passes, as for an app from the App Store.

Updates

Nextcloud tells its administrators of a new version of an app from the App Store; Apps → Updates, or occ app:update paperless_unified_search, installs it. A package installed by hand is updated the same way as it was installed: download, verify, and unpack it in place of the folder of the old version. The settings stay as they are.

The changelog says what changed in each version, and the announcements in the discussions, or Watch → Custom → Releases on GitHub, tell you of every release.

Next

  • Configure connects the app to Paperless and shares the archive with its readers.
  • Uninstall says how to remove the app again, and what stays behind.