I’ve been experimenting with running local LLMs and DeepSeek R1 has really caught my attention. I’ve been following blog posts about how others have been running DeepSeek R1 locally, and I decided to try it on my own system. By using the locally hosted n8n for workflow automation and Ollama for execution it becomes a seamless local AI-powered system—no reliance on external APIs needed.
Setting it up on a local system using a container runtime is surprisingly easy. You can now run a self-hosted N8N system and Ollama as containers, getting them up and running in just a few minutes.
I’ve created this Docker Compose file with two services, making sure to mount local system folders as volumes for persistent data storage. This setup ensures my data stays intact even if the containers are restarted.
version: '3.9'
services:
ollama:
image: ollama/ollama
container_name: ollama
ports:
- 11434:11434
volumes:
- ./ollama:/root/.ollama
restart: unless-stopped
n8n:
image: n8nio/n8n:latest
container_name: n8n
ports:
- "5678:5678"
volumes:
- ./n8n_data:/home/node/.n8n
restart: unless-stopped
I’ve got the latest docker version installed in my local machine and started the containers with docker compose up -d. command. It will download the container images and start the containers in the local system.

Once the containers are up and running, make sure everything is working fine. You can check their status using one of these commands.

You can access the n8n system by going to http://localhost:5678. From there, you can create an account and request an activation key. It’ll be sent to your inbox within a few minutes. This activation key will register your version as the community version and unlock some paid features.

Now it’s time to pull some models from Ollama Library, you can also install the Ollama binary directly on your system, but personally, I prefer to run it as a container for easier management and isolation.
The Ollama binary is running in the container, and I used docker exec to launch it. From there, I was able to download the LLM model directly into the storage location. Since we’ve set up local volume mounts, the data is stored in the specified folders on my system, keeping everything persistent. I have downloaded “deepseek-r1:1.5b” and “deepseek-r1:7b” models.

Next, drag and drop the “On chat message” from the trigger section, along with the “Basic LLM Chain” and “Ollama Chat Model” into the canvas. This will set up the flow for the chat model integration. If needed, you can always search for these nodes using the search bar. Connect them to complete the workflow integration.

I selected the “Connected Chat Trigger Node” as the source for the prompt in the “Basic LLM Chain” prompt. This way, the user message will be passed from the trigger node directly into the LLM chain, making the integration seamless.

Next, I selected the LLM model in the “Ollama Chat Model” node. For my initial testing, I went with the “deepseek-r1:1.5b” version since it’s lighter and perfect for quick trials. You can easily switch to a different version later if needed. Also, set the credentials to the local Ollama instance, credentials can be modified and must be set to the correct url.

Since both my n8n instance and the Ollama instance are running as containers, the communication between them needs to happen through the Docker network. For this, I selected http://host.docker.internal:11434 as the Ollama base URL to ensure they can communicate smoothly within the network. Tested the connection and confirmed as successful.

Now things are quite ready and can be tested. First you would see similar execution errors and can be fixed after testing the steps individually.

I’ve got my successful reply after the step testing.

Testing of the deployment
I had a lot of fun testing my deployment, and it’s clear that the deepseek-r1:7b model (with 7 billion parameters) outperforms the deepseek-r1:1.5b model (with 1.5 billion parameters). The difference in output quality is so noticeable that it’s almost hard to compare them.
Tried to do a little translation from Swedish to English with 1.5b model.

It didn’t make any sense and tried again with a small difference.

Didn’t work and switched to the 7b model and tried.

Finally, after everything, I got the correct translation. Running Local LLMs and DeepSeek R1 on my local machine was an incredible experience, and it was so much fun to see it all come together. Can’t wait to explore more and push the limits further!
Leave a Reply