This content applies to a previous version of CARTO
In October 2021 we released a new version of our platform. You can find the latest documentation at docs.carto.com
Accessing Your CARTO Database from External Applications
Introduction
The Direct SQL Connection feature permits Enterprise users to connect directly to their CARTO PostgreSQL database. This enables access and modification of data from external applications supporting PostgreSQL, including GIS tools like QGIS, business intelligence platforms such as Tableau or Power BI, and data analytics systems like Databricks.
Configuration
Navigate to your CARTO account Settings by clicking your icon in the dashboard’s top right corner, then select Connections.
IP Address Setup
To connect externally, provide:
- The IP address of your connecting computer
- Optionally, a client certificate for enhanced security
For desktop applications (QGIS, Tableau Desktop), enter the computer’s IP address. For server connections, provide the server IP address.
You may:
- Enter multiple IP addresses
- Use CIDR notation with masks
- Enter
0.0.0.0to allow access from any computer - Click “Get your IP address” for automatic population
Certificate Generation
After entering at least one IP address, you can generate a certificate for client validation, providing an additional authentication layer.
Steps:
- Click
NEW CERTIFICATE - Enter a name to identify your certificate
- Create multiple certificates as needed (one per connecting computer is recommended)
- Download your certificate from the modal dialog
The Certificate
The downloaded ZIP file contains:
- readme.txt - File contents documentation
- client.crt - Certificate file for server validation
- client.key - Private key in RSA PEM format
- client.key.pk8 - Private key in DER PKCS #8 format
- server_ca.pem - CARTO server root certificate
Both private key formats are provided because some client applications support only one of the two formats. ODBC connections require RSA PEM format; JDBC connections require DER PKCS #8 format.
Connecting to CARTO
Server Selection
Choose based on database location:
- United States:
dbconn-gusc.carto.com - Europe:
dbconn-geuw.carto.com
Check your user profile settings to confirm database location, or consult the readme.txt file in your certificate download.
SSL Connection Modes
Three SSL modes are available:
- require
- verify-ca
- verify-full (recommended for validating both client and server identities, including hostname)
Authentication
Use a CARTO API key as your password. The key determines accessible operations and tables.
Generate specific API keys rather than using your Master API Key, which provides unrestricted access to your database. See the Developer Center for detailed API key generation instructions.
