A common home-lab split is:
- Workstation — IDE +
local-coding-slmMCP - Second PC — Windows, Ubuntu in WSL2, NVIDIA GPU, Ollama
This file uses placeholders only. Put the real SSH name, port, and LAN
address in a gitignored .env or *.local.md. Never commit them.
Keep Ollama on WSL localhost. From the workstation, forward the API:
ssh -N -T -o ExitOnForwardFailure=yes -p <ssh-port> \
-L 127.0.0.1:11436:127.0.0.1:11434 user@<wsl-host>Then on the workstation (gitignored .env):
OLLAMA_BASE_URL=http://127.0.0.1:11436
11436 is an example unused port on the workstation. 11434 is Ollama's
loopback port inside WSL. <wsl-host> is a name or address you already use.
Do not scan for it.
<ssh-port> is often not 22 when Windows already owns port 22 — use
whatever ssh you already use to reach that WSL.
Documentation stand-ins (not a real household):
ssh -N -T -o ExitOnForwardFailure=yes -p 2222 \
-L 127.0.0.1:11436:127.0.0.1:11434 user@wsl-gpu.example
wsl-gpu.example and 192.0.2.0/24 are examples. They are not this lab.
- Install a current Ollama. Distro packages can be too old.
- Pull the starter tags and confirm
ollama psafter one short chat. - Leave Ollama on
127.0.0.1:11434if you use the SSH forward above. - The PC may be powered off when unused. Treat "no route" as host down before changing addresses.
Do not port-forward 11434 or 22/2222 through a public router.
- Real hostnames, Windows computer names, usernames, or RFC1918 addresses
- A working
OLLAMA_BASE_URLthat identifies the house - Screenshots of
sshorip addrfrom that machine