Skip to main content
AmigoFish

How to Connect Ollama to n8n | Run Ollama AI Models in Your Workflows

From ProgrammingKnowledge · · 8 min

The player loads from YouTube only when you click. It uses YouTube's privacy-enhanced mode.

If the video does not play, the owner may have turned off embedding. Watch it on YouTube instead.

Watch on YouTube

Not rated yet

Description

# 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

Back to ProgrammingKnowledge · Report a problem