Building a Self-Hosted AI Stack — Overview
A complete guide to running your own AI stack on local hardware — chat models, image generation, IDE coding agent, live web search, and secure remote access. No API keys, no subscriptions.
This series covers a complete self-hosted AI stack running on your own hardware: a general-purpose chat model, a dedicated coding model usable both as a chat assistant and as an IDE-integrated agent, image generation, a unified web interface, live internet search for your models, and secure remote access from anywhere — all without a single API key or subscription to a third-party AI provider.
Why self-host?
Running your own AI stack instead of paying for hosted APIs comes down to three things: control, cost at scale, and privacy. You decide which models run, when they update, and what happens to your prompts and generated content — none of it leaves your network unless you want it to. If you already have a capable GPU sitting mostly idle outside of gaming sessions, the marginal cost of running models locally is just electricity.
The tradeoff is real, though: you're trading a monthly subscription for setup time, some hardware investment, and the ongoing job of keeping things updated. This series is written for people who find that tradeoff worthwhile and want a clear, working path to get there — including the mistakes and troubleshooting, not just the happy path.
What you'll end up with
By the end of this series, you'll have:
- A unified web interface (Open WebUI) that feels like ChatGPT or Claude, but talks to models running entirely on your own machine
- Multiple local language models covering general chat, reasoning, and coding, swappable depending on the task
- Live web search wired into your models, so they aren't limited to frozen training data
- Image generation via ComfyUI, with a node-based workflow you can customize
- An IDE-integrated coding agent in VS Code, backed by your own locally-hosted coding model
- Secure remote access, so you can reach your stack from outside your home network
How this series is organized
Each part is meant to be worked through in order the first time and referenced independently after that:
| Part | Topic |
|---|---|
| Part 1 — Planning & Hardware | What you need before you start, and how to size model choices to your GPU |
| Part 2 — Environment Setup | WSL2, Docker, and GPU passthrough |
| Part 3 — Core Services | Ollama, Open WebUI, and SearXNG via Docker Compose |
| Part 4 — Image Generation | ComfyUI setup and workflow troubleshooting |
| Part 5 — IDE Coding Agent | Wiring a local coding model into VS Code |
| Part 6 — Remote Access | Reaching your stack securely from anywhere |
| Part 7 — Troubleshooting | The failure modes you're most likely to hit |
If you already have Docker and WSL2 set up, skip straight to Part 3. If you just want the coding-agent piece, Part 5 stands on its own as long as Ollama is already running.