Abstract illustration of glowing connected nodes on a dark background

How to Install and Use Langflow: A Step-by-Step Guide

This guide is based on the open-source project Langflow by langflow-ai, licensed under MIT.

Langflow is a visual builder for AI agents and workflows. Instead of writing a whole agent in code first, you drag components onto a canvas, connect them, and test the result in a built-in playground. Every flow you build can then be called as an API, so the visual design is not a dead end: it becomes a service your own app can use.

What Langflow is, and who it is for

A Langflow flow is a chain of components: an input, a prompt, a model, a tool or a data source, and an output. The component library covers the major model providers, vector databases, and common AI tools, and flows can also be deployed as MCP servers, so another agent can call your flow as a tool.

It suits developers and teams who want to prototype an agent or a retrieval-augmented (RAG) workflow quickly, and people who want to see the structure of an agent instead of holding it all in code. It is not a hosted chatbot: you still need a model provider, and you still own the deployment. If you prefer code alone, Langflow will feel like extra machinery; if you iterate on prompts, tools, and retrieval, the canvas saves real time.

One security fact shapes the whole guide: Langflow executes code by design. Treat a Langflow server like any other app server. Keep it behind authentication, keep it updated, and do not expose an unauthenticated instance to the internet.

Prerequisites

The documentation I checked does not publish a single hardware minimum for Langflow itself. The practical limits are the models and data sources your flows use, and how many flows run at once, so a small test flow and a production workload are very different machines.

Step 1: Install with uv, the recommended route

From a fresh directory, install Langflow and start it:

uv pip install langflow -U
uv run langflow run

Before that first start, set your superuser password in the environment so you are not locked into a default. The exact variable is LANGFLOW_SUPERUSER_PASSWORD; set it in the same terminal session you start Langflow from, and keep the value in your own password manager, not in a shared file.

Langflow starts at:

http://127.0.0.1:7860

Sign in with the username langflow and the password you set. If you need to bind a specific host or port, the documented flags are:

uv run langflow run --host 127.0.0.1 --port 7860

Keep the host at 127.0.0.1 for local use. Binding to all interfaces without a reverse proxy and authentication in front is how a local test instance becomes a public one.

Step 2: Alternative paths — Docker and Desktop

Docker. Set a strong password first, without typing it in plain sight in your shell history where you can avoid it, then start the container:

docker run -p 7860:7860 -e LANGFLOW_SUPERUSER_PASSWORD langflowai/langflow:latest

Open http://localhost:7860/ and sign in as langflow with the password you set. Official Docker images require authentication by default. For a keeper instance, do not use a throwaway container flag that deletes the container on exit: use a named container that you can restart, and check the Docker deployment guide for the current persistent-storage options for your image version before you build flows you care about.

Desktop. Langflow Desktop bundles all dependencies into a native app for Windows and macOS. Download it from the project's release or download page if you want to skip Python and Docker entirely. The canvas, flows, and API behaviour are the same; only the install method differs.

Step 3: Build your first flow

From the Langflow home screen, create a new blank flow. A minimal chat flow has four parts, connected in order:

  1. Chat Input: the component that receives the user's message.
  2. Prompt: the template that shapes how that message is presented to the model.
  3. A model component: one for your provider, for example an OpenAI component for a hosted model, or an Ollama component for a local model. Add your API key or local server details here, and select the exact model name.
  4. Chat Output: the component that returns the model's reply.

Connect the components by dragging from one component's output to the next component's input, then open the Playground and ask a question. If the answer comes back, the wiring is right. If it does not, check the model component first: the wrong API key, the wrong model name, or a local server that is not running are the usual causes, and Langflow will show the error from the provider rather than a generic failure.

Save the flow with a clear name. A saved flow is the unit you will test, share, and deploy, so a name that says what it does is worth more than a clever one.

Step 4: Run the flow as an API

Every flow is also an API endpoint. Open the flow's API panel, which shows a ready-made request snippet for that flow, including the flow's identifier and the authentication header it expects. Copy that snippet rather than typing the endpoint from memory: the identifier and the header format are exactly the details that are easy to get wrong.

Call the endpoint from your own app or from a terminal with the snippet as given, and confirm you get the same answer the Playground gave. If the API call fails while the Playground works, the difference is almost always authentication or the flow identifier, so compare the snippet character by character before changing the flow itself.

For a team workflow, export the flow as JSON and keep it in version control alongside the app that calls it. That way a flow change is a reviewed change, not an untracked edit in a browser tab.

Common errors and fixes

ProblemFix
Port 7860 is already in useAnother Langflow instance, or another app, is already on that port. Stop it, or start Langflow with a different --port value.
You cannot sign in after installRelease packages disable automatic login. Make sure LANGFLOW_SUPERUSER_PASSWORD was set in the same session before the first start, and sign in as langflow with that password.
langflow command not foundThe install did not put it on your PATH, or you are in a different Python environment from the one you installed into. Re-run the install in the environment you intend to use, and use uv run langflow run so uv resolves it.
Python version errorLangflow's documented range is Python 3.10–3.14. Check with python --version and use a matching version, or switch to the Docker or Desktop path, which do not need a host Python.
The model component errorsCheck the API key, the exact model name, and whether a local server such as Ollama is actually running. Test the same model outside Langflow first to separate a provider problem from a flow problem.
Flows disappear after a Docker restartYou ran a throwaway container, or storage was not persisted. Use a named, restartable container and set up persistent storage following the Docker deployment guide for your image version before rebuilding flows.
The Playground works but the API call failsCompare the API panel snippet exactly: flow identifier and authentication header. A copied identifier with a typo, or a missing header, is the usual cause.
An old version has a known vulnerabilityUpdate Langflow promptly and check the project's security advisories. Because Langflow executes code, an outdated, exposed instance is a much bigger risk than an outdated local tool.

FAQ

Do I need an API key? Not for Langflow itself, but you need one for a hosted model provider, or a running local server such as Ollama for a local model. Langflow without a model is a canvas with nothing to answer you.

Is my data sent anywhere? Your flows run on your machine or server. If a flow uses a hosted model, a vector database, or another hosted service, the data that flow sends goes to that provider under its terms.

Can I use Langflow without writing code? Yes, for building and testing flows. You will still need code, or a tool that makes HTTP requests, to call a flow from your own app, unless you use the Playground only.

Can a flow become an MCP server? Yes. Langflow can deploy a flow as an MCP server, so an MCP client can call it as a tool. Check the current docs for the exact deployment steps for your version, since this area changes quickly.

Should I expose Langflow to the internet? Not directly, and never without authentication. Put a reverse proxy with TLS and authentication in front of it, keep it updated, and treat it as an app server, not a demo page.

What to try next

Once the chat flow works, add one real step at a time: a second prompt that rewrites the question, a data source that grounds answers in your own documents, and then one tool the model can call. After each addition, test in the Playground and through the API. That order tests the three things Langflow is actually for: wiring, grounding, and deployment, without changing three things at once.

This guide was written with AI assistance and checked against the official documentation as of October 30, 2026.

Sources

Get the next guide first

One short email when a new guide or Weekly issue is published. No spam, and you can leave any time.