> 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/fi/asennus/setup-docker.md).

# Asenna Docker

Overleaf toimii Dockerin päällä. Sinun on asennettava:

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

Nämä vaiheet on suunnattu uudemmalle Ubuntu LTS -versiolle (20.04/22.04/24.04).

{% hint style="warning" %}
Vältä asentamasta `docker.io` Ubuntun oletusarvoisesta apt-varastosta.\
Käytä Dockerin virallista varastoa, jotta saat uudemman Docker-version ja `docker compose` laajennuksen.
{% endhint %}

Virallinen ohje tulee osoitteesta: <https://docs.docker.com/engine/install/ubuntu/>.

{% stepper %}
{% step %}

### 1) Poista vanhat/ristiriitaiset paketit (jos niitä on)

Jos Docker on aiemmin asennettu jostakin muusta lähteestä, poista se ensin:

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

Tämä komento on turvallinen, vaikka joitakin paketteja ei olisi asennettu.
{% endstep %}

{% step %}

### 2) Lisää Dockerin virallinen apt-varasto

Asenna edellytykset:

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

Lisää Dockerin GPG-avain:

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

Lisää varasto:

{% code overflow="wrap" %}

```bash
# Lisää varasto Apt-lähteisiin:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Tyypit: deb
URI:t: https://download.docker.com/linux/ubuntu
Versiot: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Komponentit: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF

sudo apt update
```

{% endcode %}
{% endstep %}

{% step %}

### 3) Asenna Docker Engine + Compose-laajennus

Asenna Docker ja Compose-laajennus:

{% code overflow="wrap" %}

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

{% endcode %}

Käynnistä Docker järjestelmän käynnistyessä:

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

{% endstep %}

{% step %}

### 4) Vahvista asennus

Näiden komentojen pitäisi toimia ilman virheitä:

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

{% endstep %}

{% step %}

### 5) (Valinnainen) Käytä Dockeria ilman sudoa

Lisää käyttäjäsi `docker` -ryhmään:

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

Sitten **kirjaudu ulos ja takaisin sisään**, tai suorita:

```bash
newgrp docker
```

Nyt tämän pitäisi toimia ilman `sudoa`:

```bash
docker ps
```

{% hint style="danger" %}
Ryhmällä `docker` on pääkäyttäjän tasoinen käyttöoikeus isännässä.\
Tämä on odotettua tavallisissa Overleaf-asennuksissa, ja erityisen tärkeää, jos otat käyttöön Sandboxed Compilesin.
{% endhint %}
{% endstep %}
{% endstepper %}

### Seuraava vaihe

Kun Docker toimii, jatka Toolkitin asennusvaiheisiin kohdassa [Toolkitin käyttäminen](/on-premises/fi/asennus/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/fi/asennus/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.
