Langfuse headless initialization and provisioning: when teams automate the first organization
Platform teams that rebuild or clone Langfuse environments usually want the first organization, project, API keys and default access to exist before anyone logs in. On the open source version, the LANGFUSE_INIT_* variables create the first organization, project, keys and user at startup when they do not already exist, and LANGFUSE_DEFAULT_ORG_ID and LANGFUSE_DEFAULT_PROJECT_ID place new users into a default organization and project. The Instance Management API is a different tool: it is Enterprise Edition only, requires an Enterprise license key, and is not available on Langfuse Cloud. It creates, updates and deletes organizations and organization API keys, authenticated with an ADMIN_API_KEY bearer token.
Start by deciding which objects must exist on every fresh instance and which should be created by people later. Startup initialization is idempotent in intent, since the variables only create objects that are missing, but a project or user cannot be initialized without an organization, so the organization must always be defined first. Keep the LANGFUSE_INIT_* values in your secret store, not in a shared compose file, because the API keys they create are credentials. Confirm in your environment that the keys you generate can be rotated later without redeploying the whole stack, and document who owns each key after handover.
Default roles are the access decision with the largest effect. LANGFUSE_DEFAULT_ORG_ROLE and LANGFUSE_DEFAULT_PROJECT_ROLE set the role new users receive, and the default for both is VIEWER. Review the role names against your access model before going live, and test with a throwaway user that signs in through your identity provider. If you need organization-wide key management or organization creation at scale, that is where the Enterprise instance management API and its license key come into the plan. Ask your vendor or your DeployOpen contact to confirm which of these settings your Langfuse version supports before you write the deployment templates.
Default organization and project roles for new users
When one team or one company uses the instance as a shared observability platform, the default settings can be simple. Set LANGFUSE_DEFAULT_ORG_ID and LANGFUSE_DEFAULT_PROJECT_ID to the organization and project that everyone is expected to work in, so a new user signing in is added to them automatically. The role defaults to VIEWER, which is a safe starting point: people can read traces and prompts but cannot change settings or delete data. Raise the role only for users who need to write, using LANGFUSE_DEFAULT_PROJECT_ROLE with care, because every new sign-in inherits that role.
- Shared project: one default project gives every new user the same view of all traces.
- Viewer by default: keep LANGFUSE_DEFAULT_PROJECT_ROLE at VIEWER unless the whole group must write.
- Org role: set LANGFUSE_DEFAULT_ORG_ROLE deliberately, since it applies across every project in the organization.
- Manual promotion: elevate individuals in the UI after sign-in instead of raising the default for everyone.
- Review cadence: revisit the default when headcount or project count changes.
Confirm with your own sign-in test that a new account lands in the expected organization and project with the expected role before opening the instance to users.
When several business units or customers share one self-hosted instance, a default project can expose one team's prompts and traces to everyone. In this model, leave LANGFUSE_DEFAULT_PROJECT_ID unset or point it at a neutral onboarding project with no production data. Users then join a default organization at most, and project access is granted explicitly by an administrator. Keep the default org role at VIEWER and grant write access per project.
- No shared production project: do not default new users into a project that holds production traces.
- Organization boundary: use one organization per tenant or business unit where data separation matters.
- Explicit grants: add users to each project by hand or through a provisioning process.
- Project-level roles: these need an Enterprise license key, so confirm licensing before relying on them.
- Role design first: settle the Owner, Admin, Member, Viewer and None model before setting any default.
Check that the default organization, if one is set, contains no data that other tenants should not see, and test with two accounts from different teams.
When identities come from an SSO provider, sign-in itself becomes the access control point, so the defaults should match what the identity provider already decides. Langfuse supports SSO through Auth.js providers and can disable password sign-in or enforce SSO for given email domains. If group or role mapping happens in the identity provider or in a provisioning tool, keep LANGFUSE_DEFAULT_PROJECT_ROLE at VIEWER and let the provisioning step grant elevated roles. Avoid defaults that grant write access to users who have not yet been reviewed.
- Domain enforcement: pair default roles with SSO enforcement for your email domains.
- Provisioning owns elevation: grant Member or Admin through the provisioning flow, not the default.
- Deprovisioning: removing a user at the identity provider should be matched by a removal path in Langfuse.
- Automated access provisioning: Langfuse documents this topic separately, so review that guide with your identity team.
- Break-glass access: keep one reviewed administrator path for when SSO is unavailable.
Confirm which provisioning mechanism your edition supports and test that a user removed in the identity provider loses access in Langfuse.
Default roles only make sense after the role model is designed. Langfuse separates organization roles from project roles, and the Owner, Admin, Member, Viewer and None roles behave differently at each level. Project-level roles need an Enterprise license key, so on the open source edition the practical choice is between the organization role and whatever project access the edition allows. Decide who may view prompts, export data and delete traces before you write any default, because a permissive default is hard to walk back once users have signed in.
- Two levels: organization and project roles can differ, so map each team to both.
- License check: confirm whether project-level RBAC is included in your license before designing around it.
- Minimum role for sensitive actions: identify who needs rights for exports and deletions and keep those out of defaults.
- Written matrix: record the role for each group and project in a document reviewed by security.
- Test before rollout: sign in with each role and verify what it can see and change.
Confirm with Langfuse which role capabilities and license requirements apply to your version before finalizing the matrix.
Provisioning options and when each fits
This table compares the LANGFUSE_INIT variables, the default organization and project settings, and the Enterprise instance management API by purpose, edition, what each creates or changes, and when it fits. Read each row against your provisioning model: first-run bootstrap, onboarding of new users, or ongoing administration as code.
| Option | Edition and availability | What it creates or changes | When it fits |
|---|---|---|---|
| LANGFUSE_INIT variables | Open source, self-hosted only | On startup, creates an organization, project, API keys and a user if they do not already exist. A project or user cannot be initialized without an organization. | First-run bootstrap of a new instance so that automation can call the API from the start |
| LANGFUSE_DEFAULT_ORG_ID and LANGFUSE_DEFAULT_PROJECT_ID | Open source, self-hosted only | Adds new users to a named default organization and project so they do not start with no access | Small or single-team instances where every new sign-in should land in the same workspace |
| LANGFUSE_DEFAULT_ORG_ROLE and LANGFUSE_DEFAULT_PROJECT_ROLE | Open source, self-hosted only | Sets the role new users receive in the default organization and project. The documented default is VIEWER. | Keeping new users read-only until an administrator grants more access |
| Project-level RBAC roles | Enterprise license key required | Gives finer project roles beyond the basic defaults, so access is set per project | Multi-team instances where project boundaries must match internal access reviews |
| Instance Management API | Enterprise Edition only, not on Langfuse Cloud | Creates, updates and deletes organizations and organization API keys, authenticated with an ADMIN_API_KEY bearer token | Repeatable administration of many organizations from a pipeline, with the admin key stored in your secrets manager |
| Org management API with SCIM | Enterprise license key required | Automates organization membership from an identity provider. Confirm the exact provisioning behavior with the Langfuse documentation before design. | Organizations that manage user lifecycle in an identity provider and need deprovisioning to flow through |
Setting up headless initialization in a self-hosted deployment
This sequence turns a first Langfuse startup into a repeatable, reviewable setup, with the first organization, project, API keys and default roles defined in code and checked after each step.
Decide the organization and project structure
Before touching the deployment, agree on the single organization that the instance will start with, the first project inside it, and the default organization and project roles that new users should receive. Record these choices in the design document for the deployment, with the owner of each role. Initialization creates an organization before any project or user, so the organization is the root decision. The step is done when the security and platform leads have signed off on a short written table of organization, project, and default roles.
Generate and store initialization secrets outside the repository
Generate the values for the initial user credentials and the project API key pair, then place them in your secrets manager or the platform secret store used for the deployment. Do not commit them to the repository, a Helm values file in version control, or a shared chat. Confirm that the people who need the values can read them and that the deployment runtime can inject them as environment variables. The step is done when a dry read of each secret name from the runtime returns a value and the repository search finds no matching literal.
Set LANGFUSE_INIT and default variables in the deployment definition
Add the LANGFUSE_INIT_ORG_ID, LANGFUSE_INIT_ORG_NAME, LANGFUSE_INIT_PROJECT_ID, LANGFUSE_INIT_PROJECT_NAME, key, and user variables to the Langfuse Web and Worker definitions, referencing the secrets from the previous step. Set LANGFUSE_DEFAULT_ORG_ID, LANGFUSE_DEFAULT_PROJECT_ID, and the matching role variables for new users. Confirm the exact variable names against the headless initialization documentation for your Langfuse version before merging. The role variables default to VIEWER when unset, so state the intended role explicitly. The step is done when the rendered manifest or Compose file shows every variable and the diff contains no secret literals.
Start the stack and read the startup logs
Deploy the stack with the updated definition and watch the Langfuse Web container logs through the first startup, which is when initialization runs and database migrations apply. Look for confirmation that initialization completed and for any error about a missing organization, which Langfuse does not allow for a project or user. Migrations run automatically at startup, so wait for the web container to report ready before testing. The step is done when the web container is healthy and the logs show no initialization errors.
Verify the organization, project, keys and user exist
Sign in with the initialized user and confirm the organization and project appear with the names you set. Then make a test call to the public API using the initialized project key pair and confirm it authenticates against that project. Confirm the user is a member of the organization. If any object is missing, check whether the variable was set on both Web and Worker and whether the initialization values were already present from an earlier attempt, since initialization only creates objects that do not exist. The step is done when the organization, project, key test and user membership all pass.
Confirm a new user receives the default role
Invite or create a test user who is not the initialized user, using a test identity from your identity provider or a disposable email address in your domain. Sign in and check the organization and project membership and the role shown for that user. The role should match the value you set for the default variables, and a VIEWER default applies if you left the role unset. Remove the test user afterwards. The step is done when the recorded role matches the design decision from the first step and the result is written into the change record.
Apply the instance management API only after a license key
The Instance Management API is available only in the Enterprise Edition and requires an Enterprise license key, so skip this step on the open source deployment. Once a valid license key is installed, the ADMIN_API_KEY bearer token can be used to create, update and delete organizations and organization API keys. Treat the admin key as a privileged secret, store it with the other initialization secrets, and repeat the verification in this sequence against the API. The step is done when an API call with the admin key returns the expected organization and the key is recorded in your secrets manager.
What the Enterprise instance management API can create, update and delete
The Langfuse Instance Management API is an Enterprise Edition feature for self-hosted deployments, and it is not available on Langfuse Cloud. It creates, updates and deletes organizations and organization API keys. Every call is authenticated with a bearer token set in the ADMIN_API_KEY environment variable, so the API is an instance-level control plane rather than a way to manage projects, traces or prompts. Before planning any automation, confirm with Langfuse that your license tier includes this API, since the license key documentation lists it among the features that need an Enterprise license key.
The ADMIN_API_KEY is a high-value secret. Whoever holds it can create organizations and issue organization API keys, and deleting an organization removes its projects and their data, so the key should be stored in a secrets manager, injected only into the job or pipeline that needs it, rotated on a schedule and scoped to a limited set of network paths. Project API keys work differently: they belong to one project, authenticate SDK ingestion and project-level API calls, and cannot manage the instance. Platform teams should treat the two as separate credential classes with separate owners, audit trails and rotation rules.
A reasonable split is to automate the repeatable, reviewable steps and keep destructive or policy decisions manual. Organization creation, organization API key issuance for CI or deployment tooling, and records of which organizations exist are good candidates for infrastructure-as-code, with changes reviewed in the same way as other configuration. Organization deletion, key revocation during an incident and changes that affect data retention should stay under a human approval step. Organization-level user automation is a different Enterprise feature: the org management API with SCIM is documented separately, so confirm which of the two your identity team needs before designing the provisioning flow.
Security risks in automated provisioning
Scripted initialization and instance management move access decisions out of the UI and into configuration, pipelines and admin keys. The risks below share one root cause: a privileged setting is applied automatically, so its exposure, scope and history must be designed in before the first startup.
Initialization secrets in plain configuration
The LANGFUSE_INIT_* variables create the first organization, project, API keys and user, and the ADMIN_API_KEY authenticates the Instance Management API. If these values sit in a compose file, a Helm values file or a repository, anyone who can read that file can create organizations or keys. Keep them in your secrets manager, inject them at deploy time, and confirm which values appear in container inspection output, CI logs and deployment history before go-live.
Default roles broader than intended
LANGFUSE_DEFAULT_ORG_ROLE and LANGFUSE_DEFAULT_PROJECT_ROLE apply to every new user who joins the default organization and project. The documented default for the project role is VIEWER, but a team that sets a higher role for convenience gives every future sign-in that access without a review. Decide the default roles in writing, set them explicitly rather than relying on defaults, and test a new SSO account to see what it can reach.
Initialization drift between environments
When development, staging and production are initialized by different scripts or by hand, they quietly diverge in organization names, project structure, roles and key sets. Applications then point at keys that exist in one environment only, and access reviews compare unlike systems. Keep one versioned initialization definition, parameterize only the secret values and hostnames, and compare the effective settings across environments after each deployment.
Missing audit trail for scripted changes
Organization and key changes made through the Instance Management API or by a restart with new initialization values may not be attributable to a person. A pipeline run can create or delete an organization without a named approver. Before relying on this path, confirm with Langfuse which API actions are captured in audit logs, who can read them, and how long they are kept, and tie each pipeline run to a change record in your own system.
Rotating keys created at startup
Keys created by LANGFUSE_INIT_* values are easy to forget once the application is running, and changing the environment variable does not remove an existing key. The same applies to the ADMIN_API_KEY, which can reach every organization on the instance. Record each key's owner and consuming service, define a rotation procedure that creates the replacement, updates consumers and then revokes the old key, and test that procedure in staging before production.
Admin API scope and Enterprise access
The Instance Management API is an Enterprise Edition feature and is not available on Langfuse Cloud, so it adds a privileged control plane on infrastructure you run. Limit network reachability of the API to your automation hosts, restrict the ADMIN_API_KEY to the pipeline that needs it, and document which actions the pipeline is allowed to take. Confirm the license key state of each environment before relying on the API in a runbook.
How provisioning flows from deployment config to running instance
The flow starts in the deployment definition, where LANGFUSE_INIT_* and default role variables are set alongside the settings for PostgreSQL and ClickHouse. Langfuse Web and Worker start against those data stores, and the initialization step creates the first organization, project, API keys and user only if they do not already exist. Check that the organization is defined before any project or user, and that default roles match what new users should get. The Enterprise branch is separate: a script calls the instance management API with an ADMIN_API_KEY bearer token to manage further organizations and organization API keys.
Provisioning inputs, startup hand-offs and the optional Enterprise API branch.
Questions teams ask before automating Langfuse provisioning
Can the open source version of Langfuse be initialized without a UI?
Yes. The LANGFUSE_INIT_* variables create an organization, a project, API keys and a user on startup if they do not already exist, and the default organization and project settings add new users to a shared workspace, all without a manual setup step. The Langfuse documentation describes these features as part of self-hosting, and the core features and APIs are available in the MIT-licensed version without limits. The practical limit is that a project or user cannot be initialized without an organization, so the variables must be ordered from the top down. Confirm the exact behavior for your target release in the headless initialization docs before writing your deployment templates, because startup behavior can change between versions.
Which provisioning features need an Enterprise license key?
The instance management API and the organization management API with SCIM need an Enterprise license key, and so do project-level RBAC roles, protected prompt labels, data retention policies, audit logs, server-side data masking, UI customization and organization creators. The instance management API is Enterprise Edition only and is not available on Langfuse Cloud, and it authenticates with an ADMIN_API_KEY bearer token. Headless initialization and default org and project roles are not listed among the Enterprise features in the sources, so an open source deployment can use them. Before you commit to an automation design, check the license key documentation against the features you plan to script.
What does automating Langfuse provisioning cost, and what drives it?
Langfuse publishes a free open source plan and a custom-priced Self-Hosted Enterprise plan, so the license cost depends on the quote, not on a list price. The Enterprise plan adds a named support engineer, solutions architect access and a support SLA, according to the self-hosted pricing page. Implementation effort is driven by the number of organizations and projects, how many roles differ between teams, how far SSO and SCIM must reach, and how many environments (development, staging and production) need their own keys. Ask any partner for a quote that splits one-time build work (templates, pipelines, testing) from recurring work (upgrades, key rotation, reviewing changes to roles), and state which of those items the quote covers.
How long does it take to automate Langfuse provisioning?
The sources do not give a duration, so the timeline should come from a written scope rather than a rule of thumb. The main duration drivers are the number of organizations and projects to create, whether SSO and SCIM are in scope, how many environments need separate provisioning runs, and whether the target deployment already exists. A narrow case with one organization and a fixed role model moves faster than a multi-tenant model with per-team roles and an identity-provider sync. Ask for milestones covering a working template in a test environment, a review of the role model with the owners of each project, and a rehearsal of the same run against a second environment before production.
What must our team supply before provisioning work starts?
Three things are needed before work starts. First, a secrets store that holds LANGFUSE_INIT_* values, the ADMIN_API_KEY and the generated project keys, with access limited to the deployment pipeline. Second, deployment tooling, such as your Helm, Terraform or Compose repository and a CI system that can run the startup configuration in each environment. Third, a named admin owner who approves the organization structure, the default roles and who may hold the admin key. Also prepare the role model in writing: which teams need Admin, Member or Viewer access in each project, and which people are allowed to change it. Without these decisions, automation will simply encode undefined access.
Can an internal platform team automate Langfuse provisioning alone?
Often yes, for a single organization with a small set of projects and no SCIM requirement, provided the team already runs Kubernetes or Compose deployments and manages secrets properly. An internal team typically needs time to learn the startup variables, test them against each release and maintain the templates after upgrades. Bring in outside help when the scope includes the instance management API, multiple organizations, SCIM provisioning or a production rollout that must pass a security review. Whether the team has the capacity is a decision for your own leadership, so compare the internal plan with a fixed-scope written proposal from DeployOpen, which covers planning, implementation, documentation and handover.
What goes wrong when provisioning is scripted without a review?
The most common failures are exposed keys, over-broad default roles and drift between environments. Because LANGFUSE_DEFAULT_PROJECT_ROLE defaults to VIEWER when unset, a team that assumes a stronger default can unintentionally change access, so set every default role explicitly and record why. Keys in shell history, CI logs or plain manifests are a second risk, so rotate them and restrict who can read them. Finally, a script that runs on every deployment can re-create or reassign objects in unexpected ways, so test each change against a staging instance and keep the provisioning code under version control with review.
How DeployOpen scopes Langfuse provisioning work
DeployOpen plans and implements self-hosted Langfuse inside your own infrastructure, and the provisioning layer is part of that scope from the start. The work covers the LANGFUSE_INIT_* variables that create the first organization, project, API keys and user on startup, the LANGFUSE_DEFAULT_ORG_ROLE and LANGFUSE_DEFAULT_PROJECT_ROLE settings that decide what new users can do on arrival, and how the secrets behind those values are stored and rotated. Where your organization holds an Enterprise license key, the scope can also include automating organizations and organization API keys through the instance management API, authenticated with an ADMIN_API_KEY bearer token. Without a license, that API is not available, and the scope will say so rather than assume it.
Every engagement is fixed-scope. Before work starts, the written scope sets out which environments are covered, which identity provider and default roles apply, which initialization values are created and where they are stored, how the API is used if licensed, and which deliverables you receive, such as configuration files, a runbook and verification steps. Ask us to confirm in writing who owns the ADMIN_API_KEY after handover and how it is revoked. Ongoing upgrades, support and continuous testing are available as retainers, which suits teams that change default roles or add projects over time. DeployOpen does not publish a price list, so a quote follows from the written scope and the environments it covers.
Before you request a quote, decide who will own default role design, who may add users to the default organization and project, and how initialization secrets will be provisioned in your secrets manager. Check the current license terms with Langfuse for your planned features, since the Langfuse license key documentation lists which capabilities need an Enterprise key. Those answers shape the scope more than any other input, and they let the quote reflect the work you actually need.

