> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-for-developers/quickstart/hosting-your-first-application.md).

# Hosting your first application

Deploy a one-file application to CARTO and open it with your CARTO login

{% hint style="info" %}
**Private Preview:** Hosted Apps is available to selected accounts during its Private Preview. To request access, contact your CARTO representative.
{% endhint %}

In this quick start guide, you will deploy your first application with [Hosted Apps](/carto-for-developers/key-concepts/hosting-your-application.md): a single HTML file with a map of retail stores, which CARTO serves behind your organization's login.

## Install the CARTO CLI

Install the [CARTO CLI](/carto-for-agents/cli/installation.md), version 0.12.0 or later, and log in:

```bash
carto auth login
```

## Create the application

Create a folder named `my-first-app`, with a file named `index.html` inside:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>My first hosted app</title>
    <script src="https://unpkg.com/deck.gl@^9.1.0/dist.min.js"></script>
    <script src="https://unpkg.com/@deck.gl/carto@^9.1.0/dist.min.js"></script>
    <script src="https://unpkg.com/maplibre-gl@^4.0.0/dist/maplibre-gl.js"></script>
    <link href="https://unpkg.com/maplibre-gl@^4.0.0/dist/maplibre-gl.css" rel="stylesheet" />
    <style>
      body { margin: 0; }
      #map { position: absolute; inset: 0; }
    </style>
  </head>
  <body>
    <div id="map"></div>
    <script>
      fetch('./carto-info.json', { cache: 'no-store' })
        .then((response) => response.json())
        .then(({ apiBaseUrl, accessToken }) => {
          const stores = deck.carto.vectorTableSource({
            apiBaseUrl,
            accessToken,
            connectionName: 'carto_dw',
            tableName: 'carto-demo-data.demo_tables.retail_stores'
          });

          new deck.DeckGL({
            container: 'map',
            mapStyle: deck.carto.BASEMAP.POSITRON,
            initialViewState: { latitude: 39.8, longitude: -98.6, zoom: 4 },
            controller: true,
            layers: [
              new deck.carto.VectorTileLayer({
                id: 'stores',
                data: stores,
                pointRadiusMinPixels: 3,
                getFillColor: [200, 0, 80]
              })
            ]
          });
        });
    </script>
  </body>
</html>
```

The application reads the credentials of the user who opens it from `carto-info.json`, a file that CARTO serves next to it, and uses them to show a table from the [CARTO Data Warehouse](/carto-user-manual/connections/carto-data-warehouse.md). There is no token in the code.

## Deploy it

```bash
carto app deploy my-first-app --name "My first app"
```

The CLI uploads the folder and prints the URL of your application, ending in `/app/my-first-app/`. Open it in your browser: CARTO asks you to log in if you aren't already, and the map shows the retail stores, loaded with your own credentials.

## Share it

New applications are private. To share yours with everyone in your organization, run:

```bash
carto app share my-first-app --org
```

They can now open the same URL and log in with their CARTO account.

## What's next?

* [Hosting your application in CARTO](/carto-for-developers/guides/build-a-hosted-application.md) builds a complete application with Vite, including local development, Named Sources and versions.
* [Hosted Apps](/carto-for-developers/key-concepts/hosting-your-application.md) in Key concepts explains how hosting works and when to use it.
* The [Hosted Apps reference](/carto-for-developers/reference/hosted-apps.md) describes everything CARTO reads, serves and enforces.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.carto.com/carto-for-developers/quickstart/hosting-your-first-application.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
