You can connect a self-hosted n8n instance to Ollama by creating an Ollama credential with the correct Base URL, selecting the native Ollama Chat Model node, and choosing a model tag that exists in Ollama. Use http://localhost:11434 when both services run on the same machine. When n8n runs in Docker, route it to the host or to an Ollama service container instead. Test Ollama directly first; that single check separates an Ollama problem from an n8n configuration problem.
Antihost offers VPS plans with one-click n8n, NVMe storage and a 14-day free trial.
What the n8n–Ollama connection actually does
Ollama runs an inference server on your computer or private server. n8n sends a prompt to that server from a workflow, receives the generated response, and passes the result to later nodes such as a database, email step, ticketing system, or document-processing branch. The language model does not need to be hosted by a third-party API for this arrangement.
As an Amazon Associate I earn from qualifying purchases.
The connection has three independent parts:
- Ollama availability: the Ollama service must be running and must have at least one model pulled locally.
- Network reachability: the n8n process must be able to reach Ollama at the Base URL you enter. “Local” means local to the n8n process, not necessarily local to your laptop.
- Model selection: the model name entered in n8n must exactly match the tag Ollama has pulled, including a variant or size suffix when one is present.
The official documentation is the right place to check changing labels and environment-variable behavior: Ollama documentation and n8n documentation.
Choose the topology before entering a URL
Decide where each process runs. This determines the address n8n must use and prevents the most common “connection refused” mistake.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
| n8n location | Ollama location | Typical Base URL | Important detail |
|---|---|---|---|
| Same operating-system host | Same host | http://localhost:11434 |
Use 127.0.0.1 if localhost resolution fails. |
| Docker container | Host operating system | http://host.docker.internal:11434 |
The container needs a route to the host; Linux usually needs an explicit host-gateway mapping. |
| Docker container | Separate Ollama container on the same Compose network | http://ollama:11434 |
ollama is the service name used in the Compose network, not a universal hostname. |
| n8n Cloud | Private Ollama on your network | Not directly reachable by a private localhost address | You would need a securely exposed, authenticated HTTPS endpoint; the exact cloud networking arrangement depends on your deployment. |
The Docker and shared-network entries are deployment guidance rather than guarantees for every operating system or image version. Confirm the current behavior for your n8n and Ollama versions before standardizing a production setup.
Prepare and test Ollama first
Do not begin by debugging an n8n workflow. First prove that Ollama itself is serving requests and that the model tag you intend to use is present.
Free tools Windows power users keep installed
One-click scans. No signup required.
Install, start, and pull a model
Install Ollama for your operating system using its current instructions. Start the Ollama service if it is not already running, then pull a model. The following example uses the llama3.1 tag mentioned in the setup guidance; substitute the exact tag you have selected.
ollama serve
ollama pull llama3.1
ollama run llama3.1
ollama serve may already be managed by your desktop application or operating-system service. If it reports that a server is already running, leave that process in place and continue. The important result is that a model pull completes and an interactive run can answer a prompt.
Verify the HTTP endpoint
Ollama’s local API listens on port 11434 by default. A direct request confirms both network access and model availability without involving n8n:
curl http://localhost:11434/api/generate -d '{"model":"llama3.1","prompt":"Reply with the word OK.","stream":false}'
Use the same model tag you plan to enter in n8n. A JSON response means the service answered. If the command cannot connect, fix Ollama, its listening address, or the host firewall before touching n8n. If it answers with a model-not-found error, pull the tag or correct the spelling first.
Create the Ollama credential in n8n
Once Ollama answers directly, configure the credential used by your workflow.
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
- Open your n8n editor and go to Credentials.
- Create a new credential of type Ollama.
- Enter the Ollama Base URL. For a same-machine installation, use
http://localhost:11434. - If you configured the Ollama
OLLAMA_HOSTenvironment variable, enter that value instead of assuming the default. - Save the credential and run its connection test. A successful test is reported as Connection tested successfully.
If a local n8n server cannot connect through localhost, repeat the test with http://127.0.0.1:11434. These addresses normally refer to the same machine, but name resolution and binding behavior can differ between environments.
What the Base URL should and should not contain
Use the server origin and port expected by the Ollama credential. Do not append the /api/generate path when using the native credential; the node adds the API path it needs. Conversely, an HTTP Request node that calls the raw API does need the full endpoint path in its URL.
Build a first workflow with the native node
The native Ollama Chat Model node is the usual starting point for a new n8n build because it handles the chat-model connection through the credential you just created.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
- Create a new workflow and add a trigger appropriate to your test, such as a manual trigger.
- Add the Ollama Chat Model node from the node picker.
- Select the Ollama credential you created.
- Enter the exact model tag that succeeded in your direct Ollama test, such as
llama3.1. Matching is exact; a display name, shortened family name, or different variant can fail even when Ollama is healthy. - Attach the chat model to the AI node or chain used by your n8n version. Provide a short test prompt, for example, “Return the input text as one sentence.”
- Run the workflow manually and inspect the model output before adding downstream actions.
Node names and field labels can change between n8n releases. If your editor presents an AI Agent, chain, or prompt-template node with a slightly different label, use the node’s model input and select the Ollama Chat Model there. The essential configuration remains the credential, reachable Base URL, and exact pulled tag.
Keep the first test deliberately small
A short prompt and a short expected response make failures easy to classify. Do not begin with a large document, a long agent loop, or several external integrations. First establish that one prompt produces one response. Then add input mapping from the trigger, formatting, persistence, and error handling one component at a time.
Docker: route the container to Ollama
Inside a container, localhost points to the n8n container itself. It does not point to Ollama running on the host. This distinction explains many otherwise confusing credential failures.
n8n in Docker, Ollama on the host
Use the host gateway name in the credential:
http://host.docker.internal:11434
Docker Desktop commonly provides that hostname. On Linux, it is not automatically defined in every setup. Add a host-gateway mapping when starting the container:
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
--add-host=host.docker.internal:host-gateway
In Docker Compose, the equivalent is an extra_hosts entry for the n8n service. The syntax is conceptually:
extra_hosts:
- 'host.docker.internal:host-gateway'
Use the mapping with the Compose file and Docker version you operate; the key requirement is that the container can resolve host.docker.internal to the host gateway.
Make Ollama reachable beyond loopback only when necessary
An Ollama process bound only to the host’s loopback interface may reject traffic arriving from a container. One deployment guide suggests setting OLLAMA_HOST=0.0.0.0 so Ollama listens on interfaces reachable from Docker. Another approach is to place Ollama and n8n in the same Compose network and address the Ollama service by its Compose hostname, commonly ollama.
Binding to 0.0.0.0 can expose the service on every network interface. Treat it as a deliberate network change: restrict access with Docker networking and host-firewall rules, and do not expose an unauthenticated Ollama endpoint to the public internet.
Recommended Free Tools
Both services in one Compose network
When n8n and Ollama are separate services in one Compose project, configure the n8n credential with the Ollama service name and port:
http://ollama:11434
The hostname must match the service key in your Compose file. A service called local-model, for example, would be addressed as http://local-model:11434, not http://ollama:11434. Test name resolution from inside the n8n container and then run the n8n credential test.
Three ways to call Ollama from n8n
The native node is not the only option. Choose the interface that matches how much control and reuse your workflow needs.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
| Method | Best fit | Strength | Trade-off |
|---|---|---|---|
| Native Ollama Chat Model | New AI workflows | Simplest setup and direct use of the Ollama credential. | Depends on the AI-node interfaces available in your n8n release. |
| OpenAI Chat Model pointed at Ollama | Existing workflows built around OpenAI-compatible nodes | Lets you reuse node and chain designs that already expect an OpenAI-style chat endpoint. | You must configure Ollama’s OpenAI-compatible /v1 endpoint and still provide a model tag Ollama recognizes. |
| HTTP Request node | Custom payloads, non-chat generation, or maximum control | Direct access to Ollama’s /api/generate API and its request fields. |
You must build the request body, parse the response, and handle errors yourself. |
Using the OpenAI-compatible endpoint
Point the OpenAI-style node at Ollama’s /v1 endpoint rather than a third-party server. Keep the model field equal to the exact local tag. Authentication fields may still be required by the n8n node even when your private Ollama server does not enforce a key; follow the node’s current credential requirements and do not invent a production secret.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Using an HTTP Request node
For a raw call, set the method to POST, use the reachable Ollama URL ending in /api/generate, send JSON, and include at least the model and prompt. Set stream to false when your following n8n nodes expect one complete JSON item. A guide specifically recommends disabling streaming because token-by-token responses are harder for ordinary n8n nodes to parse. If you need streaming, design an explicit parser and verify how your n8n version handles streamed chunks.
Diagnose failures in the right order
Use this sequence instead of changing several settings at once.
1. Prove the server responds from the same network location
Run the direct API test on the same host, or from inside the n8n container when Docker is involved. A request that works on the host but fails inside the container indicates routing, DNS, binding, or firewall trouble rather than a model problem.
2. Check the address
- Same host: try
localhost, then127.0.0.1. - Container to host: use
host.docker.internaland add the Linux host-gateway mapping when required. - Shared Compose network: use the Ollama service hostname, not host loopback.
- Custom listener: enter the value configured by
OLLAMA_HOST, including its port.
3. Check whether Ollama is listening where you think it is
A service bound only to loopback can answer local shell commands while rejecting container traffic. If you change the listener, restart Ollama and retest from the n8n network location. Do not leave a broad listener enabled without network controls.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problems4. Check the model tag exactly
“Model not found” generally means the tag in n8n is not the tag Ollama has pulled. Compare spelling, punctuation, and variant suffixes. Test the same value with ollama run or the direct API request before changing n8n nodes.
5. Separate credential errors from workflow errors
If the credential test fails, fix URL reachability first. If the credential test succeeds but a workflow fails, inspect the selected model, prompt mapping, node connection, and response parsing. For an HTTP Request workflow, verify that the body is valid JSON and that downstream expressions reference the response property actually returned by your Ollama API call.
Best Value
6. Treat timeouts as an operational issue
Local inference can take longer than a hosted API, especially for a first request or a larger prompt. Start with a short prompt and modest output, then increase workload gradually. Check n8n execution logs and the Ollama process output to determine whether the request is still running, was refused, or returned an error.
Privacy, exposure, and reliability considerations
Running the model locally can keep prompts and responses inside infrastructure you control, but that benefit depends on your network design and workflow integrations. If a workflow sends the generated text to an external email, database, SaaS connector, or webhook, that step may move the data outside the machine even though inference happened locally.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall- Keep Ollama on a private interface or Docker network whenever possible.
- If a container requires a non-loopback listener, limit inbound access with firewall rules and network policy.
- Do not assume that an exposed Ollama endpoint provides authentication. Put an authenticated, encrypted reverse proxy in front of any service that must be reachable outside your private network.
- Store n8n credentials using n8n’s credential system rather than hard-coding URLs or tokens in prompts and Function/Code nodes.
- Record the model tag and workflow version used for important outputs so a later model pull does not silently change behavior.
A hosted n8n instance cannot reach your private localhost directly. One hosting guide recommends exposing Ollama with authentication and HTTPS for that arrangement, but the exact networking and security requirements depend on the hosting product. Treat public exposure as an infrastructure project, not as a change to one credential field.
Useful local workflow patterns
Private document triage
A trigger can receive a document or text field, a preprocessing node can remove irrelevant formatting, and the Ollama Chat Model can assign a category and extract fields. Store the original input beside the model output so a person can audit the classification. Begin with a small sample and constrain the prompt to a predictable format before connecting automated routing.
Local summarization
Split long content into manageable items, summarize each item with the model, and combine the summaries in a final step. This keeps individual requests easier to diagnose than one oversized prompt. If you use an HTTP Request node for this pattern, disable streaming unless you have deliberately implemented chunk parsing.
Structured notification drafting
Have the model return a short subject and body, then pass those fields to a review or approval step rather than sending automatically on the first iteration. Keep external delivery after the local generation node so a connection failure cannot create a partially sent notification.
Retrieval-assisted workflows
n8n deployments are often paired with a vector store or other retrieval component, but the retrieval layer is separate from the Ollama connection. First verify the model call with plain text. Add embeddings, retrieval, and source citations only after the basic chat-model path works, and confirm that the model you select supports the input format required by your retrieval design.
Maintenance checklist
- Confirm Ollama is running after a reboot or container restart.
- Keep a record of pulled model tags; do not rely on a family name that may resolve differently later.
- Retest the n8n credential after changing ports, Docker networks,
OLLAMA_HOST, or Compose service names. - Keep a minimal diagnostic workflow with one trigger and one model call.
- Review prompts and downstream integrations for sensitive data before enabling unattended execution.
- Recheck current n8n and Ollama documentation when node names, credential fields, Docker flags, or environment-variable behavior change.
The practical decision
For a same-machine installation, the shortest reliable path is: start Ollama, pull and directly test a model, create an n8n Ollama credential at http://localhost:11434, select the native Ollama Chat Model node, and use the exact pulled tag. For Docker, replace localhost with a host-gateway or Compose service route and verify connectivity from inside the n8n network. Use the OpenAI-compatible endpoint when reusing existing OpenAI-style workflows, or an HTTP Request node when you need complete payload and parsing control. Keeping those boundaries clear makes local AI workflows predictable without sending the model request to a hosted provider.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




