> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/on-premises/it/per-iniziare/requirements/setup-docker.md).

# Configura Docker

Overleaf funziona su Docker. È necessario installare:

* Docker Engine (Docker CE)
* Docker Compose **plugin** (`docker compose`, v2)

Questi passaggi sono destinati a una recente Ubuntu LTS (20.04/22.04/24.04).

{% hint style="warning" %}
Evita di installare `docker.io` dal repository apt predefinito di Ubuntu.\
Usa il repository ufficiale di Docker così ottieni una versione recente di Docker e il `docker compose` plugin.
{% endhint %}

Il documento ufficiale proviene da: <https://docs.docker.com/engine/install/ubuntu/>.

{% stepper %}
{% step %}

### 1) Rimuovi i pacchetti vecchi/in conflitto (se presenti)

Se Docker era stato precedentemente installato da un'altra fonte, rimuovilo prima:

{% 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 %}

Questo comando è sicuro se alcuni pacchetti non sono installati.
{% endstep %}

{% step %}

### 2) Aggiungi il repository apt ufficiale di Docker

Installa i prerequisiti:

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

Aggiungi la chiave GPG di 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 %}

Aggiungi il repository:

{% code overflow="wrap" %}

```bash
# Add the repository to Apt sources:
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) Installa Docker Engine + il plugin Compose

Installa Docker e il plugin Compose:

{% code overflow="wrap" %}

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

{% endcode %}

Avvia Docker all'avvio:

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

{% endstep %}

{% step %}

### 4) Verifica l'installazione

Questi comandi dovrebbero essere eseguiti senza errori:

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

{% endstep %}

{% step %}

### 5) (Opzionale) Esegui Docker senza sudo

Aggiungi il tuo utente al `docker` gruppo:

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

Poi **esci e rientra**, oppure esegui:

```bash
newgrp docker
```

Ora questo dovrebbe funzionare senza `sudo`:

```bash
docker ps
```

{% hint style="danger" %}
Il `docker` il gruppo ha accesso equivalente a root sull'host.\
Questo è previsto per le installazioni tipiche di Overleaf, ed è particolarmente rilevante se abiliti le compilazioni in sandbox.
{% endhint %}
{% endstep %}
{% endstepper %}

### Passaggio successivo

Una volta che Docker funziona, continua con i passaggi di installazione del Toolkit in [Utilizzo del Toolkit](/on-premises/it/installazione/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://overleaf-pro.ayaka.space/on-premises/it/per-iniziare/requirements/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.
