Install and Run DeepSeek-VL2 on Ubuntu: A Step-by-Step Guide
![Install and Run DeepSeek-VL2 on Ubuntu: A Step-by-Step Guide](/blog/content/images/size/w2000/2025/02/11-1.jpg)
DeepSeek-VL2 is an open-source large language model (LLM) developed by the Chinese AI company DeepSeek, founded in 2023 by Liang Wenfeng. Known for its advanced reasoning capabilities, DeepSeek-VL2 rivals OpenAI's Model o1. This guide provides a comprehensive tutorial on how to install and run DeepSeek-VL2 on Ubuntu, covering prerequisites, installation steps, and usage.
What is DeepSeek-VL2?
DeepSeek-VL2 is a flagship AI model developed by DeepSeek, an AI company specializing in natural language processing. It is designed for tasks such as answering questions and generating text. The model is built on Qwen and Llama architectures, advanced neural network designs optimized for large-scale language modeling.
Prerequisites
Before installing DeepSeek-VL2, ensure your system meets the following requirements:
- Operating System: Ubuntu 22.04 or later
- Hardware: Modern CPU with at least 16 GB RAM and a dedicated GPU (NVIDIA GPUs are recommended)
- Software: Python 3.8 or later and Git
- Disk Space: At least 10 GB for smaller models; larger models require significantly more storage
Step-by-Step Installation Guide
Follow these steps to install and run DeepSeek-VL2 on Ubuntu.
Step 1: Install Python and Git
First, update your system before installing new packages:
sudo apt update && sudo apt upgrade -y
Verify and install Python (version 3.8 or higher):
sudo apt install python3 python3 --version
Install Pip, the package manager for Python:
sudo apt install python3-pip pip3 --version
Install Git to manage repositories:
sudo apt install git git --version
Step 2: Install Ollama
Ollama simplifies running large language models locally. Install it using:
curl -fsSL https://ollama.com/install.sh | sh
Verify the installation:
ollama --version
Enable and start Ollama to run automatically on system boot:
sudo systemctl start ollama
sudo systemctl enable ollama
Check if Ollama is running:
systemctl is-active ollama.service
If inactive, manually start it:
sudo systemctl start ollama.service
Step 3: Download and Run DeepSeek-VL2 Model
Download and run the DeepSeek model with:
ollama run deepseek-r1:7b
Verify the downloaded models:
ollama list
DeepSeek-R1 provides various model sizes:
- 1.5b: ~2.3GB (Minimal resource usage)
- 7b: ~4.7GB (Balanced performance)
- 70b: ~40GB+ (High-performance model)
To remove a model and free up disk space:
ollama rm deepseek-r1:70b
Replace 70b
with the model size you want to delete.
Step 4: Running DeepSeek in a Web UI
For a user-friendly interface, use Ollama Web UI. First, create a virtual environment:
sudo apt install python3-venv
python3 -m venv ~/open-webui-venv
source ~/open-webui-venv/bin/activate
Install Open WebUI:
pip install open-webui
Start the server:
open-webui serve
Access the Web UI at http://localhost:8080
. Select the DeepSeek model and begin interacting.
Step 5: Enable Open-WebUI on System Boot
To make Open-WebUI start on boot, create a systemd service:
sudo nano /etc/systemd/system/open-webui.service
Add the following content:
[Unit]
Description=Open Web UI Service
After=network.target
[Service]
User=your_username
WorkingDirectory=/home/your_username/open-webui-venv
ExecStart=/home/your_username/open-webui-venv/bin/open-webui serve
Restart=always
Environment="PATH=/home/your_username/open-webui-venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
[Install]
WantedBy=multi-user.target
Replace your_username
with your actual username. Reload and enable the service:
sudo systemctl daemon-reload
sudo systemctl enable open-webui.service
sudo systemctl start open-webui.service
Check the status:
sudo systemctl status open-webui.service
Troubleshooting Common Issues
- Model Fails to Load:
- Fix: Ensure Ollama is running (
sudo systemctl restart ollama
). - Update NVIDIA drivers:
sudo apt install nvidia-driver-535
- Insufficient VRAM:
- Switch to a smaller model (e.g.,
1.5b
). - Enable CPU fallback:
ollama run deepseek-r1:7b --numa # Uses CPU if GPU memory is full
- Dependency Errors:
- Reinstall Python packages:
pip install --upgrade torch llama-cpp-python
For advanced issues, consult the DeepSeek Documentation.
Run DeepSeek-VL2 on Cloud Platforms
For resource-intensive tasks or scalability, consider cloud solutions:
- Linode:
- Affordable GPU instances ($0.15/hr for NVIDIA T4).
- Deploy Ubuntu 22.04 and follow this guide.
- Google Cloud Platform (GCP):
- Use A2 VMs with NVIDIA A100 GPUs.
- Pre-configured Deep Learning VM images available.
Running DeepSeek on Cloud Platforms
To run DeepSeek on the cloud for scalability and performance, consider:
- Linode: Affordable, high-performance cloud hosting
- Google Cloud Platform (GCP): Offers GPU-supported VMs for running LLMs
Troubleshooting
- Issue: DeepSeek-VL2 fails to run.
- Solution: Ensure all necessary dependencies are installed.
Conclusion
You’ve now installed DeepSeek-VL2 on Ubuntu and can interact with it via CLI or a user-friendly Web UI. Whether you’re developing AI applications, automating workflows, or experimenting with NLP, DeepSeek-VL2 offers enterprise-grade capabilities in an open-source package.