# Free Self-hosted LangGraph Agent Server: how to separate API and queue workers using Docker

**URL:** <https://forum.langchain.com/t/free-self-hosted-langgraph-agent-server-how-to-separate-api-and-queue-workers-using-docker/3409>\
**Category:** LangSmith Product Help\
**Tags:** self-hosted\
**Created:** [April 15, 2026, 4:29pm UTC](https://forum.langchain.com/t/free-self-hosted-langgraph-agent-server-how-to-separate-api-and-queue-workers-using-docker/3409 "2026-04-15T16:29:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdrouet](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/gdrouet/32/2429_2.png) [@gdrouet](https://forum.langchain.com/u/gdrouet)\
**Post date:** [April 15, 2026, 4:29pm UTC](https://forum.langchain.com/t/free-self-hosted-langgraph-agent-server-how-to-separate-api-and-queue-workers-using-docker/3409/1 "2026-04-15T16:29:10Z")

</div>

Hi everyone,

I’m currently running the LangGraph Agent Server in a self-hosted setup (free version), using the `langchain/langgraph-api` Docker image.

From the scaling documentation, I understand that in a production setup there is a separation between:

- API servers (handling HTTP requests)

- Queue workers (executing runs asynchronously via Redis)

However, in my case I only have a single Docker image configured via environment variables.

My question is:  
**How can I run the Agent Server in “worker mode” using the Docker image?**

More specifically:

- Is there a specific command, entrypoint, or environment variable to start the container as a queue worker instead of an API server?

- Or is this mode only available in the LangSmith / managed or Helm-based deployments?

- If worker mode is supported, what is the expected way to connect it to Redis and have it consume jobs?

For context:

- I already have Redis configured (`REDIS_URI`)

- Currently, my container handles both API and execution

I’m trying to understand how to properly separate API and worker responsibilities in a self-hosted setup.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![pawel-twardziak](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/pawel-twardziak/32/960_2.png) [@pawel-twardziak](https://forum.langchain.com/u/pawel-twardziak)\
**Post date:** [April 15, 2026, 9:09pm UTC](https://forum.langchain.com/t/free-self-hosted-langgraph-agent-server-how-to-separate-api-and-queue-workers-using-docker/3409/2 "2026-04-15T21:09:41Z")

</div>

hi @gdrouet

imho you don’t need Helm or any licensed image for this. The `langchain/langgraph-api` image already contains a standalone queue-worker entrypoint, so you can reproduce the “Split API and queue” runtime (from [Agent Server → Runtime architecture](https://docs.langchain.com/langsmith/agent-server#runtime-architecture)) with plain `docker compose`: run the same image twice, set `N_JOBS_PER_WORKER=0` on the API container so it stops claiming runs, and on the worker container override the entrypoint with `["python", "-m", "langgraph_api.queue_entrypoint"]` - both pointed at the same `REDIS_URI` and `POSTGRES_URI`. That’s it. The fully _Distributed_ runtime with `langchain/langgraph-orchestrator-licensed` + `langchain/langgraph-executor` (what `langgraph dockerfile --engine-runtime-mode distributed` emits) is a separate, paid tier and not required for this. Just keep ≥1 worker alive (pending runs with no listener become orphaned - explicitly called out in the docs) and build a single image so both pools have your graph code. Happy to share a full compose snippet if helpful.

---

<div class="post-metadata">

**Author:** ![gdrouet](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/gdrouet/32/2429_2.png) [@gdrouet](https://forum.langchain.com/u/gdrouet)\
**Post date:** [April 20, 2026, 9:04am UTC](https://forum.langchain.com/t/free-self-hosted-langgraph-agent-server-how-to-separate-api-and-queue-workers-using-docker/3409/3 "2026-04-20T09:04:36Z")

</div>

It works perfectly thanks!

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/system/32/1_2.png) [@system](https://forum.langchain.com/u/system)\
**Post date:** [April 20, 2026, 9:04pm UTC](https://forum.langchain.com/t/free-self-hosted-langgraph-agent-server-how-to-separate-api-and-queue-workers-using-docker/3409/4 "2026-04-20T21:04:51Z")

</div>

Closed on April 20, 2026, 9:04pm UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
