The quickest way to run Langflow yourself is Docker: start the official image on port 7860, create an administrator password, and open http://localhost:7860/. For anything you need to keep, move to Docker Compose with PostgreSQL, persistent volumes, and an environment file. Once Langflow is running, you can assemble visual AI workflows from typed components, save versioned flows, package them into a custom image, and expose the installation through a reverse proxy with HTTPS.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What self-hosting Langflow actually involves
Langflow is a visual way to represent an AI application as a flow. A flow receives input, passes it through components such as prompts, language models, retrievers, and output handlers, then returns a result. Components are the individual steps; connections carry typed data between their ports. When you run a flow, Langflow constructs a directed acyclic graph (DAG) from the nodes and edges, validates and prepares the components, sorts them by dependency, and executes them in that order.
As an Amazon Associate I earn from qualifying purchases.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsSelf-hosting means the Langflow server, its configuration, its flow definitions, and its database run on infrastructure you control rather than on a hosted Langflow service. That gives you control over network access, provider credentials, upgrades, backups, and where uploaded files and flow history are stored. It also makes you responsible for authentication, TLS, patching, storage, and recovery.
Choose the right Docker deployment
| Approach | Best for | What you get | What you still need to add |
|---|---|---|---|
Single docker run |
Testing Langflow locally or validating a host and port | One command, the official image, and a web UI on port 7860 | Durable database storage, environment-file management, and additional services |
| Docker Compose with PostgreSQL | A persistent development or small production installation | Separate Langflow and database services, named storage, and repeatable configuration | Backups, upgrades, network hardening, and a reverse proxy if public |
| Remote Docker server with a reverse proxy | Private team access or a public URL on one server | Centralized hosting with Caddy or Nginx and TLS automation | DNS, firewall rules, authentication policy, monitoring, and incident recovery |
| Kubernetes or a cloud-specific deployment | Teams that already operate orchestration or managed infrastructure | Production-grade scheduling and scaling options | Cluster operations, secrets management, persistent volumes, and more complex upgrades |
Use the single container first. It confirms that Docker works, the host can expose port 7860, and your credentials are accepted. Move to Compose when losing flows after container replacement would be unacceptable or when you need PostgreSQL, a .env file, or companion services.
#1 Best Overall
Run Langflow locally in one container
1. Install and start Docker
Install Docker for your operating system, start its engine, and confirm that the Docker CLI can launch containers. The exact installation screens differ by platform, so the important prerequisite is a running Docker daemon with permission to publish a host port.
2. Start the official image
Run the official image with automatic login disabled and a strong administrator password:
docker run -p 7860:7860 -e LANGFLOW_AUTO_LOGIN=false -e LANGFLOW_SUPERUSER_PASSWORD=SUPERUSER_PASSWORD langflowai/langflow:latest
Replace SUPERUSER_PASSWORD with a unique secret. The image publishes the container’s port 7860 on the same port of your host. Open http://localhost:7860/ in a browser and sign in. If another process already occupies port 7860, publish a different host port while leaving the container port unchanged, for example -p 8080:7860, then browse to http://localhost:8080/.
3. Treat this run as disposable
A container can be replaced without warning when you use a mutable latest tag or remove it manually. Without mounted application data and a persistent database, files and saved state inside the container should not be considered a backup. Use this mode to learn the interface, test provider credentials, or check that a flow works before creating a durable deployment.
Create a durable Docker Compose installation
The repository’s Compose example separates the Langflow service from PostgreSQL and accepts configuration through a .env file. The exact file can evolve with Langflow releases, so treat the following as a clear starting layout and compare it with the example that ships with the release you select.
1. Create an environment file
Store secrets outside the Compose YAML. A typical environment file defines the PostgreSQL connection and Langflow settings listed by the official example:
POSTGRES_USER=langflow
POSTGRES_PASSWORD=replace-with-a-long-random-secret
POSTGRES_DB=langflow
LANGFLOW_DATABASE_URL=postgresql://langflow:replace-with-a-long-random-secret@postgres:5432/langflow
LANGFLOW_CONFIG_DIR=/app/langflow
LANGFLOW_SUPERUSER_PASSWORD=replace-with-a-different-admin-secret
Use a different value for the database password and the Langflow administrator password. Keep the file readable only by the account that runs the deployment, and do not commit it to source control.
Rank #2
2. Define the services
This Compose pattern gives Langflow a persistent application-data mount and PostgreSQL a named volume. The PostgreSQL hostname in the connection string is the Compose service name, not localhost.
services:
langflow:
image: langflowai/langflow:1.12.0
ports:
- 7860:7860
env_file:
- .env
environment:
LANGFLOW_DATABASE_URL: ${LANGFLOW_DATABASE_URL}
LANGFLOW_CONFIG_DIR: ${LANGFLOW_CONFIG_DIR}
LANGFLOW_AUTO_LOGIN: false
LANGFLOW_SUPERUSER_PASSWORD: ${LANGFLOW_SUPERUSER_PASSWORD}
volumes:
- ./langflow-data:/app/langflow
depends_on:
- postgres
postgres:
image: postgres:16
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- langflow-postgres:/var/lib/postgresql/data
volumes:
langflow-postgres:
The service names, image tags, and environment keys should match the Langflow Compose example for the release you deploy. The important design is separation: application files are mounted outside the container, while database files live in a named PostgreSQL volume. Replacing the Langflow container therefore does not erase the database or flow files.
3. Start and verify the stack
- Create a directory for the deployment, save the Compose file and
.envthere, and review every secret before starting. - Run
docker compose up -d. - Check service status with
docker compose psand inspect startup messages withdocker compose logs -f langflow. - Open
http://localhost:7860/, sign in, create a test flow, run it, and confirm that it remains afterdocker compose downfollowed bydocker compose up -d.
Do not use docker compose down -v on a deployment you intend to keep: removing volumes deletes the persistent database volume. Use it only when you deliberately want a clean reset.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Persist data, flows, and version history correctly
Langflow flows are serializable and can be saved and loaded from the installation’s filesystem. Saved versions are also stored in the deployment database, which is why a persistent PostgreSQL volume matters for version history. Mount the Langflow data directory outside the container and keep the database in a named volume or an equivalent managed persistent disk.
- Application data: mount the directory configured by
LANGFLOW_CONFIG_DIRso container replacement does not remove local files. - Flow history and metadata: keep PostgreSQL on persistent storage; an ephemeral database defeats version retention.
- Uploaded documents: identify where your flows write files and include that path in your backup plan.
- Secrets: store administrator and provider credentials in protected environment or secret-management systems, not in exported flow JSON.
Back up PostgreSQL before upgrades and before changing image profiles. Also copy the mounted Langflow data and any directories used by file-based components. Test restoring those copies on a separate instance instead of assuming that a successful database dump is a complete application backup.
Pin the image and select the correct profile
The latest tag is convenient for a first run but mutable. Production deployments should use a release tag such as langflowai/langflow:1.12.0; when reproducibility matters, pin the registry digest as well. Keep the previous image reference until the new one passes verification so you have a known rollback target.
Langflow publishes base, default, and extended image profiles. They differ in the provider and component inventory they include. Choose the smallest profile that contains every provider extension used by your flows. A smaller image reduces unnecessary packages, but omitting a required extension prevents a saved flow from running until that extension is added.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
| Image choice | Advantage | Risk or limitation | Decision rule |
|---|---|---|---|
latest |
Fastest way to try current software | Content can change between deployments, complicating rollback | Use for exploration, not a reproducible production release |
| Pinned release tag | Repeatable version selection, such as 1.12.0 | You must plan upgrades | Use for normal deployments and documented change windows |
| Pinned tag plus digest | Reproduces the exact registry image | Digest updates require an intentional change | Use when auditability and deterministic rebuilds matter |
| Base profile | Smaller provider/component inventory | Flows requiring omitted integrations will fail | Use only after checking every flow’s dependencies |
| Default or extended profile | Broader provider and component coverage | Larger image and more packages to maintain | Choose the smallest profile that covers your actual workflows |
Upgrade without trapping yourself
- Export or dump the PostgreSQL database and copy mounted application data.
- Pull the candidate image and record its tag and digest.
- Start a temporary instance against a copy of production data, never the only live database.
- Run smoke tests for login, flow loading, flow execution, file access, and provider credentials.
- Keep the previous image and backup until the candidate passes all checks.
- After a database migration, do not run an older application against that migrated database unless the downgrade path is explicitly documented.
Build your first AI workflow in Langflow
Start from a blank flow or template
Langflow lets you create a blank flow, start from a template, duplicate an existing flow, or import one. The template collection includes a Basic Prompting example and a Vector Store RAG example with separate ingestion and retrieval sub-flows. Templates are useful because they show compatible components and connections before you design your own graph.
Assemble a basic chat flow
- Create a new blank flow or open the Basic Prompting template.
- Add a Chat Input component to receive the user’s message.
- Add a Prompt or instruction-template component and connect the incoming message to its text or variable port.
- Add a Language Model component, select a provider supported by your image profile, and enter its credential through the deployment’s protected configuration.
- Add Chat Output and connect the model response to it.
- Run the flow with a short test message, inspect each component’s output, then save the flow and give it a versioned name.
Components are available through the Core components and Bundles menus. Connections are typed: a message port carries text intended as a message, while other ports may carry documents, embeddings, or configuration objects. If a connector refuses to attach, check that the source and destination types are compatible rather than forcing a connection.
Add retrieval-augmented generation
A RAG workflow adds a document-ingestion path and a question-answering path:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →- Use a document loader to read the files your application is allowed to access.
- Split documents into chunks sized for the selected model and retrieval strategy.
- Create embeddings for those chunks and write them to a vector store.
- Connect a retriever to the vector store so a user question can fetch relevant chunks.
- Pass the retrieved context and the user’s question into a context-aware prompt.
- Send that prompt to the language model and return the answer through Chat Output.
The ingestion and retrieval portions can be separate sub-flows. Ensure that the Docker image profile includes the loader, embedding provider, vector-store integration, and model components you selected. If an extension is absent, a flow may import successfully but fail at execution time; install an image profile containing it, or rebuild the image with the required extension before relying on the flow.
Understand what happens at run time
Langflow validates the graph, prepares component parameters, determines dependencies, and executes nodes in dependency order. A cycle or an unconnected required input prevents a valid execution. Test from the edges inward: first confirm input, then prompt rendering, then model credentials, then retrieval, and finally output formatting. Save a working version before making structural changes so you can compare or restore it.
Package a flow into a custom image
For a repeatable hand-off, put exported flow JSON files in a project directory and build a derived image. The official pattern copies JSON files into /app/flows and sets LANGFLOW_LOAD_FLOWS_PATH:
FROM langflowai/langflow:latest
RUN mkdir /app/flows
COPY ./*.json /app/flows/
ENV LANGFLOW_LOAD_FLOWS_PATH=/app/flows
For a real deployment, replace latest with the release tag and, when required, its digest. With the Dockerfile and JSON files in the same directory, build and run the image:
Rank #4
- This dive logbook is made from genuine cowhide leather, and just like fingerprints, each piece is one-of-a-kind. Each logbook flaunts its own unique personality with varying colors, textures, and markings. Over time, the leather develops its own charming "battle scars," making it even more beautiful and uniquely yours. It's like your favorite pair of jeans – the more you use it, the cooler it gets
- Its compact A6 size (5.1in x 7.5in) makes it super easy to carry around, letting you jot down your dive logs anytime, anywhere. Whether you toss it in your dive bag or take it on the go, it’s a breeze to bring along. Perfectly suited for A6 dive logs and A6 binders. Think of it as your trusty sidekick – always ready for the next adventure
- This dive logbook isn't just a pretty face – it's got some serious chops too. The genuine leather cover laughs in the face of splashes, and the 120g high-quality paper ensures your notes won't dissolve into a soggy mess. Perfect for those damp and drizzly dives
- 3 Card Slots: Perfect for stashing your dive cards, transit passes, and other important cards. 1 Zipper Pocket: Keep your valuables secure and safe. 4 Receipt Pockets: Perfect for holding tickets, passports, and other essential documents We’ve included 2 removable, expandable PVC pages: Transparent PVC Page: Holds up to 3 cards, making them easy to see and use. PVC Storage Bag: Specially designed waterproof bag for those items that just hate getting wet.
- Our dive logbook includes all the essential fields for divers to record every dive, such as date, dive site, conditions, equipment, dive stats, and dive verification, among others. With 50 pages designed to capture the key details of each dive adventure, it's perfect for PADI divers and fits the A6 size dive log requirements
docker build -t my-langflow:1.12.0 .
docker run -p 7860:7860 -e LANGFLOW_AUTO_LOGIN=false -e LANGFLOW_SUPERUSER_PASSWORD=replace-with-a-strong-secret my-langflow:1.12.0
You can push the tagged image to your organization’s registry when another server or deployment system needs it. Keep provider credentials out of the JSON and inject them at run time. A packaged flow is not a substitute for backing up PostgreSQL: the image distributes definitions, while the database preserves deployment state and saved versions.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Publish Langflow safely with HTTPS
Localhost is private to the machine. A public deployment adds DNS, firewall exposure, TLS certificates, authentication, and ongoing patch responsibility. Langflow’s deployment guidance describes four practical directions: a remote Docker server with Caddy as a reverse proxy, Nginx with Let’s Encrypt for automatic certificates, Kubernetes, and cloud-provider-specific guides.
Remote Docker server with a reverse proxy
Run Langflow on a server that has persistent storage, bind the application to an internal network, and let Caddy or Nginx terminate HTTPS on the public interface. Point a DNS name at the server, allow only the required web ports through the firewall, and proxy requests to the internal Langflow port. Keep PostgreSQL off the public interface.
Nginx and Let’s Encrypt
An Nginx reverse proxy can request and renew certificates through Let’s Encrypt. The proxy handles TLS while Langflow remains on the private Docker network. Verify renewal before declaring the deployment complete; an expired certificate is an outage even when the container itself is healthy.
Recommended Free Tools
Kubernetes or a cloud deployment
Kubernetes can provide scheduling, rolling updates, secrets, and persistent-volume abstractions, but it also adds cluster operations. Cloud-specific instructions vary by provider. Follow the provider’s guidance for managed databases, load balancers, certificate management, and secret storage rather than copying a local Compose file unchanged.
Public-deployment checklist
- Set
LANGFLOW_AUTO_LOGIN=falseand provide a strongLANGFLOW_SUPERUSER_PASSWORDbefore startup. - Use HTTPS and redirect plain HTTP after certificate issuance.
- Restrict inbound traffic with firewall or security-group rules.
- Keep PostgreSQL and Docker’s management interface off the public network.
- Store provider credentials as secrets and rotate them if logs or exports expose them.
- Back up the database and mounted data on a schedule, then test restoration.
- Pin the image version and retain the previous image until upgrade smoke tests pass.
- Monitor container health, disk capacity, certificate expiry, and database availability.
Troubleshoot common failures
| Symptom | Likely cause | Action |
|---|---|---|
| The browser cannot connect | The container is stopped, the port is occupied, or the host port differs from the URL | Run docker ps, inspect docker logs, and verify the published host port in docker run or Compose. |
| Login is skipped or unavailable | Automatic login was enabled or the administrator password was not supplied | Set LANGFLOW_AUTO_LOGIN=false and LANGFLOW_SUPERUSER_PASSWORD, then recreate the container. |
| Flows disappear after replacement | Data or PostgreSQL was stored only inside an ephemeral container | Use the external Langflow mount and named PostgreSQL volume described above, then restore from backup if needed. |
| Compose cannot reach PostgreSQL | The connection string uses localhost instead of the database service name, or credentials do not match |
Use the Compose service hostname, check both services’ environment values, and inspect PostgreSQL logs. |
| A saved flow imports but will not run | The selected image profile lacks a provider or component extension | Choose a profile containing every extension in the flow and retest against copied data. |
| A model call fails | Provider credentials are missing, invalid, expired, or unavailable to the container | Check the component configuration and secret injection, then run a minimal model test before debugging retrieval. |
| An upgrade starts but data looks wrong | A migration changed the database schema or the candidate image is incompatible | Stop using the old database copy, review migration logs, restore the backup to a test instance, and follow the documented rollback path. |
| HTTPS works intermittently | Proxy routing, DNS, firewall, or certificate renewal is misconfigured | Test DNS resolution, proxy-to-container connectivity, renewal logs, and firewall rules separately. |
A practical operating routine
- Develop locally with the single image or Compose, keeping flows small and testable.
- Export a known-good flow and record the Langflow release, image profile, provider components, and required secrets.
- Build a versioned image or deploy the pinned official image in a staging environment.
- Restore a copy of production data, then test login, flow loading, execution, file access, and provider credentials.
- Promote the candidate behind HTTPS only after those tests pass.
- Keep the prior image and a verified database backup through the change window.
- Document the image tag or digest, volume names, environment keys, proxy configuration, and recovery commands.
This sequence keeps experimentation fast while making the state that matters—flows, versions, files, and credentials—portable and recoverable.
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.




