Our security policy forbids sending our LLM traces to a third-party cloud. Has anyone set up Langfuse as a self-hosted instance using Docker? I specifically need to know the requirements for the Postgres database and if there are any issues with using RDS instead of a local containerized DB.
3 answers
Self-hosting is very well supported since it’s open-core. You can use the official Docker Compose file as a starting point. For AWS, running the web and worker containers on ECS Fargate works great. Regarding the database, using a private RDS Postgres instance is actually the recommended path for production. Just make sure your Postgres version is 14 or higher and that you have the pgvector extension enabled if you plan to use some of the experimental search features. You'll need to provide the DATABASE_URL and NEXTAUTH_SECRET as environment variables. Performance-wise, it's very efficient; a small t3.medium instance can handle a surprising amount of trace data if your ingestion rate isn't extremely high.
What about the blob storage for things like large prompt templates or attachments? Does it support S3 or just local volume mounting?
Make sure you also set up a ClickHouse instance if you want the high-performance analytics features to work on millions of traces.
Good tip, Natalie. For smaller teams, Postgres is fine, but ClickHouse is a must once you hit that enterprise-level scale of data.
It supports S3 for sure. You just need to configure the S3 bucket name and credentials in the environment variables. This is much better than local volumes if you're using Fargate, as it makes the application completely stateless. We've been running this setup for six months without any major issues, and it keeps all our sensitive prompt data within our own VPC, which kept our compliance team happy.