|
Bài viết cuối cùng của webmaster vào 3-3-2025 15:30 đã được chỉnh sửa
Để cài đặt Deepseek trên 1 máy chủ/ máy cá nhân cần có: Ollama , Docker và WebUI
1. Ollama
- mkdir -p /opt/install/
- cd /opt/install/
- wget https://github.com/ollama/ollama/releases/download/v0.5.13-rc2/ollama-linux-amd64.tgz
- gunzip ollama-linux-amd64.tgz
- tar xvf ollama-linux-amd64.tar
- cp -rp bin/ollama /usr/bin/ollama
- ollama serve &
Sao chép mã Load the model fit your server / computer hardware (CPU/GPU)
- mkdir -p /opt/install/ollama-models
Sao chép mã Create a model file config for Ollama load and run
- cd /opt/install/ollama-models
- echo 'FROM ./deepseek-7b-chat.Q4_K_M.gguf
- PARAMETER num_ctx 2048
- PARAMETER num_threads 8' > Modelfile
Sao chép mã Load the model
- cd /opt/install/ollama-models
Sao chép mã Restart Ollama
- pkill ollama && ollama serve &
Sao chép mã
2. Docker
- # Install Docker
- sudo dnf install -y docker
- sudo systemctl start docker
- sudo systemctl enable docker
- # Install Docker Compose
- sudo curl -L "https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
- sudo chmod +x /usr/bin/docker-compose
- # Add your user to the docker group
- sudo usermod -aG docker $USER
- newgrp docker # Refresh group permissions
Sao chép mã
3. WebUI
- #Create a folder for the webchat
- mkdir -p /opt/install/webchat
- cd /opt/install/webchat
- create a file for docker: docker-compose.yml
Sao chép mã
- version: '3.8'
- services:
- open-webui:
- image: ghcr.io/open-webui/open-webui:main
- ports:
- - "0.0.0.0:3000:8080"
- environment:
- - OLLAMA_API_BASE_URL=http://127.0.0.1:11434
- volumes:
- - open-webui:/app/backend/data
- # For Linux hosts, add network_mode: "host" if issues persist
- volumes:
- open-webui:
Sao chép mã Start the web for chat with deepseek:
- docker-compose down && docker-compose up -d
Sao chép mã 4. Open the firewall policy for the services:
- sudo firewall-cmd --permanent --add-port=3000/tcp
- sudo firewall-cmd --permanent --add-port=11434/tcp
- sudo firewall-cmd --reload
Sao chép mã 5. Here is the deepseek chatbox: http://your-server-ip:3000
|
|