SoFunction
Updated on 2025-04-11

Detailed steps to deploy DeepSeek with Docker on Ubuntu

DeepSeek using Docker on Ubuntu and make sure it has access to public URLs for conversations, you can follow these steps:

1. Install Docker

Update Ubuntu's package index:

sudo apt-get update

Install the necessary packages that allow apt to use the repository over HTTPS:

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

Add Docker's official GPG key:

curl -fsSL /linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/

Set up the stable version of Docker repository:

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/] /linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt// > /dev/null

Update the apt package index and install Docker Engine:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli  docker-compose-plugin

2. Install Ollama (DeepSeek's localized deployment tool)

Visit Ollama official website () and select the corresponding installation method according to the operating system. For Ubuntu, you can run the following command in the terminal to install:

curl -fsSL / | sh

After the installation is complete, verify that Ollama is installed successfully:

ollama -v

If the version information of Ollama is displayed, the installation is successful.

3. Download and deploy the DeepSeek model

Download the DeepSeek model using Ollama. Find the download link or command of the DeepSeek model in the official website of Ollama or in the relevant documents. For example, download the DeepSeek-R1 model:

ollama run deepseek-r1:[Choose the right version,like7bor1.5bwait]

After the download is completed, you can interact with the DeepSeek model through the command line. If you need to deploy a web interface to talk to the model, you can consider using tools such as Open WebUI.

4. Configure Docker containers to access the public network

When running a Docker container, you need to map the port of the container to the port of the host so that external users can access it. For example, if DeepSeek's web interface runs on port 8080 of the container, you can run the container with the following command:

docker run -d -p [Host port]:8080 --name deepseek-container [DeepSeek DockerMirror name]

Replace [Host Port] with the port number you want to access by external users, and [DeepSeek Docker Image Name] with the Docker Image Name of DeepSeek.

Make sure the Ubuntu server's firewall allows external access to the mapped ports. You can use tools such as ufw (Uncomplicated Firewall) to configure firewall rules. For example, allow external access to port 8080:

sudo ufw allow 8080/tcp

If needed, you can also configure domain name resolution and point the domain name to the public IP address of the Ubuntu server so that users can access the DeepSeek web interface through the domain name.

5. Visit DeepSeek's web interface

Open the browser, enter the public IP address of the Ubuntu server and the mapped port number (such as http://[public IP]:[host port]) to access the DeepSeek web interface.

In the web interface, you can enter questions or instructions to talk to the DeepSeek model.

Please note that the above steps may vary due to updates from DeepSeek and Ollama. When actually doing it, please refer to the official documentation of DeepSeek and Ollama for the latest installation and configuration guide.

This is the end of this article about the detailed steps for deploying DeepSeek using Docker on Ubuntu. For more relevant content on Ubuntu Docker Deployment of DeepSeek, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!