Documentation

Installation guides, configuration reference and supported databases.

Quick start

Get QueryAstra running in under 5 minutes.

  • 1
    Download the installer

    Go to the download page, enter your license key, and download the installer for your OS. QueryAstra supports Windows, Linux and macOS.

  • 2
    Install and launch

    Run the installer and follow the on-screen steps. On first launch, paste your license key when prompted.

  • 3
    Add a database instance

    Click Add Instance, choose your engine, and fill in host, port and credentials. A read-only user is sufficient for monitoring.

  • 4
    Start monitoring

    QueryAstra connects and displays real-time metrics immediately. No agent is installed on the database server — everything runs from a single binary on your machine.

Full installation guide →

Installation

System requirements

🪟 Windows 10 / 11 (64-bit)
🐧 Ubuntu 20.04+ / RHEL 8+
🍎 macOS 12 Monterey+
🐍 Python ≥ 3.12 (backend)
💾 512 MB RAM minimum
🗄️ TimescaleDB (bundled)

The installer bundles the backend and TimescaleDB — no separate database server is required on the monitoring machine.

Windows

  1. 1
    Download the .exe installer

    From the download page, select Windows and download QueryAstra-Setup.exe.

  2. 2
    Run the installer

    Double-click the file. If Windows SmartScreen appears, click More info → Run anyway. Accept the license and choose an install directory.

  3. 3
    Launch QueryAstra

    Find QueryAstra in the Start menu. On first run, enter your license key. The backend starts automatically as a Windows service.

Note: SQL Server monitoring requires the Microsoft ODBC Driver 17 or 18 for SQL Server. The installer will prompt you if it is missing.

Linux

Use the provided .deb (Ubuntu/Debian) or .rpm (RHEL/CentOS/Fedora) package, or the universal .tar.gz archive.

Debian / Ubuntu:

sudo dpkg -i queryastra_*.deb
sudo systemctl enable --now queryastra

RHEL / CentOS / Fedora:

sudo rpm -ivh queryastra_*.rpm
sudo systemctl enable --now queryastra

Tarball (any distro):

tar -xzf queryastra_linux_amd64.tar.gz
cd queryastra
cp .env.example .env
# edit .env, then:
./start.sh
Note: pyodbc (SQL Server/DB2) requires unixODBC. Install with sudo apt install unixodbc or sudo yum install unixODBC.

macOS

Download the .dmg disk image from the download page.

  1. 1
    Open the .dmg

    Drag QueryAstra.app to your Applications folder.

  2. 2
    First launch

    Right-click the app and choose Open (required on first launch to bypass Gatekeeper). The backend starts in the background.

  3. 3
    Enter your license key

    Paste the key from your purchase email when the activation screen appears.

Manual / advanced install (backend only)

If you prefer to run the backend directly (e.g. in a Docker container or a server without a GUI):

# Requires Python 3.12
pip install queryastra-backend   # or install from source

cp .env.example .env
# Edit .env — set DATABASE_URL, CREDENTIAL_ENCRYPTION_KEY, JWT_SECRET_KEY at minimum

uvicorn app.main:app --host 0.0.0.0 --port 8124

The frontend (port 3001 by default) can then be served separately:

cd queryastra-frontend
npm install
npm run dev   # development
npm run build # production
Default ports: frontend on 3001, backend on 8124. Do not change these unless you also update CORS_ORIGINS and the frontend's API base URL.

Configuration reference

All configuration is read from environment variables (or a .env file in the backend directory). Copy .env.example to .env and fill in the required values before starting the backend.

Never commit your .env file. It contains secrets (CREDENTIAL_ENCRYPTION_KEY, JWT_SECRET_KEY) that must stay out of source control.
Variable Description Default
Database (application persistence)
DATABASE_URL TimescaleDB/PostgreSQL connection string for the application's own data (not the monitored instances). postgresql+asyncpg://queryastra:changeme@localhost:5432/queryastra Required
Core
API_V1_PREFIX URL prefix for all API v1 routes. /api/v1 Has default
CORS_ORIGINS JSON array of allowed CORS origins for the frontend. ["http://localhost:3001"] Has default
LOG_LEVEL Python log level: DEBUG, INFO, WARNING, ERROR. INFO Has default
ENVIRONMENT Runtime environment label (development or production). development Has default
Security & credentials
CREDENTIAL_ENCRYPTION_KEY Fernet key used to encrypt stored database credentials at rest. Generate with: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" — Required
CREDENTIAL_VAULT_BASE_URL Base URL of an external secrets vault for resolving encrypted_credential_ref references. Leave empty to use the built-in Fernet encryption. empty Optional
Authentication (JWT)
JWT_SECRET_KEY Secret used to sign JWT tokens. Generate with: python -c "import secrets; print(secrets.token_hex(32))" insecure default Required in prod
JWT_EXPIRE_HOURS How long a login session lasts (hours). 8 Has default
ADMIN_USERNAME Username for the built-in admin account created on first start. admin Has default
ADMIN_PASSWORD Password for the built-in admin account. Change this before exposing the app on a network. admin Change in prod
Metrics collection
POLLING_SUPERVISOR_ENABLED Enable the background polling supervisor that collects metrics from all active instances. Must be true in production. false Enable in prod
COLLECTION_QUERY_TIMEOUT_SECONDS Per-query timeout (seconds) for collection queries against monitored instances. 5.0 Has default
COLLECTION_MAX_ROWS Maximum rows fetched per collection query. 5000 Has default
BACKEND_EXECUTOR_MAX_WORKERS Thread pool size for blocking DB drivers (pymssql, pyodbc). Increase for many concurrent instances. 64 Has default
Optional supervisors (all default off)
MISSING_INDEX_SUPERVISOR_ENABLED Collect missing index suggestions once per day per instance. false Optional
DEADLOCK_SUPERVISOR_ENABLED Extract deadlock graphs from SQL Server Extended Events (system_health). false SQL Server only
BACKUP_STATUS_SUPERVISOR_ENABLED Check backup / archiving status once per day per instance. false Optional
ALERTING_WORKER_ENABLED Enable the alerting evaluation loop. Required for alert rules to fire. false Optional
REPORT_WORKER_ENABLED Enable the scheduled report worker (PDF generation and email delivery). false Optional
QUERY_STATS_SUPERVISOR_ENABLED Collect pg_stat_statements snapshots hourly for query trending (PostgreSQL only). false PostgreSQL only
EXTENDED_HEALTH_METRICS_SUPERVISOR_ENABLED Collect free space and replication metrics hourly. false Optional
PROBLEM_EVENTS_RETENTION_WORKER_ENABLED Purge resolved locks, transactions and deadlocks older than PROBLEM_EVENTS_RETENTION_DAYS. false Optional
Alert email (SMTP)
ALERT_SMTP_HOST SMTP server hostname. Leave empty to disable email alerts. empty Optional
ALERT_SMTP_PORT SMTP port (587 for STARTTLS, 465 for TLS). 587 Has default
ALERT_SMTP_USERNAME SMTP authentication username. empty Optional
ALERT_SMTP_PASSWORD SMTP authentication password. empty Optional
ALERT_SMTP_FROM Sender address for alert emails. empty Optional
ALERT_EMAIL_TO Comma-separated list of recipient addresses for alert emails. empty Optional
ALERT_WEBHOOK_URL HTTP endpoint to receive alert notifications (POST with JSON payload). Leave empty to disable. empty Optional
License validation
SUPABASE_URL Your Supabase project URL, used to verify license keys online. empty Optional
SUPABASE_SERVICE_KEY Supabase service-role key for license table reads. Never use the anon key here. empty Optional

Supported databases

QueryAstra monitors the following database engines. All collection is read-only — no agent or extension is installed on the monitored server.

🐘 PostgreSQL
v12 and later
asyncpg
🪟 SQL Server
2016 SP1 and later
pymssql / pyodbc
🐬 MySQL
8.0 and later
aiomysql
🔶 Oracle
19c and later
oracledb (Thin)
🔷 IBM Db2
11.5 and later
ibm_db
MariaDB: Supported via the MySQL driver. MariaDB 10.6+ is recommended. Some SQL Server-specific panels (deadlocks, plan history) are not available for MySQL/MariaDB.

Connection parameters

When adding an instance in QueryAstra, provide:

  • Host — hostname or IP address of the database server
  • Port — default varies by engine (PostgreSQL: 5432, SQL Server: 1433, MySQL: 3306, Oracle: 1521, Db2: 50000)
  • Database — database / catalog name (SQL Server: master works for server-level metrics)
  • Username / Password — monitoring user credentials

Required DB permissions

QueryAstra only reads system views and catalogs — it never writes to the monitored database. Create a dedicated read-only user with the minimum grants below.

PostgreSQL

CREATE USER queryastra_monitor WITH PASSWORD 'strong_password';

-- Core monitoring
GRANT pg_monitor TO queryastra_monitor;
GRANT CONNECT ON DATABASE your_db TO queryastra_monitor;

-- Query stats (optional, required for query trending)
GRANT EXECUTE ON FUNCTION pg_stat_statements_reset() TO queryastra_monitor;
pg_stat_statements must be loaded in postgresql.conf (shared_preload_libraries = 'pg_stat_statements') to enable query statistics collection.

SQL Server

CREATE LOGIN queryastra_monitor WITH PASSWORD = 'StrongPassword123!';
CREATE USER  queryastra_monitor FOR LOGIN queryastra_monitor;

-- Required for most monitoring panels
GRANT VIEW SERVER STATE TO queryastra_monitor;
GRANT VIEW DATABASE STATE TO queryastra_monitor;

-- Required for deadlock extraction (DeadlockSupervisor)
GRANT ALTER ANY EVENT SESSION TO queryastra_monitor;

-- Required for plan history and compile-timeout panels
GRANT VIEW ANY DEFINITION TO queryastra_monitor;

MySQL / MariaDB

CREATE USER 'queryastra_monitor'@'%' IDENTIFIED BY 'strong_password';

GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'queryastra_monitor'@'%';
GRANT SELECT ON performance_schema.*  TO 'queryastra_monitor'@'%';
GRANT SELECT ON information_schema.*  TO 'queryastra_monitor'@'%';
GRANT SELECT ON sys.*                 TO 'queryastra_monitor'@'%';

FLUSH PRIVILEGES;

Oracle

CREATE USER queryastra_monitor IDENTIFIED BY "strong_password";

GRANT CREATE SESSION   TO queryastra_monitor;
GRANT SELECT ANY DICTIONARY TO queryastra_monitor;
GRANT SELECT ON v_$session   TO queryastra_monitor;
GRANT SELECT ON v_$sql       TO queryastra_monitor;
GRANT SELECT ON v_$sysstat   TO queryastra_monitor;
GRANT SELECT ON v_$waitstat  TO queryastra_monitor;

IBM Db2

-- Run as instance owner
GRANT DBADM ON DATABASE TO USER queryastra_monitor;
-- Or minimum grants:
GRANT CONNECT ON DATABASE TO USER queryastra_monitor;
GRANT SELECT ON SYSIBMADM.SNAPAPPL_INFO TO USER queryastra_monitor;
GRANT SELECT ON SYSIBMADM.MON_LOCKWAITS TO USER queryastra_monitor;
GRANT SELECT ON SYSIBMADM.SNAPDB        TO USER queryastra_monitor;

AI diagnostics (optional)

QueryAstra can show contextual recommendations for slow or high-cost queries using an AI model of your choice. Without configuration the Recommendations panel shows instructions on how to enable it — no error is displayed.

Anthropic Claude

AI_PROVIDER=anthropic
AI_API_KEY=sk-ant-...
# Optional: override model (default: claude-haiku-5-5)
AI_MODEL=claude-sonnet-5-5

OpenAI

AI_PROVIDER=openai
AI_API_KEY=sk-...
# Optional: override model (default: gpt-4o-mini)
AI_MODEL=gpt-4o

Azure OpenAI

AI_PROVIDER=openai
AI_API_KEY=your-azure-key
AI_BASE_URL=https://your-resource.openai.azure.com
AI_MODEL=gpt-4o

Ollama (self-hosted)

AI_PROVIDER=openai
AI_BASE_URL=http://localhost:11434
AI_MODEL=llama3
Privacy: Only the normalized query text, execution plan and relevant system metrics are sent to the AI provider — never actual row data from your databases.

Alerting

QueryAstra evaluates alert rules on a configurable interval and can notify you via email or webhook. Enable the alerting worker and configure at least one notification channel.

Minimum configuration to enable alerting:

ALERTING_WORKER_ENABLED=true
ALERTING_EVALUATION_INTERVAL_SECONDS=60   # default

# Email channel (all required if using email):
ALERT_SMTP_HOST=smtp.example.com
ALERT_SMTP_PORT=587
[email protected]
ALERT_SMTP_PASSWORD=your_smtp_password
[email protected]
[email protected],[email protected]

# Webhook channel (optional, works alongside email):
ALERT_WEBHOOK_URL=https://hooks.example.com/queryastra

Alert rules are created and managed through the QueryAstra UI under Alerts → Rules. Built-in rule types include: threshold-based metrics, blocking sessions, long-running transactions, replication lag, free space, and custom SQL expressions.

Plans & instance limits

Plan Monitored instances License key format
Free / Trial 1 instance — (no key required)
Pro 10 instances QAP-XXXX-XXXX-XXXX-XXXX
Team Unlimited QAT-XXXX-XXXX-XXXX-XXXX

Adding an instance beyond your plan limit returns a 402 response. Upgrade your plan or remove an existing instance to continue.

View plans →