---
title: Local Deployment (v2, docker compose)
sidebarTitle: Local Deployment (docker compose)
description: Step-by-step guide to run Langfuse on your local machine using docker compose.
label: "Version: v2"
---

# Local Deployment (v2, docker compose)

  This guide covers Langfuse v2. For Langfuse v3, see the [v3
  documentation](/self-hosting). Langfuse v2 receives security updates until end
  of Q1 2025. If you have any questions while upgrading, please refer to the [v3
  upgrade guide](/self-hosting/upgrade-guides/upgrade-v2-to-v3) or open a thread on [GitHub
  Discussions](/gh-support).

  This setup is **not suitable for production use** as the database is not
  persistent and environment variables are not kept secret. For a
  production-ready setup, follow the [deployment
  guide](/self-hosting/v2/deployment-guide) or consider using [Langfuse
  Cloud](https://cloud.langfuse.com) maintained by the Langfuse team.

You can run Langfuse on your local machine using docker compose. This method is ideal for testing Langfuse and troubleshooting integration issues.

Requirements: `docker` and `docker compose`, both are included in [Docker Desktop](https://docs.docker.com/get-docker/)
for Mac or Windows users.

## Getting Started

<Steps>

### Start the Langfuse Server

```bash
# Clone the Langfuse repository
git clone https://github.com/langfuse/langfuse.git
cd langfuse

# Checkout V2 branch
git checkout v2

# Start the database and langfuse server
docker compose up
```

Langfuse is now running on your local machine:

- The server is accessible at: `http://localhost:3000`
- Integrations: set the `HOST`/`BASEURL` of the SDKs to `http://localhost:3000`

Langfuse is very configurable, see [deployment guide](/self-hosting/v2/deployment-guide) for more details on configuration options.
Checkout the [docker-compose.yml](https://github.com/langfuse/langfuse/blob/v2/docker-compose.yml) file for more details.

### Create an Account

Create a new account at `http://localhost:3000/auth/sign-up`.

### Follow the Quickstart Guide

Follow the [quickstart guide](/docs/get-started) to get up and running with Langfuse Tracing or explore the rest of the [documentation](/docs).

</Steps>

## Updating Langfuse

Docker has robust caching functionalities. To fetch the latest Langfuse container, you need to run `docker compose pull langfuse-server`. Otherwise, Docker will use the cached version of the Langfuse container.

```bash
# Navigate to the Langfuse directory
cd langfuse

# Stop the server and database
docker compose down

# Pull the latest changes to the docker compose file
git pull

# Pull the latest Langfuse container
docker compose pull langfuse-server

# Restart the server and database
docker compose up
```

## Setting Up a Development Environment

Refer to [CONTRIBUTING.md](https://github.com/langfuse/langfuse/blob/main/CONTRIBUTING.md) for detailed instructions on how to set up a development environment.

## Troubleshooting

The [deployment guide](/self-hosting/v2/deployment-guide) is more extensive and includes troubleshooting steps which are also applicable to local deployments using docker compose.

## GitHub Discussions

---

If you experience any issues when self-hosting Langfuse, please:

1. Check out [Troubleshooting & FAQ](/self-hosting/troubleshooting-and-faq) page.
2. Use [Ask AI](/ask-ai) to get instant answers to your questions.
3. Ask the maintainers on [GitHub Discussions](/gh-support).
4. Create a bug report or feature request on [GitHub](/issues).

  Enterprise-grade support is available when self-hosting Langfuse. Learn more on
  our [pricing page](/pricing-self-host).

<!-- agent-instructions -->

---

## Agent Instructions

This page is part of the [Langfuse](https://langfuse.com) documentation, published as plain Markdown for AI agents. Every page is available as Markdown by appending `.md` to its URL, or by sending an `Accept: text/markdown` header. This page: `https://langfuse.com/self-hosting/v2/docker-compose.md`.

### Querying these docs

If the answer is not on this page, query the documentation instead of guessing:

- **Semantic search** across all Langfuse docs, returning an answer with the relevant pages and excerpts. Ask a specific, self-contained question:

  ```bash
  curl -sG "https://langfuse.com/api/search-docs" --data-urlencode "query=How do I trace a LangGraph agent?"
  ```

- **Index of every page**: <https://langfuse.com/llms.txt>, with per-section indexes [llms-docs.txt](https://langfuse.com/llms-docs.txt), [llms-integrations.txt](https://langfuse.com/llms-integrations.txt), and [llms-self-hosting.txt](https://langfuse.com/llms-self-hosting.txt).

### Before writing Langfuse code

- **Install the [Langfuse Agent Skill](https://langfuse.com/docs/api-and-data-platform/features/agent-skill).** It encodes Langfuse's own best practices for instrumentation, prompt management, and evaluation, and materially improves results.
- **Read [What does a good trace look like?](https://langfuse.com/docs/observability/best-practices.md)** before instrumenting an application.
- **Verify endpoints, parameters, and response fields** against the [API reference](https://api.reference.langfuse.com) instead of inferring them from code examples.
- **Use the [Langfuse CLI](https://langfuse.com/docs/api-and-data-platform/features/cli)** (`npx langfuse-cli api <resource> <action>`) to read or write traces, prompts, datasets, and scores from the terminal.

Found an error in these docs? Please open an issue at <https://github.com/langfuse/langfuse-docs/issues>.
