How to deploy Langfuse with Docker
Quick answer
Deploy Langfuse with Docker by pulling the official Langfuse Docker image and running it with your API keys set as environment variables. Use
docker run to start the container exposing the necessary ports for the Langfuse server.PREREQUISITES
Docker installed on your systemLangfuse API key (set as environment variable)Basic knowledge of Docker commands
Setup
Install Docker on your machine if not already installed. Set your Langfuse public_key and secret_key as environment variables for secure access.
docker --version
# Example output:
# Docker version 24.0.5, build abcdefg
# Set environment variables in your shell
export LANGFUSE_PUBLIC_KEY="your_public_key"
export LANGFUSE_SECRET_KEY="your_secret_key" output
Docker version 24.0.5, build abcdefg
Step by step
Run the Langfuse Docker container with your API keys and expose the default port 8080. This example runs Langfuse server locally accessible at http://localhost:8080.
docker run -d \
-e LANGFUSE_PUBLIC_KEY=$LANGFUSE_PUBLIC_KEY \
-e LANGFUSE_SECRET_KEY=$LANGFUSE_SECRET_KEY \
-p 8080:8080 \
ghcr.io/langfuse/langfuse:latest output
a1b2c3d4e5f6g7h8i9j0 # Container ID printed, Langfuse server running
Common variations
- Use a
docker-compose.ymlfile for multi-service setups. - Configure Langfuse to use a custom port by changing
-pmapping. - Run Langfuse with persistent volume mounts for logs or config.
version: '3.8'
services:
langfuse:
image: ghcr.io/langfuse/langfuse:latest
ports:
- "8080:8080"
environment:
LANGFUSE_PUBLIC_KEY: ${LANGFUSE_PUBLIC_KEY}
LANGFUSE_SECRET_KEY: ${LANGFUSE_SECRET_KEY}
volumes:
- ./langfuse_data:/app/data Troubleshooting
- If the container fails to start, verify your API keys are correctly set as environment variables.
- Check Docker logs with
docker logs <container_id>for error messages. - Ensure port
8080is not blocked or used by another service.
docker logs <container_id> output
2026-04-01T12:00:00Z INFO Starting Langfuse server... 2026-04-01T12:00:01Z INFO Langfuse server listening on port 8080
Key Takeaways
- Use the official Langfuse Docker image from ghcr.io/langfuse/langfuse:latest.
- Set your Langfuse public and secret keys as environment variables for secure authentication.
- Expose port 8080 to access the Langfuse server locally or remotely.
- Use docker-compose for more complex deployments with volume persistence.
- Check container logs for troubleshooting startup or runtime issues.