Tested on Ubuntu 24.04 LTS with an NVIDIA RTX 4070. Should work identically on Debian 12, Fedora 40, and Arch.
| Tool | Version | Purpose |
|---|---|---|
| Docker Engine | ≥ 26.0 | Runs the worker container |
| NVIDIA Container Toolkit | latest | Only if you want Ollama in Docker (we won't) |
| Ollama | ≥ 0.5 | Local LLM runtime |
| Foundry (cast) | ≥ 1.7.1 | EVM wallet ops, contract reads |
| Bash | ≥ 4.0 | Required for several scripts |
Bash 4.0+ is required, but any mainstream distro from the last decade satisfies this (Ubuntu ≥ 10.04, RHEL ≥ 7, etc.). Run
bash --versionto confirm if unsure.
# 1. Docker Engine (community edition, from the official repo)
sudo apt-get update
sudo apt-get install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Optional but strongly recommended: avoid sudo for every docker command
sudo usermod -aG docker $USER
newgrp docker
# 2. Ollama (native install with auto-detected GPU acceleration)
curl -fsSL https://ollama.com/install.sh | sh
# 3. Foundry
curl -L https://foundry.paradigm.xyz | bash
~/.foundry/bin/foundryupfoundryup puts cast, forge, anvil, chisel in ~/.foundry/bin. Add it to your PATH if it isn't already:
echo 'export PATH="$HOME/.foundry/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcOllama on Linux looks for NVIDIA via the standard driver stack. Verify:
nvidia-smiShould show your GPU, total VRAM, driver version, and CUDA version. You need ≥ 8 GB VRAM for llama3-8b at Q4 quantization. See the Windows install guide for a list of cards that work.
If nvidia-smi doesn't exist, install the proprietary NVIDIA driver:
# Ubuntu - use ubuntu-drivers to pick the right version
sudo ubuntu-drivers autoinstall
sudo rebootReboot, then re-verify nvidia-smi.
docker --version # Docker version 26.x or newer
docker ps # should return an empty table
ollama --version
ollama list
cast --versionThe official installer registers Ollama as a systemd service that starts at boot. Verify:
systemctl status ollama
# Active: active (running)If it's not running:
sudo systemctl enable --now ollamaOn Linux, host.docker.internal doesn't resolve out of the box (it's a Docker Desktop convention). The toolkit's 08-run-worker.sh adds --add-host=host.docker.internal:host-gateway which uses Docker's host-gateway feature to make it resolve to the host's gateway IP.
If you want a more explicit setup, use --network host and OLLAMA_URL=http://127.0.0.1:11434:
docker run -d --restart always --network host \
--name lightchain-worker \
-v ~/lightchain-worker/keys:/data \
-e OLLAMA_URL=http://127.0.0.1:11434 \
... rest of env ... \
$IMAGEThe trade-off: with --network host, the container shares the host's network namespace (so its 127.0.0.1 is yours). Slightly less isolated, slightly more straightforward.
By default Ollama binds to 127.0.0.1:11434. To expose it on the LAN (rarely needed - the worker container already reaches it via host-gateway):
sudo systemctl edit ollamaAdd:
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
Then sudo systemctl restart ollama.
See examples/systemd/lightchain-worker.service for a unit file that brings up Docker, waits for Ollama, then ensures the worker container is running.
You're ready. Continue with docs/onboarding.md.