Open WebUI with Ollama

Im using this playbook to boot Open WebUI / Ollama on my DGX Spark

Everything works great but I would like to access Ollama, on port 11434 if possible, I have tried adding the port to the Docker config script but no luck. Can anyone help?

try adding –network host to the docker run command. It will expose the port to the host machine

having issues with this myself, trying to use it without the bundle as alot of playbooks ask us for a seperate local install of ollama directly

This works, I added these, also some commented out code to delete existing container so it is rebuilt with correct ports

-p 11434:11434
-e OLLAMA_HOST=0.0.0.0:11434

#!/usr/bin/env bash
set -euo pipefail

NAME="open-webui"
IMAGE="ghcr.io/open-webui/open-webui:ollama"

cleanup() {
  echo "Signal received; stopping ${NAME}..."
  docker stop "${NAME}" >/dev/null 2>&1 || true
  exit 0
}
trap cleanup INT TERM HUP QUIT EXIT

# Ensure Docker CLI and daemon are available
if ! docker info >/dev/null 2>&1; then
  echo "Error: Docker daemon not reachable." >&2
  exit 1
fi

# if [ -n "$(docker ps -aq --filter "name=^${NAME}$")" ]; then
  # echo "Removing existing container ${NAME}..."
  # docker rm -f "${NAME}" >/dev/null
# fi

# Already running?
if [ -n "$(docker ps -q --filter "name=^${NAME}$" --filter "status=running")" ]; then
  echo "Container ${NAME} is already running."
else
  # Exists but stopped? Start it.
  if [ -n "$(docker ps -aq --filter "name=^${NAME}$")" ]; then
    echo "Starting existing container ${NAME}..."
    docker start "${NAME}" >/dev/null
  else
    # Not present: create and start it.
    echo "Creating and starting ${NAME}..."
    #--network=host \
    docker run -d \
      -p 12000:8080 \
      -p 11434:11434 \
      -e OLLAMA_HOST=0.0.0.0:11434 \
      --gpus=all \
      -v open-webui:/app/backend/data \
      -v open-webui-ollama:/root/.ollama \
      --name "${NAME}" "${IMAGE}" >/dev/null
  fi
fi

echo "Running. Press Ctrl+C to stop ${NAME}."
# Keep the script alive until a signal arrives
while :; do sleep 86400; done