> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 0. Docker 설정

> Overleaf 배포를 위해 Ubuntu에 Docker Engine과 Compose 플러그인을 설치합니다.

Overleaf는 Docker에서 실행됩니다. 다음을 반드시 설치해야 합니다.

* Docker Engine (Docker CE)
* Docker Compose 플러그인 (`docker compose`, v2)

이 단계는 최신 Ubuntu LTS(20.04/22.04/24.04)를 대상으로 합니다.

> [!WARNING]
>
> Ubuntu 기본 apt 저장소에서 `docker.io`를 설치하지 마세요.\
> 최신 Docker 버전과 `docker compose` 플러그인을 사용하려면 Docker 공식 저장소를 사용하세요.

공식 문서 출처: [https://docs.docker.com/engine/install/ubuntu/](https://docs.docker.com/engine/install/ubuntu/).

**1. 1) 이전 패키지 또는 충돌하는 패키지 제거(있는 경우)**

이전에 다른 소스에서 Docker를 설치한 경우 먼저 제거하세요.

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

일부 패키지가 설치되어 있지 않아도 이 명령은 안전하게 실행됩니다.

**2. 2) Docker 공식 apt 저장소 추가**

사전 요구 패키지를 설치합니다.

```bash theme={null}
sudo apt update
sudo apt install -y ca-certificates curl
```

Docker GPG 키를 추가합니다.

```bash wrap theme={null}
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
```

저장소를 추가합니다.

```bash wrap theme={null}
# 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
```

**3. 3) Docker Engine + Compose 플러그인 설치**

Docker와 Compose 플러그인을 설치합니다.

```bash wrap theme={null}
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

부팅 시 Docker가 시작되도록 설정합니다.

```bash theme={null}
sudo systemctl enable --now docker
```

**4. 4) 설치 확인**

다음 명령이 오류 없이 실행되어야 합니다.

```bash theme={null}
docker --version
docker compose version
sudo docker run --rm hello-world
docker ps
```

**5. 5) (선택 사항) sudo 없이 Docker 실행**

사용자를 `docker` 그룹에 추가합니다.

```bash theme={null}
sudo usermod -aG docker $USER
```

그런 다음 **로그아웃 후 다시 로그인**하거나 다음을 실행합니다.

```bash theme={null}
newgrp docker
```

이제 `sudo` 없이도 다음 명령이 작동해야 합니다.

```bash theme={null}
docker ps
```

> [!CAUTION]
>
> `docker` 그룹은 호스트에서 root와 동등한 접근 권한을 가집니다.\
> 이는 일반적인 Overleaf 설치에서 예상되는 사항이며, Sandboxed Compiles를 활성화하는 경우 특히 중요합니다.

### 다음 단계

Docker가 작동하면 [1. Toolkit 다운로드](https://ayakaleaf-pro.mintlify.site/ko/on-premises/installation/using-the-toolkit/1.-download-the-toolkit.md)로 계속 진행하세요.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.