Enable Google Basemaps
This documentation is for the CARTO Self-Hosted Legacy Version. Use only if you've installed this specific version. Explore our latest documentation for updated features.
CARTO Self-hosted can be configured to use Google Basemaps in the builder, allowing you to choose between different Basemap styles provided by Google. All you need is a Google Maps API key and a few simple configuration steps.

Generate Google Maps API key
The CARTO Self-hosted deployment needs a Google Maps API key with the Google Maps JavaScript API enabled in order to use Google Basemaps from Builder. If you also want the Photorealistic 3D Tiles basemap, the Map Tiles API must be enabled on the same key. You can follow these steps to generate a new key:
Enable the Google Maps JavaScript API:
In the Google Cloud Console, navigate to the APIs & Services section and go to the Library tab
Click on the Enable APIs & Services button
Search for Google Maps JavaScript API and enable it. This API powers all 2D Google Basemaps (Roadmap, Satellite, Hybrid, Terrain, and the Google Maps versions of Positron, Voyager, and Dark Matter).
(Optional) Search for Map Tiles API and enable it only if you want the Photorealistic 3D Tiles basemap. Without it, the 3D Tiles option will fail to load in Builder; all other basemaps work without it.

Create Credentials:
After enabling the APIs, navigate to Credentials tab
Click on Create Credentials and pick API key. Your new API key should appear as soon as it's generated!

Copy Your API Key: This is the API Key that the CARTO Selfhosted instance will use to load the different Google Basemaps in Builder.
Already using Google Basemaps? If you previously configured a Google Maps API key that only has the Google Maps JavaScript API enabled, the Photorealistic 3D Tiles basemap will not work with it. You must additionally enable the Map Tiles API on the same key (or generate a new key with both APIs enabled and update your configuration).
Ensure the security of your API key by applying a restrictive usage policy. After setting up your API key, consider configuring key restrictions such as restricting it to the Google Maps JavaScript API (and the Map Tiles API, if you enabled it for 3D Tiles), and limiting its usage to your domain.
Single VM deployments (Docker Compose)
To enable Google Maps basemaps within CARTO Self Hosted, you need to have a Google Maps API key with the Maps JavaScript API enabled (plus the Map Tiles API if you want the Photorealistic 3D Tiles basemap), and set it via GOOGLE_MAPS_API_KEY in your customer.env file.
Last updated
Was this helpful?
