Install and update the watcher
Install, reinstall, verify, and manually update the Data Hub watcher on an instrument PC across operating systems.
Install the watcher on an instrument PC, check that it works, and update it by hand. These docs describe watcher 1.4.0 and later. Admins control automatic updates for every PC at once; see Roll out watcher releases.
Prerequisites
- uv: recommended. It installs Python for you, so you don’t need to install Python separately.
- A personal access token starting with
dhub_. Admins create these at Settings → Access Tokens; members can’t create their own. See Issue and revoke tokens. - The watch folder and file patterns: the folder the instrument saves to, and which files in it to upload.
Install
Most lab instrument PCs run Windows, so install the windows-service extra by default. It adds pywin32, which the watcher needs for the Run as a Windows service setup:
uv tool install "data-hub-watcher[windows-service]"This installs the data-hub-watcher command in its own Python environment, managed by uv, so you can run it from any terminal.
On macOS or Linux, or on a PC where you’ll only run the watcher in a terminal window, leave out the extra:
uv tool install data-hub-watcherConfigure
data-hub-watcher initThe wizard asks for the environment, API key, instrument, watch folder, file patterns, run detection, stability period, and upload mode. New instruments start as pending until an admin confirms them; see Set up an instrument.
The wizard saves the config to ~/.data-hub/config.yaml and sends it to Data Hub. Configure run detection and uploads explains how to choose those settings, and Watcher configuration lists every field.
Verify
data-hub-watcher watch --dry-runThe dry run checks the config, checks that Data Hub is reachable and the instrument is active, and lists the files it would upload, without starting to watch.
Run
On a lab PC, run the watcher as a Windows service, so it starts when the PC starts, keeps running after you sign out, and updates itself. From an Administrator terminal:
data-hub-watcher service install
data-hub-watcher service startRun as a Windows service covers the commands to stop and restart it, where it writes logs, and what happens if it crashes.
For a one-off check, or on macOS or Linux, run the watcher in a terminal instead:
data-hub-watcher watchThe watcher watches the folder, waits for each file to stop changing, groups files into runs, uploads them in auto mode, and checks in with Data Hub every 60 seconds. Stop it with Ctrl+C in the terminal, or stop the service with data-hub-watcher service stop.
Reinstall
Reinstall the watcher if its install breaks, or if it’s missing the Windows service extra:
uv tool install --reinstall data-hub-watcher
# or with the Windows service extra:
uv tool install --reinstall "data-hub-watcher[windows-service]"If the watcher runs as a Windows service, then run data-hub-watcher service reinstall from an Administrator terminal, so the service and the upgrade Scheduled Task use the new install.
Change configuration later
data-hub-watcher config edit # re-prompt each field
data-hub-watcher config open # open the YAML in your editor
data-hub-watcher config show # print the current configThe watcher sends the changes to Data Hub. A running watcher keeps its old settings until it restarts; see Edits made on the PC.
Manual update (self-update)
Use self-update to update right away, or on a PC that doesn’t run the watcher as a service. Roll out watcher releases describes automatic updates.
data-hub-watcher self-update # check + upgrade if needed
data-hub-watcher self-update --check # report status only
data-hub-watcher self-update --force # re-run even if versions matchThe command asks Data Hub for the latest version and upgrades the way the watcher was installed:
| Install method | Upgrade flow |
|---|---|
Windows, with uv tool install | Hands the upgrade to the DataHubWatcherUpgrade Scheduled Task and returns once the task accepts it. The service restarts by itself. Follow ~/.data-hub/upgrade-worker.log for progress. |
macOS or Linux, with uv tool install | Runs uv tool install --reinstall for the latest version. Restart the watcher afterward. |
pip install into a Python environment | Runs pip install -U for the latest version. Restart the watcher afterward. |
A development checkout (editable install or uv sync) | Refused. Upgrade with git pull && uv sync. |
On Windows, when the watcher was installed with uv tool install, data-hub-watcher service install (or service reinstall) must have run once from an Administrator terminal, so the upgrade Scheduled Task exists.
Pin a specific version
uv tool install "data-hub-watcher[windows-service]==1.4.5"On macOS or Linux, leave out [windows-service]. Some features need a minimum watcher version, such as changing settings from the web app (1.4.0) or marking files Upload failed (1.4.5). Check What each version adds before you pin an older version.
Run data-hub-watcher self-update --check to see which version Data Hub offers. A pinned watcher still updates itself, at its next hourly check, once Data Hub offers a newer version than the pin. Admins choose that version for every PC, and roll it back, in Roll out watcher releases.
Send feedback and see what’s new
Report a bug or request a feature about Data Hub from the app or an AI assistant, follow the report’s status, and read the in-app changelog.
Run as a Windows service
Install and operate the Data Hub watcher as a Windows service so it starts on boot, survives logouts, and can auto-update in the background.