Uploaded September 2026 | Updated November 2026, 16 hours ago
# How to Connect Ollama to n8n | Run Local AI Models in Your Workflows
In this complete beginner-friendly tutorial, you'll learn **how to connect Ollama to n8n** and use local AI models inside your automation workflows.
Ollama allows you to run AI models locally on your own computer, while n8n lets you build automated workflows that connect applications, APIs, databases, and AI services. Combining the two gives you a powerful way to build **local and privacy-focused AI automations**.
Ollama's API is available locally by default at `http://localhost:11434/api`, and its official n8n integration provides an Ollama credential that you can configure with your local Ollama URL.
## What You'll Learn
In this tutorial, we'll explain:
* What is Ollama?
* What is n8n?
* Why connect Ollama with n8n?
* How Ollama communicates with n8n
* How to install and verify Ollama
* How to download a local AI model
* How to configure Ollama credentials in n8n
* How to connect an Ollama model to an n8n workflow
* How to test the connection
* How to build a simple AI automation
* How to troubleshoot connection problems
* How to connect Ollama when n8n runs inside Docker
## Step 1: Make Sure Ollama Is Running
First, install Ollama and make sure the Ollama service is running on your computer.
You can verify that Ollama's API is available by opening:
`http://localhost:11434`
Ollama's local API doesn't require authentication.
You can also check the installed models from the terminal:
```bash
ollama list
```
If you don't have a model yet, download one with a command such as:
```bash
ollama pull gemma3
```
Ollama provides an API for downloading models, and the available local models can be queried through its `/api/tags` endpoint.
## Step 2: Open n8n
Open your n8n installation and create a **new workflow**.
Click **Add first step** and search for an **Ollama** node.
n8n's official Ollama integration allows you to create an Ollama credential directly from the node configuration.
## Step 3: Create the Ollama Credential
In n8n:
1. Select the Ollama node.
2. Open the **Credential** field.
3. Choose **Create New Credential**.
4. Select **Ollama**.
5. Enter the Ollama API URL.
For Ollama running directly on your computer, use:
```text
http://localhost:11434
```
Click **Save** and test the connection.
If everything is configured correctly, n8n should report that the connection was successful.
## Step 4: Select Your Ollama Model
After connecting the credential, select the model you downloaded with Ollama.
For example:
```text
gemma3
```
The exact models available depend on what you have installed locally.
You can check them with:
```bash
ollama list
```
## Ollama Cloud Alternative
You can also connect n8n to **Ollama's cloud service** instead of a local Ollama installation. In that case, n8n's Ollama credential uses `https://ollama.com` and an Ollama API key.
For a completely local setup, however, the local Ollama API requires no authentication.
This could automatically generate a daily AI-written report and send it by email.
You can extend this workflow with databases, APIs, Google Sheets, Slack, Discord, webhooks, file processing, and many other n8n integrations.
By the end of this tutorial, you'll know **how to connect Ollama to n8n, configure the Ollama credentials, select a local model, run your first AI workflow, and troubleshoot common connection problems**.
If you found this tutorial helpful, don't forget to like the video, subscribe to the channel, and turn on notifications for more **n8n, Ollama, AI automation, local AI, workflow automation, Linux, Docker, and technology tutorials**.
#Ollama #n8n #n8nAutomation #OllamaAI #LocalAI #AIAutomation #WorkflowAutomation #n8nTutorial #OllamaTutorial #ArtificialIntelligence #GenerativeAI #LLM #LocalLLM #Docker #AIWorkflow #NoCode #LowCode #Automation #TechTutorial #Learnn8n
# How to Connect Ollama to n8n | Run Local AI Models in Your Workflows
In this complete beginner-friendly tutorial, you'll learn **how to connect Ollama to n8n** and use local AI models inside your automation workflows.
Ollama allows you to run AI models locally on your own computer, while n8n lets you build automated workflows that connect applications, APIs, databases, and AI services. Combining the two gives you a powerful way to build **local and privacy-focused AI automations**.
Ollama's API is available locally by default at `http://localhost:11434/api`, and its official n8n integration provides an Ollama credential that you can configure with your local Ollama URL.
## What You'll Learn
In this tutorial, we'll explain:
* What is Ollama?
* What is n8n?
* Why connect Ollama with n8n?
* How Ollama communicates with n8n
* How to install and verify Ollama
* How to download a local AI model
* How to configure Ollama credentials in n8n
* How to connect an Ollama model to an n8n workflow
* How to test the connection
* How to build a simple AI automation
* How to troubleshoot connection problems
* How to connect Ollama when n8n runs inside Docker
## Step 1: Make Sure Ollama Is Running
First, install Ollama and make sure the Ollama service is running on your computer.
You can verify that Ollama's API is available by opening:
`http://localhost:11434`
Ollama's local API doesn't require authentication.
You can also check the installed models from the terminal:
```bash
ollama list
```
If you don't have a model yet, download one with a command such as:
```bash
ollama pull gemma3
```
Ollama provides an API for downloading models, and the available local models can be queried through its `/api/tags` endpoint.
## Step 2: Open n8n
Open your n8n installation and create a **new workflow**.
Click **Add first step** and search for an **Ollama** node.
n8n's official Ollama integration allows you to create an Ollama credential directly from the node configuration.
## Step 3: Create the Ollama Credential
In n8n:
1. Select the Ollama node.
2. Open the **Credential** field.
3. Choose **Create New Credential**.
4. Select **Ollama**.
5. Enter the Ollama API URL.
For Ollama running directly on your computer, use:
```text
http://localhost:11434
```
Click **Save** and test the connection.
If everything is configured correctly, n8n should report that the connection was successful.
## Step 4: Select Your Ollama Model
After connecting the credential, select the model you downloaded with Ollama.
For example:
```text
gemma3
```
The exact models available depend on what you have installed locally.
You can check them with:
```bash
ollama list
```
## Ollama Cloud Alternative
You can also connect n8n to **Ollama's cloud service** instead of a local Ollama installation. In that case, n8n's Ollama credential uses `https://ollama.com` and an Ollama API key.
For a completely local setup, however, the local Ollama API requires no authentication.
This could automatically generate a daily AI-written report and send it by email.
You can extend this workflow with databases, APIs, Google Sheets, Slack, Discord, webhooks, file processing, and many other n8n integrations.
By the end of this tutorial, you'll know **how to connect Ollama to n8n, configure the Ollama credentials, select a local model, run your first AI workflow, and troubleshoot common connection problems**.
If you found this tutorial helpful, don't forget to like the video, subscribe to the channel, and turn on notifications for more **n8n, Ollama, AI automation, local AI, workflow automation, Linux, Docker, and technology tutorials**.
#Ollama #n8n #n8nAutomation #OllamaAI #LocalAI #AIAutomation #WorkflowAutomation #n8nTutorial #OllamaTutorial #ArtificialIntelligence #GenerativeAI #LLM #LocalLLM #Docker #AIWorkflow #NoCode #LowCode #Automation #TechTutorial #Learnn8n






![How to Setup MCP in Codex CLI (Step-by-Step Guide) (2026)
How to Setup MCP in Codex CLI (Step-by-Step Guide)
In this step-by-step tutorial, youll learn how to set up MCP (Model Context Protocol) in Codex CLI and connect powerful external tools directly to your AI coding workflow. MCP enables Codex CLI to communicate with external services such as GitHub, databases, documentation servers, browsers, design tools, and custom applications, making AI-assisted development more productive and context-aware. This guide is perfect for developers, software engineers, DevOps professionals, and anyone looking to unlock the full capabilities of Codex CLI with MCP integrations. ([Inventive HQ][1])
In this video, well explain what MCP is, how it works, and why it has become an important standard for connecting AI assistants to external tools and services. Youll learn how to install and configure MCP servers, where the Codex CLI configuration file is located, and how to add your first MCP server using both the command line and configuration file methods. Well also demonstrate how to verify that your MCP server is running correctly and accessible from within Codex CLI. ([Verdent AI][2])
Youll discover how to configure both local STDIO-based MCP servers and remote HTTP-based MCP servers, depending on your use case. We also cover environment variables, authentication methods, API keys, OAuth-enabled servers, and common configuration options so you can securely connect to your favorite development tools. ([Spybara][3])
Additionally, this tutorial includes troubleshooting tips for common MCP setup issues, including configuration errors, missing dependencies, authentication failures, server startup problems, and connection timeouts. By the end of this guide, youll have a fully configured MCP environment that extends Codex CLI beyond local files and terminal commands.
Topics covered in this tutorial:
* What is Model Context Protocol (MCP)?
* Why use MCP with Codex CLI
* Installing Codex CLI prerequisites
* Understanding MCP servers
* Locating the Codex configuration file
* Adding MCP servers using the CLI
* Configuring MCP servers manually
* STDIO vs HTTP MCP servers
* Setting environment variables
* API key and OAuth authentication
* Verifying MCP connections
* Using MCP tools inside Codex CLI
* Troubleshooting MCP configuration errors
* Best practices for secure MCP setup
MCP transforms Codex CLI into a more powerful AI development assistant by allowing it to securely interact with external tools, documentation, repositories, and services. Learning how to configure MCP is an essential step for developers who want to automate workflows, improve productivity, and build more capable AI-assisted development environments. ([Verdent AI][2])
If you found this tutorial helpful, dont forget to like the video, subscribe to the channel, and turn on notifications for more Codex CLI, AI development, MCP, programming, and software engineering tutorials.
#CodexCLI #MCP #ModelContextProtocol #OpenAI #AIProgramming #DeveloperTools #CodingTutorial #SoftwareDevelopment #GitHub #DevOps #Automation #Programming #AITools #CodingWorkflow #Terminal #CLI #TechTutorial #SoftwareEngineering #AIDevelopment #CodeWithAI
[1]: https://inventivehq.com/knowledge-base/openai/how-to-set-up-mcp-servers?utm_source=chatgpt.com How to Set Up MCP Servers with OpenAI Codex CLI | Inventive HQ
[2]: https://www.verdent.ai/guides/codex-cli-mcp-setup-guide?utm_source=chatgpt.com Codex CLI MCP: How OpenAI Codex Connects to Tools - Verdent Guides
[3]: https://spybara.com/openai/codex/history/docs/en/mcp/page/2026-03-17-1824/2026-04-14-1229/?utm_source=chatgpt.com mcp page — Spybara How to Setup MCP in Codex CLI (Step-by-Step Guide) (2026)](https://i.ytimg.com/vi/gaSLGiaq5nk/mqdefault.jpg)



