Build a Complete Private AI Workspace

What This Tutorial Covers

This is the capstone for the Run AI Locally course. By now you have Ollama installed, you have tried LM Studio and Open WebUI, you understand how to choose a model, and you have seen how local AI can connect to automation tools like n8n.

Now you are going to put it all together into a working private AI workspace: a setup you can use every day for chat, document work, coding help, and automated tasks, with no data leaving your machine.


What the Full Stack Looks Like

The setup you will build has three layers:

Layer 1: The model engine Ollama runs in the background and serves your local models. It handles loading, inference, and responding to requests from other applications.

Layer 2: The chat interface Open WebUI sits on top of Ollama and gives you a clean, browser-based interface for conversations. It supports multiple models, conversation history, document uploads, and custom system prompts.

Layer 3: The automation layer n8n connects your local AI to external services and internal workflows. This is where you build automations: summarize incoming emails, process files, run scheduled AI tasks, and more, all through your local model.

All three layers run on your machine. Nothing goes to the cloud.


Step 1: Set Up Ollama

If you have not installed Ollama yet, follow the installation tutorial earlier in this course. Make sure at least one model is downloaded and working before continuing.

Verify Ollama is running:

ollama list

You should see at least one model in the output. If the list is empty, pull one:

ollama pull llama3.1

Ollama runs as a background service and listens on port 11434 by default. Leave it running.


Step 2: Set Up Open WebUI

Open WebUI is the cleanest chat interface for Ollama. It runs in your browser and feels similar to ChatGPT.

Install with Docker:

docker run -d -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  --name open-webui \
  --restart always \
  ghcr.io/open-webui/open-webui:main

Once it starts, open your browser and go to http://localhost:3000. Create an account (this is local only, not connected to any external service).

Open WebUI will automatically detect Ollama running on your machine. You will see your downloaded models available to chat with straight away.

Key Open WebUI features to configure:

  • Set a default model in Settings so every new conversation starts with your preferred model
  • Create a custom system prompt under Settings to define a persistent persona or work context (for example: "You are a professional writing assistant. Be concise and direct.")
  • Use the Documents section to upload files and chat with them
  • Create separate Workspaces for different projects or contexts

Step 3: Set Up n8n for Local AI Automation

n8n is an open-source workflow automation tool you run yourself. Pair it with Ollama and you can build automations that use your local model as the AI engine.

Install with Docker:

docker run -d \
  --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  --restart always \
  docker.n8n.io/n8nio/n8n

Open http://localhost:5678 and create an account. This is a local account, not connected to n8n's cloud.

To connect n8n to your Ollama instance, use the Ollama node in any workflow and set the base URL to http://host.docker.internal:11434 (on Mac and Windows) or http://172.17.0.1:11434 (on Linux).


Step 4: Build Three Useful Automations

Here are three practical workflows to build once your stack is running. Each one demonstrates a different way to use local AI in your daily work.

Workflow 1: Daily Text Summarizer

This workflow runs on a schedule and summarizes a text file or paste of content you provide.

  1. Add a Schedule Trigger node (set to run at a time you choose)
  2. Add a Read Binary File node pointing to a folder where you drop text files
  3. Add an Ollama node with the prompt: "Summarize the following text in bullet points. Be concise:"
  4. Add a Write File node to save the summary

Once built, you can drop any document into your folder and get a summary waiting for you at the scheduled time.

Workflow 2: Local Document Question Answering

This workflow accepts a question and a document, passes both to your local model, and returns an answer.

  1. Add a Webhook trigger node
  2. Add a Code node to combine the question and document text into a formatted prompt
  3. Add an Ollama node with the combined prompt
  4. Return the response through the webhook

You can trigger this from a browser bookmark, a script, or any other tool that can make an HTTP request.

Workflow 3: Daily Writing Prompt

A simple creative workflow that generates a writing prompt each morning.

  1. Add a Schedule Trigger (set to your preferred morning time)
  2. Add an Ollama node with the prompt: "Give me one specific, unusual writing prompt for a short story. No explanation, just the prompt."
  3. Add an Email Send node (or a Slack message, or a file write) to deliver the prompt

This is a small but satisfying automation that shows how local AI can fit into personal workflows without any cloud dependency.


Step 5: Choosing Models for Different Tasks

Now that you have a full stack, you can assign different models to different jobs.

In Open WebUI, you can switch models per conversation from the model selector at the top of the chat window. Consider keeping these ready:

  • A fast, lightweight model (Phi-3 Mini or Gemma 2 2B) for quick questions where speed matters more than depth
  • A capable general model (Llama 3.1 8B or Mistral 7B) as your default
  • A coding-focused model (DeepSeek Coder or Qwen Coder) loaded when you are doing technical work

In n8n automations, you can use the smaller, faster model for simple classification or summarization tasks, and route complex reasoning to your larger model. This is the multi-model fallback pattern covered in the previous tutorial.


Keeping Your Stack Running

Because all three services use the --restart always flag in Docker, they will start automatically when your machine boots. You do not need to manually launch anything after the initial setup.

To check the status of your running containers:

docker ps

To stop the stack when you are not using it:

docker stop open-webui n8n

To start it again:

docker start open-webui n8n

Ollama typically runs as a native service (not Docker) and manages itself. If it stops, restart it with:

ollama serve

What You Have Built

At the end of this setup, you have:

  • A private, always-available AI chat interface in your browser
  • The ability to run any of dozens of open-source models
  • An automation engine that can use your local AI for scheduled and triggered tasks
  • A stack that costs nothing to run beyond your existing hardware
  • Full data privacy: no messages, documents, or queries leave your machine

From here, the natural next step is to explore RAG (retrieval-augmented generation), which lets your local model answer questions about your own documents and knowledge base. The build-rag-pipeline task in this course points you to the best tools for that.

Discussion

  • Loading…

← Back to Tutorials