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

# Redshift

> Connect your Amazon Redshift data warehouse to Basedash

Connect your Amazon Redshift data warehouse to Basedash to analyze and visualize your data. Basedash connects directly and queries your data in place.

## Prerequisites

* An Amazon Redshift cluster or Redshift Serverless workgroup
* A database user with appropriate access
* The cluster endpoint, port, and database name

## Connection setup

1. From your Basedash dashboard, click "Add Data Source"
2. Select "Redshift" as your data warehouse
3. Enter your connection details:
   * Database name
   * Username
   * Password
   * Host (the cluster endpoint, without the port and database)
   * Port (default: 5439)
   * SSL (recommended)
4. Click "Test Connection" to verify
5. Save your connection

### SSH tunnel

If your cluster is in a private subnet, connect through a bastion host:

1. Follow the connection steps above
2. Enable "Connect via SSH" option
3. Add our IP (`24.199.77.73`) to your allowlist
4. Provide SSH connection details:
   * SSH host
   * SSH username
   * Set "Authentication method" to "Private key" (recommended) and upload your SSH private key. Password authentication is also supported.
5. Test and save the connection

## Required permissions

Create a dedicated user for Basedash with read access to the schemas you want to analyze:

```sql theme={"dark"}
CREATE USER basedash PASSWORD '<strong-password>';
GRANT USAGE ON SCHEMA analytics TO basedash;
GRANT SELECT ON ALL TABLES IN SCHEMA analytics TO basedash;
ALTER DEFAULT PRIVILEGES IN SCHEMA analytics GRANT SELECT ON TABLES TO basedash;
```

## Best practices

* Use a read-only user for Basedash
* Enable SSL for secure connections
* Use workload management (WLM) queues to isolate Basedash queries
* Regularly rotate database credentials

## Troubleshooting

* Verify the cluster is publicly accessible, or connect through an SSH tunnel
* Check that the cluster's security group allows inbound connections from the Basedash IP (`24.199.77.73`)
* Confirm the user has `USAGE` on each schema and `SELECT` on its tables

## Next steps: Add custom context

You can add custom context to help the AI better understand your data structure and business logic. Consider adding context at the database or schema level if you notice the AI struggling to locate or understand specific data.

### When to add context

* **Complex transformed data**: When the AI needs help understanding data transformation logic
* **Business-specific metrics**: If calculated fields or KPIs need additional explanation
* **Unclear naming conventions**: When table or column names don't clearly indicate their purpose

For detailed guidance, see our [custom context documentation](/docs/features/custom-context).
