How to Install DeepSeek AI with Open WebUI on Ubuntu 24.04
Introduction
This guide explains how to install DeepSeek AI on an Ubuntu VPS using Ollama and Open WebUI.
Ollama is used to download and run AI models, while Open WebUI provides a browser-based interface for interacting with the model.
By following this guide, you will be able to run DeepSeek on your Ubuntu server and access it through a web browser.
Step 1: Prepare Your Ubuntu VPS
Before starting, make sure you have an Ubuntu VPS with root access.
You will need:
- An Ubuntu VPS
- Server IP address
- Root username and password
- SSH access
- A stable internet connection
Step 2: Connect to Your Instance
Once your server is ready, connect to it using SSH.
For Linux/macOS, open your terminal and run:
ssh root@YOUR_SERVER_IP
Replace YOUR_SERVER_IP with your actual server IP address.
For Windows, you can use an SSH client such as PuTTY. Enter your server IP address, use port 22, and click Open. Log in using your root username and password.
Step 3: Update the System
Before installing any software, update the system packages to make sure everything is up to date.
Run:
apt update && apt upgrade -y
Step 4: Install Required Dependencies
Install the required dependencies for DeepSeek and Open WebUI.
Run:
apt install python3 -y
apt install python3-pip -y
apt install git -y
Step 5: Set Up the WebUI Directory
Create a directory for Open WebUI and navigate to it.
Run:
cd /home/
mkdir webui
cd webui
Step 6: Install Ollama
Ollama is a tool for managing and running AI models.
Install Ollama by running:
curl -fsSL https://ollama.com/install.sh | sh
Verify the installation:
ollama --version
Check the status of the Ollama service:
systemctl status ollama.service
Step 7: Pull the DeepSeek Model
Pull the DeepSeek model using Ollama.
For example:
ollama pull deepseek-r1:7b
You can also choose another available version depending on your server resources:
DeepSeek-R1-Distill-Qwen-1.5B
DeepSeek-R1-Distill-Qwen-7B
DeepSeek-R1-Distill-Qwen-14B
DeepSeek-R1-Distill-Qwen-32B
DeepSeek-R1-Distill-Llama-8B
DeepSeek-R1-Distill-Llama-70B
List the available models to verify the download:
ollama list
Run the DeepSeek model:
ollama run deepseek-r1:7b
If the model starts successfully, DeepSeek is ready to use with Ollama.
Step 8: Set Up Open WebUI
Install the Python virtual environment package:
apt install python3-venv
Create a virtual environment for Open WebUI:
python3 -m venv /home/webui/open-webui-venv
Activate the virtual environment:
source /home/webui/open-webui-venv/bin/activate
Install Open WebUI:
pip install open-webui
Step 9: Create a Systemd Service for Open WebUI
Create a systemd service file to manage Open WebUI:
nano /etc/systemd/system/open-webui.service
Add the following content to the file:
[Unit]
Description=Open WebUI Service
After=network.target
[Service]
User=root
WorkingDirectory=/home/webui/open-webui-venv
ExecStart=/home/webui/open-webui-venv/bin/open-webui serve
Restart=always
Environment="PATH=/home/webui/open-webui-venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
[Install]
WantedBy=multi-user.target
Save and close the file.
Reload the systemd daemon:
systemctl daemon-reload
Enable and start the Open WebUI service:
systemctl enable open-webui.service
systemctl start open-webui.service
Check the service status:
systemctl status open-webui.service
Step 10: Access Open WebUI
Once the service is running, open your web browser and go to:
http://YOUR_SERVER_IP:8080
Replace YOUR_SERVER_IP with your actual VPS IP address.
You should see the Open WebUI interface. From there, you can interact with the DeepSeek model through your browser.
Conclusion
You have successfully installed DeepSeek AI on your Ubuntu VPS using Ollama and Open WebUI.
Ollama manages and runs the DeepSeek model, while Open WebUI provides a simple web interface for using the model remotely. You can now access your AI interface from a browser at:
http://YOUR_SERVER_IP:8080