Skip to content

Self-Host OneQuery

Self-hosting keeps the OneQuery gateway under your control while still giving developers and agents a single access path. This page covers deployment concerns; use Choose Server Path for local lifecycle commands.

Treat the gateway as infrastructure, not a developer helper script. Decide who owns:

  • Runtime configuration.
  • Secret rotation.
  • Process restarts.
  • Log review.
  • Upgrade timing.

Run foreground mode under your process manager when you need supervised restarts:

Terminal window
onequery gateway

Keep the OneQuery home directory and runtime state on persistent storage. Back it up before upgrades and credential rotations.

Terminal window
onequery config set api.server_url https://onequery.example.com
onequery auth login

Document the server URL for operators and agents that should use the shared gateway instead of a local one.

  • Put the gateway behind your normal TLS, identity, and network controls.
  • Put provider credentials in the OneQuery source configuration path, not agent environment variables.
  • Monitor startup, runtime logs, and source connection failures.
  • Document the server URL and approved source identifiers for operators.
  • Test backup restore before depending on self-hosted state.

See the repository self-hosting guide for deeper runtime, storage, proxy, backup, and upgrade details.