# Instalación de InfluxDB 2.7 con Docker Compose

1. **Instalar Docker Desktop (si no está instalado)**
2. **Prepara una carpeta de trabajo**
   * Crea una carpeta sencilla en cualquier espacio que consideres oportuno, por ejemplo:\
     `C:\Users\TU_USUARIO\Desktop\docker\influxdb2`
3. Crea el archivo **`docker-compose.yml`**
   * Copia este contenido en un archivo llamado `docker-compose.yml` dentro de esa carpeta:

{% code title="text" overflow="wrap" %}

```
version: '3.8'

services:
  influxdb2:
    image: influxdb:2.7
    container_name: influxdb2
    restart: unless-stopped
    ports:
      - "8086:8086"
    volumes:
      - influxdb2-data:/var/lib/influxdb2
      - influxdb2-config:/etc/influxdb2
    environment:
      - DOCKER_INFLUXDB_INIT_MODE=setup
      - DOCKER_INFLUXDB_INIT_USERNAME=admin
      - DOCKER_INFLUXDB_INIT_PASSWORD=admin123
      - DOCKER_INFLUXDB_INIT_ORG=imagina
      - DOCKER_INFLUXDB_INIT_BUCKET=mi_bucket
      - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=mi_token_admin

volumes:
  influxdb2-data:
  influxdb2-config:

```

{% endcode %}

4. Levanta el servicio

   Abre una terminal (PowerShell o CMD) en la carpeta y ejecuta:

{% code title="Shell" overflow="wrap" %}

```sh
docker compose up -d
```

{% endcode %}

5. Accede a la interfaz web

Abre tu navegador y entra en: [`http://localhost:8086`](http://localhost:8086/)\
Aquí tendrás la interfaz web de InfluxDB 2.x lista para usar.

Usuario y contraseña configurado: `admin` / `admin123`

<figure><img src="/files/HOJVkVBgNmFgpJqG8Hys" alt=""><figcaption><p>Inicio de sesión InfluxDB 2.7</p></figcaption></figure>

<figure><img src="/files/9TGg9liQJNlhMeoQukZD" alt=""><figcaption><p>Pantalla principal InfluxDB 2.7</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://darioaplicano.gitbook.io/influxdb2.x/instalacion-y-configuracion-inicial/2.-influxdb/instalacion-de-influxdb-2.7-con-docker-compose.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
