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

# Enable External Database Connection

> Automatically create database roles in the application to enable secure access to base data from external applications

<img src="https://mintcdn.com/teablecn/1xqYWjz_9sL5LR8T/images/selfhosted/database-connection/2026-05-29-database-connection-overview-en.png?fit=max&auto=format&n=1xqYWjz_9sL5LR8T&q=85&s=b3c24f1cc60c7de9b2b16e405e232d57" alt="External database connection overview" className="docs-screenshot" width="2136" height="496" data-path="images/selfhosted/database-connection/2026-05-29-database-connection-overview-en.png" />

To enable this feature, you need to configure the additional environment variable `PUBLIC_DATABASE_PROXY`

Configure this parameter with an externally accessible database IP or domain name + port number. If you're using the docker-compose deployment method mentioned earlier, the external access port is 42345. For other deployment methods, please configure according to your specific setup.

```
PUBLIC_DATABASE_PROXY=db-proxy.example.com:port
```

## More Environment Variables

[Environment Variables](/en/deploy/env)
