Back to work WIREDWOLVES · portfolio

Automation · 2025

Locally Hosted AI

A private DeepSeek model running on your own hardware, no cloud, no accounts, no data leaving the box. One script takes it from a bare Linux machine to a working chat interface in a browser. Simple enough that anyone could run their own local AI.

Docker Ollama OpenWebUI Bash

What it does

The script handles the whole setup end to end so there is nothing to piece together by hand:

Pick a model for your hardware

The right model depends on the disk and memory you have. Smaller models run comfortably on modest machines; the largest ones need serious hardware. Disk space per model:

deepseek-r1:1.5b1.1 GB
deepseek-r1:7b4.7 GB
deepseek-r1:8b4.8 GB
deepseek-r1:14b9.0 GB
deepseek-r1:32b20 GB
deepseek-r1:70b43 GB
deepseek-r1:671b404 GB

If you're not sure, start with 7b or 8b. They run well on most machines and are plenty capable for everyday use. You can always pull a bigger one later.

How it works

Two containers do the work. ollama runs the model and manages downloads. webui serves the interface and talks to Ollama over the local network. They come up together and restart on their own if the machine reboots.

Step one, prep the system

Optional but recommended. Updates the box and installs a few basics the rest of the process expects. Copy the whole block into your terminal.

bash · prep
# Copy and paste this entire block into your terminal
sudo apt update && sudo apt upgrade -y
apt-get install sudo -y
sudo apt install curl -y
sudo apt install net-tools -y

Step two, run the installer

This is the whole thing. It configures Docker, brings up both containers, then asks which model to pull and installs it. Paste the entire block and follow the prompt at the end.

bash · install
# Copy and paste this entire block into your terminal
sudo mkdir -p /etc/docker
cat << 'EOF' | sudo tee /etc/docker/daemon.json
{
    "dns": ["8.8.8.8", "8.8.4.4"]
}
EOF
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo mkdir -p /opt/deepseek
cat << 'EOF' | sudo tee /opt/deepseek/docker-compose.yaml
services:
  webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: webui
    ports:
      - 7000:8080/tcp
    volumes:
      - open-webui:/app/backend/data
    extra_hosts:
      - "host.docker.internal:host-gateway"
    depends_on:
      - ollama
    restart: unless-stopped
  ollama:
    image: ollama/ollama
    container_name: ollama
    ports:
      - 11434:11434/tcp
    volumes:
      - ollama:/root/.ollama
    restart: unless-stopped
volumes:
  ollama:
  open-webui:
EOF
cd /opt/deepseek
sudo docker compose up -d
IP=$(ip route get 1 | awk '{print $7;exit}')
echo "
Available DeepSeek models:
1) deepseek-r1:1.5b  (1.1GB disk)
2) deepseek-r1:7b    (4.7GB disk)
3) deepseek-r1:8b    (4.8GB disk)
4) deepseek-r1:14b   (9.0GB disk)
5) deepseek-r1:32b   (20GB disk)
6) deepseek-r1:70b   (43GB disk)
7) deepseek-r1:671b  (404GB disk)
Enter model number (1-7): "
read model_choice
case $model_choice in
    1) model="deepseek-r1:1.5b" ;;
    2) model="deepseek-r1:7b" ;;
    3) model="deepseek-r1:8b" ;;
    4) model="deepseek-r1:14b" ;;
    5) model="deepseek-r1:32b" ;;
    6) model="deepseek-r1:70b" ;;
    7) model="deepseek-r1:671b" ;;
    *) echo "Invalid choice"; exit 1 ;;
esac
echo "Pulling $model..."
sudo docker exec -it ollama ollama pull "$model"
echo "Model $model installed successfully!"
echo "Access WebUI at http://$IP:7000"

After it finishes

  1. Open http://YOUR_IP:7000 in a browser on your network
  2. Create your admin account on first access
  3. Start chatting with DeepSeek through the interface

The script prints your machine's IP at the end, so you don't have to go looking for it. Bookmark that address and the model is one click away whenever you need it.