# Enable Google Basemaps (Helm)

{% hint style="info" %}
This documentation only applies to **advanced Orchestrated container deployments** using **Kubernetes** and **Helm**
{% endhint %}

CARTO Self-hosted can be configured to use [Google Basemaps](https://docs.carto.com/carto-user-manual/maps/basemaps#google-maps) 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.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-0805052cb6268dba15f1a7b7ad7a4fdf77965182%2FCapture-2023-10-04-115526.png?alt=media" alt=""><figcaption></figcaption></figure>

## Generate Google Maps API key

The CARTO Self-hosted deployment needs a [Google Maps Javascript](https://developers.google.com/maps/documentation/javascript) API key in order to use Google Basemaps from Builder. You can follow these steps to generate a new key:

1. **Enable Google Maps JavaScript API:**
   * In the [Google Cloud Console](https://console.cloud.google.com/), 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

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-5068a6ac697c65eabb919579164ac242e01213b1%2FScreenshot%202023-10-04%20at%2012.10.25.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

2. **Create Credentials:**

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

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-5e3d2e46c03a17ad5a33cc7317a2d794179ec25b%2FCapture-2023-10-04-121552.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

3. **Copy Your API Key:** This is the API Key that the CARTO Selfhosted instance will use to load the different Google Basemaps in Builder.

{% hint style="danger" %}
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 be used just for the Google Maps Javascript API or to enable the usage from your domain.
{% endhint %}

## **Setup**

In order to enable Google Maps basemaps inside CARTO Self Hosted, you need to own a Google Maps API key and add one of the options below to your customizations file.

* **Option 1: Automatically create the secret**

Automatically create a secret based on the plain text value specified in your <mark style="color:orange;">customizations.yaml</mark> file.

```
appSecrets:
  googleMapsApiKey:
    value: "<REDACTED>"
```

* **Option 2: Manually create a secret:**

Create a secret running the command below, after replacing the `<REDACTED>` values with your key values:

```bash
kubectl create secret generic \
  [-n my-namespace] \
  mycarto-google-maps-api-key \
  --from-literal=googleMapsApiKey=<REDACTED>
```

Add the following lines to your <mark style="color:orange;">customizations.yaml</mark>, without replacing any value:

```
appSecrets:
  googleMapsApiKey:
    existingSecret:
      name: mycarto-google-maps-api-key
      key: googleMapsApiKey
```
