> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/es/instalacion/setup-docker.md).

# Configurar Docker

Overleaf se ejecuta sobre Docker. Debes instalar:

* Motor de Docker (Docker CE)
* Complemento de Docker Compose (`docker compose`, v2)

Estos pasos están dirigidos a una versión reciente de Ubuntu LTS (20.04/22.04/24.04).

{% hint style="warning" %}
Evita instalar `docker.io` desde el repositorio apt predeterminado de Ubuntu.\
Usa el repositorio oficial de Docker para obtener una versión reciente de Docker y el `docker compose` complemento.
{% endhint %}

La documentación oficial proviene de: <https://docs.docker.com/engine/install/ubuntu/>.

{% stepper %}
{% step %}

### 1) Elimina paquetes antiguos/en conflicto (si están presentes)

Si Docker se instaló previamente desde otra fuente, elimínalo primero:

{% code overflow="wrap" %}

```bash
sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc podman-docker containerd runc | cut -f1)
```

{% endcode %}

Este comando es seguro aunque algunos paquetes no estén instalados.
{% endstep %}

{% step %}

### 2) Añade el repositorio apt oficial de Docker

Instala los requisitos previos:

```bash
sudo apt update
sudo apt install -y ca-certificates curl
```

Añade la clave GPG de Docker:

{% code overflow="wrap" %}

```bash
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
```

{% endcode %}

Añade el repositorio:

{% code overflow="wrap" %}

```bash
# Añade el repositorio a las fuentes de Apt:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF

sudo apt update
```

{% endcode %}
{% endstep %}

{% step %}

### 3) Instala Docker Engine + el complemento Compose

Instala Docker y el complemento Compose:

{% code overflow="wrap" %}

```bash
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

{% endcode %}

Inicia Docker al arrancar:

```bash
sudo systemctl enable --now docker
```

{% endstep %}

{% step %}

### 4) Verifica la instalación

Estos comandos deberían ejecutarse sin errores:

```bash
docker --version
docker compose version
sudo docker run --rm hello-world
docker ps
```

{% endstep %}

{% step %}

### 5) (Opcional) Ejecutar Docker sin sudo

Añade tu usuario al `docker` grupo:

```bash
sudo usermod -aG docker $USER
```

Luego **cierra sesión y vuelve a iniciarla**, o ejecuta:

```bash
newgrp docker
```

Ahora esto debería funcionar sin `sudo`:

```bash
docker ps
```

{% hint style="danger" %}
El `docker` grupo tiene acceso equivalente al de root en el host.\
Esto es lo esperado en instalaciones típicas de Overleaf, y es especialmente relevante si habilitas las compilaciones aisladas (Sandboxed Compiles).
{% endhint %}
{% endstep %}
{% endstepper %}

### Siguiente paso

Cuando Docker funcione, continúa con los pasos de instalación del Toolkit en [Uso del Toolkit](/on-premises/es/instalacion/using-the-toolkit.md).


---

# 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 dynamically by asking a question.

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

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/es/instalacion/setup-docker.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
