Welcome to the NZRT Wiki Podcast. Today we’re looking at Nextcloud Dolibarr Integration.
So let’s start with the big picture. Nextcloud and Dolibarr work together through a REST API connection combined with file sync. The goal is to let Dolibarr’s EDM module — that stands for Electronic Document Management — store its documents inside Nextcloud. By doing that, you get all of Nextcloud’s strengths: version history, sharing capabilities, and long-term archival, all feeding into the same documents your ERP system is working with.
Now let’s walk through what actually happens when you create an invoice. The workflow goes like this. First, you create an invoice inside Dolibarr. As soon as that happens, the system automatically saves a PDF copy of that invoice into a specific folder path in Nextcloud — something like Finance, then Invoices, then the year and month, then the invoice filename itself. Dolibarr then records that Nextcloud file path in its own database, so it always knows where the live copy lives. From that point on, you or your colleagues can open, version, or share that invoice directly inside Nextcloud, while Dolibarr keeps pointing to the same file. One document, two systems, no duplication of effort.
Let’s talk about the REST API side of things. There are two key calls that make this work. The first one handles authentication — it sends a request to Nextcloud asking for an access token, passing along a client ID and client secret. Think of it like knocking on the door and showing your credentials before you’re allowed in. The second call actually uploads a file. It uses a PUT request — that’s the web method for placing something at a specific location — and it sends the PDF file to a particular user’s folder path inside Nextcloud. The user and password are passed along with the request so Nextcloud knows who’s doing the uploading. That’s the core of how files move from Dolibarr into Nextcloud programmatically.
Now let’s look at how those files are organised once they’re in Nextcloud. There’s a top-level shared folder, and inside it sits a folder called Dolibarr EDM. Under that, you’ve got three main subfolders. The first is Invoices, which is further broken down by year and month — so April 2026 would have its own subfolder containing individual invoice PDFs like INV-001 and INV-002. The second subfolder is Contracts, which is organised by client — so Client A gets their own folder holding their contract and any amendments. The third subfolder is Purchase Orders, where PO files live in a flat structure by year and reference number. Clean, predictable, and easy to navigate.
Now here’s where the automation really shines — the nightly sync workflow. Every night at two in the morning, a scheduled process kicks off a five-step routine. Step one: it queries the Dolibarr API to find any documents that are new or have been updated since the last run. Step two: it checks Nextcloud to see if any of those documents already exist, so nothing gets duplicated. Step three: any files that are missing from Nextcloud get uploaded. Step four: Dolibarr’s file path references get updated to reflect the current locations. Step five: any documents older than ninety days get moved off to a NAS — a network-attached storage system — for long-term archiving. And at the end of all that, an email report goes out to the Finance role and the EDM role so the right people know what happened overnight. The whole thing runs without anyone needing to touch it.
Finally, a word on how this fits into NZRT specifically. This Nextcloud and Dolibarr connection is described as the backbone of NZRT’s document management. Three roles interact with it most closely. Finance, referred to internally as fin, handles invoices. The EDM role, referred to as ema, manages the document flows. And the Admin role, xc, oversees the whole thing. All three roles collaborate on invoices, contracts, and purchase orders through this single integrated system — so there’s one source of truth rather than files scattered across different tools.
If you want to dig deeper, there are three related wiki pages worth checking out: the Integrations Overview, the REST API and WebDAV guide, and the Document Management Overview. Those will give you more context on the broader architecture this integration sits within.
That’s it for this episode of the NZRT Wiki Podcast. Thanks for listening.