Skip to content

설치

Ollama를 설치하려면 다음 명령을 실행하세요:

shell
curl -fsSL https://ollama.com/install.sh | sh

수동 설치

참고

이전 버전에서 업그레이드하는 경우 먼저 sudo rm -rf /usr/lib/ollama 명령으로 기존 라이브러리를 제거해야 합니다.

패키지를 다운로드하고 압축을 해제하세요:

shell
curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \
    | sudo tar x -C /usr

Ollama를 시작하세요:

shell
ollama serve

다른 터미널에서 Ollama가 정상 실행되는지 확인하세요:

shell
ollama -v

AMD GPU 설치

AMD GPU를 사용하는 경우 추가 ROCm 패키지도 다운로드하고 압축을 해제하세요:

shell
curl -fsSL https://ollama.com/download/ollama-linux-amd64-rocm.tar.zst \
    | sudo tar x -C /usr

ARM64 설치

ARM64 전용 패키지를 다운로드하고 압축을 해제하세요:

shell
curl -fsSL https://ollama.com/download/ollama-linux-arm64.tar.zst \
    | sudo tar x -C /usr

Ollama를 부팅 서비스로 등록하기 (권장)

Ollama용 사용자와 그룹을 생성하세요:

shell
sudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
sudo usermod -a -G ollama $(whoami)

/etc/systemd/system/ollama.service 경로에 서비스 파일을 생성하세요:

ini
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=$PATH"

[Install]
WantedBy=multi-user.target

그 다음 서비스를 시작하세요:

shell
sudo systemctl daemon-reload
sudo systemctl enable ollama

CUDA 드라이버 설치 (선택 사항)

다운로드 및 설치 CUDA.

다음 명령을 실행해 드라이버가 설치되었는지 확인하세요. 이 명령은 GPU에 대한 상세 정보를 출력합니다:

shell
nvidia-smi

AMD ROCm 드라이버 설치 (선택 사항)

다운로드 및 설치 ROCm v7.

Ollama 시작

Ollama를 시작하고 정상 실행되는지 확인하세요:

shell
sudo systemctl start ollama
sudo systemctl status ollama

참고

AMD가 공식 리눅스 커널 소스에 amdgpu 드라이버를 업스트림에 기여했지만, 버전이 오래되어 모든 ROCm 기능을 지원하지 않을 수 있습니다. Radeon GPU에 대한 최상의 지원을 위해 https://www.amd.com/en/support/linux-drivers 에서 최신 드라이버를 설치하는 것을 권장합니다.

사용자 지정

Ollama 설치를 사용자 지정하려면 다음 명령으로 systemd 서비스 파일이나 환경 변수를 편집할 수 있습니다:

shell
sudo systemctl edit ollama

또는 /etc/systemd/system/ollama.service.d/override.conf 경로에 수동으로 오버라이드 파일을 생성할 수도 있습니다:

ini
[Service]
Environment="OLLAMA_DEBUG=1"

업데이트

다시 설치 스크립트를 실행해 Ollama를 업데이트하세요:

shell
curl -fsSL https://ollama.com/install.sh | sh

또는 Ollama를 다시 다운로드해 업데이트할 수도 있습니다:

shell
curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \
    | sudo tar x -C /usr

특정 버전 설치

OLLAMA_VERSION 환경 변수를 설치 스크립트와 함께 사용해 프리릴리즈 버전을 포함한 특정 버전의 Ollama를 설치할 수 있습니다. 버전 번호는 릴리스 페이지에서 확인할 수 있습니다.

예시:

shell
curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.5.7 sh

로그 확인

부팅 서비스로 실행 중인 Ollama의 로그를 확인하려면 다음 명령을 실행하세요:

shell
journalctl -e -u ollama

제거

ollama 서비스를 제거하세요:

shell
sudo systemctl stop ollama
sudo systemctl disable ollama
sudo rm /etc/systemd/system/ollama.service

ollama 라이브러리를 lib 디렉터리(/usr/local/lib, /usr/lib, /lib 중 하나)에서 제거하세요:

shell
sudo rm -r $(which ollama | tr 'bin' 'lib')

ollama 바이너리를 bin 디렉터리(/usr/local/bin, /usr/bin, /bin 중 하나)에서 제거하세요:

shell
sudo rm $(which ollama)

다운로드한 모델과 Ollama 서비스 사용자 및 그룹을 제거하세요:

shell
sudo userdel ollama
sudo groupdel ollama
sudo rm -r /usr/share/ollama