Services & Background Processes

DocMan runs several background services on your server. This page explains what each one does, how to check whether it's running, and how to start, stop, or restart it. The easiest place to manage everything is the DocMan Tray Manager — but every service is also visible from the Windows Services console and the command line.

Quick reference: The Tray Manager is your front door for day-to-day monitoring. Windows Services (services.msc) is the authoritative controller that runs at boot. PowerShell gives you scriptable, remote-friendly control. Log files in the DocMan install directory are where you go when something is wrong.

What's Running on the Server

A typical DocMan installation has the following moving parts. All of them install automatically — you do not need to set them up manually.

ComponentTypeWhat It Does
DocMan API Windows service The core web server. Serves the browser UI on https://localhost, handles authentication, document uploads, search, permissions, and all REST API traffic. Everything else talks to this service.
DocMan OCR Worker Windows service Processes the OCR queue. When a document is uploaded, the API adds an OCR job. This worker picks jobs off the queue, runs them through Tesseract, and writes the extracted text back so it becomes searchable.
DocMan Watch Folder Monitor Windows service Polls every configured watch folder on its interval, picks up new files, and imports them into the correct cabinet/folder. Responsible for both standard and AI watch folders. See Watch Folders and AI Watch Folders.
DocMan AI Worker Windows service Processes AI filing jobs queued by the watch folder monitor. Sends document content to the configured AI connection (Ollama or cloud), parses the response, and places the suggested filing into the Review Queue.
DocMan Tray Manager User-space app (system tray) A small Windows app that lives in the system tray (clock area). Shows the status of every DocMan service with a colored icon and lets you start, stop, restart, and view logs without opening the Services console. It is not a service itself — it runs as the logged-in user.
PostgreSQL Third-party service The database that stores all DocMan metadata, users, permissions, OCR text, audit logs, and queue state. Installed separately. If this is down, nothing else works.
Ollama (optional) Third-party service Runs self-hosted AI models for AI Watch Folders. Only required if you are using AI features with local models. See the Ollama setup steps in AI Watch Folders.

The DocMan Tray Manager

The Tray Manager is the intended way to check on DocMan. It is installed to the Start Menu as DocMan Tray Manager.

Starting the Tray Manager

  • From the Start Menu, search for DocMan Tray Manager and launch it.
  • A DocMan icon appears in the Windows system tray (bottom-right of the taskbar). If the icon is hidden, click the up-arrow to expand the tray.
  • To start it automatically at login, pin it to shell:startup. Press Win+R, type shell:startup, press Enter, and drop a shortcut to the Tray Manager into that folder.

Reading the Tray Icon

Icon ColorMeaning
GreenAll DocMan services are running.
YellowAt least one service is in a transitional state (starting or stopping) or one service is stopped but others are still running.
RedA core service (API or the database connection) is stopped or unreachable. DocMan is not serving requests.
GrayThe Tray Manager cannot contact the Windows Service Control Manager. Usually means the Tray Manager was started without permissions, or the services are not installed.

Right-Click Menu

Right-click the tray icon to get the management menu. Typical options include:

  • Status: Shows each service with its current state (Running / Stopped / Paused).
  • Start All / Stop All / Restart All: Acts on every DocMan service in the correct order (API last on startup, API first on shutdown).
  • Individual service controls: Start, stop, or restart a specific service (e.g., just the OCR Worker).
  • Open Logs Folder: Opens the DocMan log directory in File Explorer.
  • Open in Browser: Launches https://localhost.
  • Exit: Closes the Tray Manager. This does not stop DocMan services — they keep running in the background. The Tray Manager is just a monitor.

Restart All is the safe default. If DocMan is behaving strangely, Restart All cycles every service in the correct order, waits for each one to come back up, and reports the result. It is the fastest path to a clean state that does not require logging into the server directly.

Using the Windows Services Console

Every DocMan service is a standard Windows service. You can manage them from services.msc, which is the authoritative source for start/stop behavior and auto-start configuration.

  1. Open the Services console
    Press Win+R, type services.msc, and press Enter. Or open Task Manager, switch to the Services tab, and click Open Services.
  2. Find the DocMan services
    Click the Name column to sort alphabetically. Scroll to services beginning with DocMan. You should see DocMan API, DocMan OCR Worker, DocMan Watch Folder Monitor, and DocMan AI Worker.
  3. Check status
    The Status column shows Running, blank (stopped), or Starting/Stopping. The Startup Type should be Automatic for all of them so they come up at boot.
  4. Start, stop, or restart
    Right-click a service and choose Start, Stop, or Restart. Restart is a stop-then-start as a single operation.
  5. Change startup type
    Right-click the service, choose Properties, and change Startup type to Automatic, Automatic (Delayed Start), Manual, or Disabled. Use Automatic (Delayed Start) if the server is slow to come up and the API is racing PostgreSQL at boot.
  6. Review recovery options
    On the Properties dialog, the Recovery tab controls what Windows does if the service crashes. The installer sets these to Restart the Service on first, second, and subsequent failures. Do not change this unless you have a specific reason.

Permissions note: Starting and stopping services requires administrator rights. If the right-click options are grayed out, launch services.msc as administrator (right-click the Start Menu shortcut and choose Run as administrator).

Managing Services from PowerShell

When you are remoting into the server, scripting a restart, or working from a deployment pipeline, PowerShell is the fastest path. Open PowerShell as administrator.

List all DocMan services and their status

Get-Service -Name 'DocMan*' | Format-Table Name, Status, StartType

Check a specific service

Get-Service -Name 'DocManApi'

Start / stop / restart

Start-Service   -Name 'DocManApi'
Stop-Service    -Name 'DocManApi'
Restart-Service -Name 'DocManApi'

Restart everything DocMan

Get-Service -Name 'DocMan*' | Restart-Service -Force

The -Force flag tells Windows to stop dependent services if any are tied to the service being restarted.

Change startup type

Set-Service -Name 'DocManApi' -StartupType Automatic

Wait for a service to be running (useful in scripts)

$svc = Get-Service -Name 'DocManApi'
$svc.WaitForStatus('Running', '00:01:00')

Managing Services with sc.exe

sc.exe is the classic Windows service controller. It is available on every Windows installation and does not require PowerShell.

sc query DocManApi
sc start DocManApi
sc stop  DocManApi
sc config DocManApi start= auto

Note the space after start= — that is required by sc.exe.

Log Files

Every DocMan service writes to its own log file. Logs are the first place to look when something is not working.

Default Log Locations

Unless overridden during installation, logs live under the install directory:

C:\DocMan\logs\
  ├── api.log              (DocMan API)
  ├── ocr.log              (OCR Worker)
  ├── watcher.log          (Watch Folder Monitor)
  ├── ai.log               (AI Worker)
  └── tray.log             (Tray Manager)

Opening Logs Quickly

  • Tray Manager: Right-click the tray icon → Open Logs Folder.
  • Run dialog: Press Win+R, type C:\DocMan\logs, press Enter.
  • PowerShell: Invoke-Item C:\DocMan\logs

Tailing a Log Live

To watch a log in real-time as the service runs (the equivalent of tail -f):

Get-Content C:\DocMan\logs\api.log -Wait -Tail 100

-Tail 100 shows the last 100 lines to give you context, and -Wait keeps the window open and appends new lines as the service writes them. Ctrl+C stops tailing.

Log Rotation

DocMan rotates its own log files. When a log reaches its size limit, the current file is renamed (e.g., api.logapi-2026-04-24.log) and a new empty api.log is started. Old rotated logs are kept for the retention period configured in Admin → Settings → Logging. You can safely delete any file with a dated suffix if you need to reclaim disk space.

Restart Order & Dependencies

DocMan services are mostly independent, but there is one dependency you should understand: the API service is the hub. All other workers talk to it (or to the database directly). For a full restart, the Tray Manager handles the order automatically, but if you are restarting by hand:

Clean Restart Sequence

  1. Stop DocMan Watch Folder Monitor.
  2. Stop DocMan AI Worker.
  3. Stop DocMan OCR Worker.
  4. Stop DocMan API.
  5. (Optional) Confirm PostgreSQL is running.
  6. Start DocMan API. Wait until it reports ready (check api.log).
  7. Start DocMan OCR Worker.
  8. Start DocMan AI Worker.
  9. Start DocMan Watch Folder Monitor.

Stopping the workers first lets any in-flight jobs finish cleanly. Starting the API first gives the workers something to connect to. If you stop or start in a different order, nothing is permanently broken — workers retry their connections — but you may see short bursts of "connection refused" messages in the worker logs during the gap.

Troubleshooting

A service will not start

  1. Open the service's log file (api.log, ocr.log, etc.) and read the last 50 lines. The root cause is almost always logged.
  2. Verify PostgreSQL is running: Get-Service postgresql*. If it's stopped, start it first.
  3. Check the .env file in the DocMan install directory for a bad database password or hostname.
  4. Check that the service account has read/write access to the configured storage paths and log directory.
  5. Look in Windows Event ViewerWindows Logs → Application and filter by source DocMan for OS-level failures (missing DLL, permission denied, port already in use).

Browser shows "This site can't be reached" at https://localhost

  1. Check the tray icon color. If red, the API is stopped — restart it.
  2. If the icon is green, check that nothing else is holding port 443: Get-NetTCPConnection -LocalPort 443.
  3. If the certificate is expired or untrusted, you will see a warning rather than a connection failure — that is expected with the self-signed default cert. Proceed past the warning or install a proper certificate.

OCR jobs are piling up

  1. Confirm the OCR Worker service is running.
  2. Open ocr.log. Look for Tesseract errors, missing language packs, or out-of-memory messages.
  3. If the queue is simply backlogged, increase the Max Workers setting in Configuration.

Watch folder not importing files

  1. Confirm the Watch Folder Monitor service is running.
  2. Open watcher.log. Permission-denied errors on the source path are the most common cause.
  3. Verify the DocMan service account has read + delete permission on the source path (files are moved, not copied).
  4. For UNC paths, make sure the service account is a domain account with network access to the share.

AI Watch Folder is not processing

  1. Confirm the AI Worker service is running.
  2. Open ai.log. Look for connection errors to Ollama or the cloud provider.
  3. If using Ollama, run ollama list on the Ollama host to confirm the model is present.
  4. Verify the AI connection's URL and model name in Administration → AI Connections match reality.

Tray Manager icon is gray

  1. Right-click the icon and choose Exit, then relaunch the Tray Manager as administrator.
  2. If the icon is still gray, open services.msc and confirm the DocMan services are actually installed. If they are not, re-run the installer.

Uninstalling or Reinstalling Services

You should not need to manually register or unregister services — the installer handles this. If you need to fully remove DocMan services (for example, to upgrade a corrupted installation), run the official uninstaller from Settings → Apps in Windows and then reinstall.

Manually removing a service with sc.exe delete is not recommended. It leaves configuration, log directories, and database connections in an inconsistent state. Always use the installer.


Back to: Documentation Overview • Related: Configuration, Watch Folders, AI Watch Folders

☕ Buy Me a Coffee