How to get Ollama and Flowise run on a VPS in 2 separate docker Containers.

I had a problem while setting up my chatbot so I got solution. Ths is a very common setup when you want Flowise (frontend / orchestration) to talk to Ollama (model server) inside Docker.

Letโ€™s go step by step.


๐Ÿง  Concept

You have:

  • Container 1: Flowise (runs on port 3000 by default)
  • Container 2: Ollama (runs on port 11434 by default)

You want Flowise to send requests to Ollama from inside Docker, not just from your host machine.


๐Ÿ› ๏ธ Solution: Put Them on the Same Docker Network

1. Create a User-Defined Bridge Network

This lets the containers talk to each other by name.

docker network create ai-network

2. Run Ollama in That Network

docker run -d \
  --name ollama \
  --network ai-network \
  -p 11434:11434 \
  ollama/ollama

This exposes Ollama on http://ollama:11434 inside the Docker network (and http://localhost:11434 from your host).


3. Run Flowise in That Network

docker run -d \
  --name flowise \
  --network ai-network \
  -p 3000:3000 \
  flowiseai/flowise

Now both containers share the same virtual network and can see each other by name.


4. Configure Flowise to Use Ollama

In Flowise UI:

  • Go to Credentials โ†’ Create a new Ollama connection.
  • Use the internal container name as the Base URL:
http://ollama:11434

(Do not use localhost or 127.0.0.1 โ€” those refer to the Flowise container itself, not your Ollama container.)


5. Test the Connection

  • In Flowise, drop an Ollama node in your workflow.
  • Select the new credential with http://ollama:11434.
  • Test by sending a prompt โ€” you should get a response from the Ollama model.

๐Ÿงฉ Common Pitfalls

ProblemFix
Flowise says โ€œFetch failedโ€You are likely using localhost:11434. Use http://ollama:11434 instead.
Containers cannot talkCheck docker network inspect ai-network to see if both containers are listed.
Ollama not reachable from hostMake sure you used -p 11434:11434 so itโ€™s exposed on your machine.
Firewall blockingOpen port 11434 if you are trying to connect from another computer.

16

Discover more from CONTEXT EDUCATION

Subscribe to get the latest posts sent to your email.

Leave a Reply