> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vigilos.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Database Connections

> Connect Vigilos to your databases to enable AI-powered analytics on your live data.

## Supported Databases

| Database            | Status    | Default Port  |
| ------------------- | --------- | ------------- |
| **ClickHouse**      | Available | 8443          |
| **PostgreSQL**      | Available | 5432          |
| **Snowflake**       | Available | Account-based |
| **Amazon Redshift** | Available | 5439          |
| **Google BigQuery** | Available | Account-based |

## Creating a Connection

<Steps>
  <Step title="Navigate to Connections">
    Open the sidebar and click **Connections** under the Data section. Click the **New Connection** button.
  </Step>

  <Step title="Select the database type">
    Choose your database type from the dropdown: PostgreSQL, ClickHouse, Snowflake, Redshift, or BigQuery.
  </Step>

  <Step title="Enter connection details">
    Fill in the connection form:

    | Field                | Description                                                          |
    | -------------------- | -------------------------------------------------------------------- |
    | **Name**             | A friendly label for this connection (e.g., "Production ClickHouse") |
    | **Host**             | Database hostname or IP address                                      |
    | **Port**             | Database port (pre-filled with the default for your selected type)   |
    | **Database**         | Name of the database to connect to                                   |
    | **Username**         | A database user with read access                                     |
    | **Password**         | The password for the database user                                   |
    | **Secure (SSL/TLS)** | Toggle to enable encrypted connections to your database              |
  </Step>

  <Step title="Test the connection">
    Click **Test Connection** to verify that Vigilos can reach your database. See the next section for status indicators.
  </Step>

  <Step title="Save the connection">
    Click **Save**. Your credentials are encrypted with AES-256 before being written to storage.
  </Step>
</Steps>

## Testing Connections

The **Test Connection** button sends a lightweight query to your database to verify connectivity and authentication. After testing, the connection shows one of the following status indicators:

| Status       | Meaning                                                                      |
| ------------ | ---------------------------------------------------------------------------- |
| **Active**   | Connection is working and ready to use                                       |
| **Testing**  | A connection test is currently in progress                                   |
| **Error**    | The test failed - check your hostname, port, credentials, and network access |
| **Inactive** | Connection has been disabled or has not been tested yet                      |

<Warning>
  If you see an **Error** status, verify the following:

  * The hostname and port are correct
  * The database user and password are valid
  * Your database is reachable from the internet (or from Vigilos's network if using a private connection)
  * The specified database name exists
  * SSL/TLS settings match your database's configuration
</Warning>

## Security

Vigilos takes connection security seriously:

* **AES-256 encryption** - credentials are encrypted immediately upon submission, before they are stored. No plaintext credentials exist in the database at any point.
* **Encrypted at rest** - the encrypted credentials are stored with disk-level encryption.
* **No credential exposure** - connection passwords are never returned in API responses or displayed in the UI after creation. You can update them but never view them.

<Note>
  Even Vigilos platform administrators cannot view your plaintext database credentials. The encryption keys are managed separately from the application database.
</Note>

## Network Requirements

Your database must be reachable from Vigilos's infrastructure for queries to execute. Depending on your setup:

<AccordionGroup>
  <Accordion title="Public databases">
    If your database has a public hostname or IP address, no additional configuration is needed. Ensure that your firewall allows inbound connections on the database port from Vigilos's IP range.
  </Accordion>

  <Accordion title="Private networks">
    For databases behind a VPN or private network, you may need to set up a secure tunnel or allowlist Vigilos's IP addresses. Contact support for the current IP range.
  </Accordion>

  <Accordion title="SSL/TLS recommendations">
    We strongly recommend enabling the **Secure** toggle for all connections. This encrypts data in transit between Vigilos and your database, preventing interception of query data and results.

    Most cloud-hosted databases (AWS RDS, GCP Cloud SQL, ClickHouse Cloud) support SSL/TLS out of the box.
  </Accordion>
</AccordionGroup>
