Docker Setup

Run Jarvis in Docker containers for isolation and easy deployment.

Quick Start

Build the image:

docker build -t jarvis .

Run the container:

docker run -p 18789:18789 -v ~/.jarvis:/root/.jarvis jarvis

Docker Compose

docker-compose.yml:

version: '3.8'

services:
  jarvis:
    build: .
    ports:
      - "18789:18789"
    volumes:
      - ~/.jarvis:/root/.jarvis
      - ~/.ollama:/root/.ollama
    environment:
      - OLLAMA_HOST=host.docker.internal:11434
    restart: unless-stopped

Start with:

docker-compose up -d

Environment Variables

JARVIS_CONFIG_DIR

Config directory (default: ~/.jarvis)

OLLAMA_HOST

Ollama server address (default: 127.0.0.1:11434)

JARVIS_GIT_DIR

Source code location (default: ~/jarvis)

Volume Mounts

Mount these directories to persist data:

~/.jarvis:/root/.jarvis

Configuration and state

~/.ollama:/root/.ollama

Ollama models (optional)

~/jarvis:/root/jarvis

Source code (if building from source)

Networking

Port Mapping

Expose the gateway port:

-p 18789:18789

Connecting to Host Ollama

If Ollama runs on the host machine:

-e OLLAMA_HOST=host.docker.internal:11434

Production Tips

  • Use restart: unless-stopped for automatic recovery
  • Set resource limits with --memory and --cpus
  • Use Docker secrets for API keys instead of environment variables
  • Enable logging with --log-driver
  • Consider using a reverse proxy (nginx, Caddy) for HTTPS
Jarvis

© 2026 Nilkanth Desai. MIT licensed.