Running self-hosted promptfoo with Docker Compose

Docker Compose is the simplest way to run the self-hosted promptfoo server for a small team, provided the data directory persists and the server sits behind your own access controls. This page covers the compose settings, setup checks, upgrades and the limits to confirm.

On this page

When a team needs self-hosted promptfoo with Docker Compose

A team that wants a shared promptfoo server inside its own infrastructure should start with Docker Compose, because it is a practical single-host way to run the self-hosted Express server with its web UI and API. The compose file must keep a persistent data directory so that evals and results survive container restarts and image upgrades. This usually follows a stage where each engineer runs evals on a laptop. The documentation states that promptfoo runs completely locally: evals run on your machine and talk directly with the LLM. Moving to a shared server changes who sees results and where the data lives, so the decision turns on whether one host meets the team's needs for access, storage and availability.

The storage model is the main fit test. The self-hosted server keeps its data in a local SQLite database that cannot be shared across replicas, and the documentation does not recommend it for production use. The server also has no RBAC, no horizontal scaling and no built-in authentication or SSO. A single Compose host therefore suits a pilot, a small team that places its own access controls in front of the server, or a shared test environment. If the team needs SSO, team-based access control, custom roles or more than one instance, Compose is the wrong shape, and the choice moves to Promptfoo Enterprise or On-Premise, which add those controls. The Helm chart runs the same application, so confirm its replica settings and storage behavior in the docs before choosing Kubernetes.

Before you commit, ask your security team how the server will be reached, because the self-hosted app has no login of its own. Then read the self-hosting documentation, which covers the Docker, Compose and Helm options and includes the Compose example. That example maps ./promptfoo_data to /home/promptfoo/.promptfoo and sets PROMPTFOO_SHARE_CHUNK_SIZE as an optional adjustment for large evals. Confirm with your team who owns that host directory and how it is backed up. Test any version change on a copy of the data first, so a failed upgrade cannot damage the shared results.

Team traffic enters through your access layer, and the data stays in one host directory

Start at the team's browser and the promptfoo CLI. Both send requests to an access control layer you place in front of the server, because the self-hosted server has no built-in login. That layer forwards requests to the promptfoo container on the host. The container writes its SQLite database and files to ./promptfoo_data, which is bind-mounted to /home/promptfoo/.promptfoo inside the container. A separate backup job on the host reads that same directory, so confirm how it copies the SQLite file while the container is running. The bottom path is separate: outbound calls from the container to model providers leave the host network and need their own egress planning.

Trust boundary, data directory and outbound egress path for the Compose stack.

Docker Compose settings for self-hosted promptfoo and when each fits

This table compares the settings you can change in the promptfoo docker-compose.yml: where promptfoo data lives, the optional chunk size for large evals, how provider API keys reach the container, and the replica count. Read each row by its fit and trade-off, then confirm the exact names and behavior in the official self-hosting documentation. The main takeaway is that storage choice affects backups, and replica count must stay at one because the server keeps its state in a local SQLite file.

SettingWhen it fitsTrade-offConfirm in the self-hosting docs
Bind mount ./promptfoo_data to /home/promptfoo/.promptfooFits when backup tools on the host need to read promptfoo files directly and you manage the host path.Host visibility eases backups, but host ownership and permissions must let the container user write.Which files under the data path hold the SQLite database and media, and the user the container runs as.
Named volume instead of a bind mountFits when Docker should manage the storage location and you back up through Docker volume tooling.Files are less visible from the host, so backup jobs need Docker-aware steps and restore tests.The container path promptfoo writes to, then a restart test to confirm data persists.
PROMPTFOO_SHARE_CHUNK_SIZE for large evalsFits when sharing large eval results to the server is slow or fails. It is optional, so leave it unset until you need it.Changing the size alters how uploads are split, which can affect memory use and upload behavior. Test with a representative large eval.The accepted value format, the valid range and the default for your version.
Provider API keys as environment variablesFits a small single-host setup where the compose file sits in a locked-down repository.Keys are visible to anyone who can read the file or inspect the running container's environment.Which provider variable names the server reads, and whether it needs keys for the features you use.
Provider API keys in an env fileFits when keys must stay out of the compose file and out of version control.The file is still plaintext on disk, so restrict its permissions and exclude it from Git.Whether the server or only CLI runs read the keys, and how your Compose version loads the env file.
Replica countFits a single replica, because the self-hosting docs describe no horizontal scaling for the server.Replicas cannot share the SQLite database, so they cannot serve one dataset.The official statement on replicas and scaling for your version before you change this value.

Setting up self-hosted promptfoo with Docker Compose

This sequence takes a team from a host with Docker and Compose to a promptfoo server that serves its web UI, keeps its SQLite data across container restarts, and accepts CLI connections. Each step closes with a check you can record before you move on.

  1. Choose a host with Docker and Compose

    The platform engineering or DevOps lead selects a host inside your network or cloud account where Docker and the Compose plugin are installed and approved under your standards. Place the server where your CLI users can reach it and where your access controls will sit, because the self-hosted app has no built-in authentication. Confirm the host has enough disk for the data directory, which holds the SQLite database that promptfoo writes. Done when docker compose version and docker info both return output on that host.

  2. Confirm the image and pin a tested tag

    The engineer reads the image reference and version guidance in the official promptfoo self-hosting documentation, then records the exact tag they have tested. Avoid a floating tag such as latest for a team server, because an upgrade can change behavior without a review. Test the pinned tag on a non-production host first, and note which promptfoo release it corresponds to so your change record shows what runs. Done when the tag is written into your change record and docker pull succeeds on the target host.

  3. Create the data directory with writable ownership

    The engineer creates a promptfoo_data directory beside the compose file, using the name from the Compose example, and sets its ownership so the user inside the container can write to it. Find that user ID by checking the image documentation or running id in a throwaway container from the pinned tag, then apply the owner with chown. Place the directory on storage your backup process already covers. Done when a test file written as the container user appears in the directory on the host.

  4. Write docker-compose.yml with data mapping

    The engineer writes a docker-compose.yml that pins the tag from the previous step, maps ./promptfoo_data on the host to /home/promptfoo/.promptfoo in the container, and publishes the web port only on an address your access controls can reach. Add PROMPTFOO_SHARE_CHUNK_SIZE only if large evals need it, and treat its value as a tuning choice to test before you adopt it. Set a restart policy so the server returns after a host reboot. Done when docker compose config prints the resolved file without errors.

  5. Keep provider keys out of the compose file

    The engineer passes model provider API keys through a .env file beside the compose file or through the host's secret store, then references them by variable name in the service definition. Restrict the file's permissions, exclude it from version control, and keep it out of shared paths and logs. Confirm the variable is set inside the container without printing its value. Done when a search of the repository for your key prefix returns no matches.

  6. Start the stack and read the logs

    The engineer runs docker compose up -d from the directory that holds the compose file, then follows the output with docker compose logs -f until the server reports that it is listening. Permission errors on the data path point back to the ownership step, and missing variables point back to the key step. Done when docker compose ps shows the service running and the logs show the server listening without errors.

  7. Verify the web UI and CLI connection

    The engineer opens the web UI from a browser on an allowed network and confirms the home page loads and responds to navigation. They then point a promptfoo CLI installation at the server and upload a small test eval, using the sharing setup described on its own page. This step only checks that the server accepts CLI traffic, so use the sharing page for the full configuration. Done when the browser loads the UI and the test eval appears in it.

  8. Confirm data survives a container restart

    The engineer records the test eval from the previous step, restarts the service with docker compose restart, and confirms the eval is still visible in the web UI and that the database file is present in the host data directory. They then run docker compose down followed by docker compose up -d and check again, to confirm the data survives a full stack recreation as well as a simple restart. Done when the same eval is visible after both checks.

Bind mount or named volume for promptfoo_data

The compose example maps ./promptfoo_data on the host to /home/promptfoo/.promptfoo in the container, so operators can list, copy and inspect the files directly on the host. This suits a single host where one team runs Docker and handles file backups itself.

  • File permissions: The host directory must be writable by the user the container runs as. Confirm that user in the promptfoo self-hosting documentation, then set matching ownership on the host before the first start. Write errors at startup often point to ownership.
  • Backups around restarts: Copy promptfoo.db while the container is stopped, or use a SQLite backup method so the copy is consistent. Back up the whole directory on the same schedule, since the database and any other files the server writes live there.
  • Host migration: Stop the container, copy the directory with ownership and permissions intact, then start the same compose file on the new host. Any paths in the compose file must match the new layout.
  • Restore checks: Restore a copy into a scratch directory on a second machine at least once, so the procedure is proven before you need it.

Ask the platform team to confirm the host path, the owner of the directory, and which backup job covers promptfoo.db.

How to upgrade the compose stack without losing eval data

Upgrade in a fixed order, and change the image tag only after the backup is complete. First, read the release notes for the target version on the promptfoo releases on GitHub page, because the supplied facts do not list migration steps for any specific version. Next, run docker compose stop so the SQLite database is not written during the copy, then back up the host directory mapped from ./promptfoo_data to /home/promptfoo/.promptfoo. Then change the pinned image tag in the image line of docker-compose.yml, keeping the version in exactly one place. Run docker compose pull followed by docker compose up -d to recreate the container, and confirm that existing projects, evals and results load in the web UI before anyone else relies on the server.

The pre-upgrade backup is what makes a rollback possible. Promptfoo keeps its evals in a local SQLite database inside the data directory, and a newer release may change that database in ways an older build cannot read. If the upgraded server fails to load projects or results, stop the container, restore the previous image tag in the compose file, replace the data directory with the backed up copy, and start the stack again. A container rebuild alone does not restore data, and without a copy taken while the container was stopped there is no known-good state to return to. Keep the backup until the new version has loaded your projects and at least one recent eval, and record the backup's location and timestamp in your change record.

Two things must be confirmed for your version before you start. First, check the release notes for any migration steps, renamed settings or required environment changes, since the supplied facts do not cover them. Treat those notes as the authority for your target tag, and confirm anything unclear with the vendor or in a test environment that matches production. Second, the Node.js requirement applies to hosts that run the promptfoo CLI. The npm release 0.124.1 requires Node.js 22.22.0 or newer, and this check must be done separately on each CLI host, including developer laptops and CI runners, because upgrading the server does not change those machines.

Limits of a Compose deployment to confirm before a team relies on it

The self-hosted server runs as one instance, and the Compose file does not change that. Each card names a limit to confirm in your environment, the controls you must place around the server because the application does not provide them, and the point where the requirements call for Enterprise On-Premise or another setup.

One instance with local SQLite

The server keeps its data in a local SQLite database that cannot be shared across replicas, so the deployment must run as one container. Confirm that your team accepts one host as a single point of failure. Map the data directory from ./promptfoo_data to /home/promptfoo/.promptfoo on storage that your backup schedule covers, and test a restore on a second host before anyone relies on stored results. If you need a second replica for availability, plan a different setup instead of trying to share the database file.

Self-hosting docs

No built-in authentication or SSO

The server has no login, user accounts or single sign-on, so access control must come from outside the application. Confirm who needs to reach the server and which identity provider they sign in with. Place a reverse proxy in front of it that enforces authentication, cover the API paths as well as the web UI, and restrict the published port to that proxy with network rules or a private subnet. If the team needs SSO enforced inside the application, the Enterprise edition includes SSO, and On-Premise runs it in your infrastructure.

Pricing and editions

No role-based access control

The server has no RBAC, so every user who gets through the outer controls holds the same permissions. Confirm whether your team needs separate roles, such as people who can run evals and people who can change shared results or settings. If it does, the self-hosted server cannot enforce that split, so decide whether to limit access at the proxy or plan a different setup. The Enterprise edition adds teams-based access control and custom roles, and On-Premise runs those features on your own infrastructure. Record the decision in your access review.

Compare editions

No horizontal scaling

The server cannot scale out by adding instances, so capacity is limited to the one host it runs on. Confirm the largest eval and red team workload your team plans to run, and measure whether one host handles that peak with headroom. Size CPU, memory and disk for that peak, and schedule large runs away from interactive use if they compete for the same host. Set a review point for concurrent users and run volume. If growth passes what one host handles, the Compose design will need to be replaced, so ask for a larger setup in writing before rollout.

Not recommended for production

The documentation states that the self-hosted server is not recommended for production use, so any production use is a risk decision your organization must own. Confirm with the risk owner whether the server will hold regulated data, gate releases or serve as the record of model testing. If it will, document the exception, the compensating controls and the exit plan before go-live. Make the reverse proxy, network restrictions, backup schedule and restore test conditions of approval. When requirements include SSO, roles, data isolation or vendor support, plan Enterprise On-Premise or another setup.

Self-hosting docs

Questions buyers ask about self-hosted promptfoo with Docker Compose

How much effort does a single-host promptfoo Docker Compose deployment take?

A single-host Compose deployment is usually a small build, and the effort rises with the controls you put around it. The container, data directory and environment variables are the simple part. The work that drives effort up is:

  • Access controls: the self-hosted server has no built-in authentication, SSO or roles, so you need an access layer in front of it and a test that proves it works.
  • Backups: the SQLite database and related files need a schedule, a restore test and a named owner.
  • Provider keys: each model provider key needs a secret store, rotation and a way to keep it out of plain-text configuration.
  • Upgrade testing: a pinned version, a review of release notes and an eval run against a staging copy before production changes.

Ask any partner to price these four items separately in the quote, because they are where effort varies most between teams.

Can our internal team deploy self-hosted promptfoo with Compose without outside help?

Yes, a team with container and Linux experience can stand up the basic stack alone, since the Compose file is short and the server is a single application. The skills that matter are:

  • Docker and Compose: volumes, environment files, image pinning and container restarts.
  • Linux host administration: patching, file permissions on the data directory and log access.
  • Reverse proxy and TLS: placing the server behind an access layer your security team approves.
  • Operations: scheduled backups with restore tests and a documented upgrade and rollback routine.

The harder question is whether the team will keep these controls running after launch. Outside help is most useful for the access layer, the backup design and the evidence your compliance team will request.

What does a Compose deployment need from our team before work starts?

Before work starts, you need to supply five decisions and the people who will own them. Expect to provide:

  • A host: a Linux server or virtual machine in your infrastructure, with its size, operating system and patch process named.
  • Docker: an approved Docker Engine version and an image source that your registry policy allows.
  • Network decisions: which users and networks can reach the server, whether it sits behind your proxy, and what outbound access the model provider calls need.
  • An identity owner: the person who decides how users sign in, since the server has no built-in authentication or SSO.
  • A backup owner: the person accountable for the data directory, backup location, retention and restore testing.

Agree these in writing at scoping, because each one changes the design and the quote.

Is Docker Compose enough to run self-hosted promptfoo in production?

No. The promptfoo self-hosting documentation states that the self-hosted setup is not recommended for production use. The server stores data in a local SQLite database that cannot be shared across replicas, and it has no RBAC, horizontal scaling, built-in authentication or SSO. Compose can run one container well, but it does not remove those limits. Compose is a reasonable fit for a pilot, a small internal evaluation team or a staging copy, provided the access layer, backups and upgrade steps are in place. For production use, decide with your security and platform leads whether to accept the single-instance limits in writing, or whether to move to a setup with identity and access controls. Confirm the current documentation before you sign off, since the product changes.

When should we move from Compose to Helm or On-Premise?

Move when you need something Compose cannot provide, such as orchestration on a cluster you run or the Enterprise controls inside your own infrastructure.

  • Helm: consider it when your organization already runs Kubernetes and has platform engineers to operate it. Confirm the chart's current status and supported configuration in the promptfoo repository before you plan around it, and check how the single-replica limit and storage class affect your design.
  • On-Premise: consider promptfoo's On-Premise edition when you need team sharing, teams-based access control, SSO and custom roles on your own infrastructure with complete data isolation. promptfoo describes it as including a dedicated deployment engineer.

Ask promptfoo for the current feature list and terms for each edition, since the Community and Enterprise editions are scoped and sold separately.

What should a fixed-scope quote for a Compose deployment include?

A fixed-scope quote should turn the decisions above into named deliverables, with each one traceable to a written requirement. Ask that it lists:

  • Environment: the host, Docker version, network paths and the image and version you pin.
  • Configuration: the Compose file, the persistent data directory, environment variables such as PROMPTFOO_SHARE_CHUNK_SIZE for large evals, and how provider keys are handled.
  • Access layer: how users reach the server and how that access is tested.
  • Backup and restore: the schedule, retention, restore test and handover to the backup owner.
  • Upgrade procedure: the staging test, the rollback path and a written runbook.
  • Acceptance and handover: what is tested, what evidence you receive and what support follows launch.

Also ask for stated assumptions, exclusions and a change process, plus the timeline in writing. DeployOpen agrees scope, deliverables and timelines in writing before work starts.

Where does self-hosted promptfoo keep evaluation data, and who backs it up?

The self-hosted server keeps its data in a local SQLite database, so the data directory mounted into the container is the asset to protect. The Compose example maps ./promptfoo_data to /home/promptfoo/.promptfoo, which is the path to plan around. Backups should cover the database file and any related files in that directory, with a restore test that proves the copy works on another host. Because the database cannot be shared across replicas, you cannot run a second live copy for failover. Name a backup owner, set a schedule, and record where copies go and how long they are kept. Confirm the exact file layout for your version before you write the runbook.

Security and operations for a self-hosted promptfoo container

The self-hosted promptfoo server is an Express application with a local SQLite database, and it ships without login, roles or an audit trail. The six controls below are the ones your team must supply around the container. Each card names what to confirm in your own environment before the server holds real provider keys or eval results.

Put an access layer in front

The server has no login of its own, so anyone who can reach its port can open the web UI and the API. Place it behind an identity-aware proxy that enforces your single sign-on for every request, including API calls, or restrict it to a private network segment with firewall rules. Do not publish the container port to the internet or to a broad corporate network. Confirm that the container port is unreachable from outside the segment and that the proxy blocks unauthenticated requests before you load any data.

Self-hosting docs

Keep provider keys out of files

Model provider keys let the container call paid APIs under your account, so treat them as credentials. Pass them as environment variables sourced from your secret store or your orchestrator's secret mechanism. Keep them out of the docker-compose.yml you commit, and use a .env file only if git excludes it and only the deploying account can read it. Confirm that keys stay out of version control, container logs and shell history, and plan a rotation step for each provider you use.

Protect the host data directory

The ./promptfoo_data directory maps to /home/promptfoo/.promptfoo inside the container and holds the SQLite database with your eval results. Anyone who can read that directory on the host can read your prompts, model outputs and any test data passed through. Set ownership to the account that runs Docker, limit permissions to that account, and keep the directory on an encrypted and access-restricted volume. Confirm that backup copies are encrypted too and that no shared file sync service picks the directory up.

Allow only needed model egress

Evals and red team runs send prompts from the container to model providers and to any target endpoints you configure, so the container needs outbound network access to those hosts. Write egress rules that allow the provider endpoints your team has approved and your internal targets, and deny everything else. Before go-live, run one small eval and confirm it reaches the provider and nothing unexpected. Confirm the full set of hosts your installed version contacts with the vendor documentation and your network team.

Build the audit trail yourself

The self-hosted server does not record who started an eval, who viewed results or who changed a configuration. If your compliance team needs that evidence, it has to come from other layers: access logs from your identity proxy, container runtime logs, and a record of which user or CI job ran the CLI. Decide which sources you keep, how long you keep them and where they are stored. Confirm with your compliance lead that these sources together answer the questions an assessor is likely to ask about who ran which test.

Schedule restarts and backups

The container restarts only when your compose file or orchestrator tells it to, and a restart during a long run can interrupt the eval. Set a restart policy and test it once. Copy the SQLite file while the container is stopped, or use a method your team has verified keeps the copy consistent, and store backups off the host in encrypted form. Test a restore on a separate machine. Confirm the backup interval, the retention period and who performs a restore with your operations team.

How DeployOpen scopes and delivers a self-hosted promptfoo deployment

DeployOpen scopes this work from a written deployment plan that names the promptfoo release, the host, the data directory and the access controls placed around a server that has no login. We build the Compose stack in your infrastructure, test that evals and data persist, and document the upgrade path. Engagements are fixed-scope, with ongoing support available as a retainer.

How we scope

  • Written scope names the promptfoo version, the host or cloud account, and the compose file that will run.
  • Scope records the persistent data directory path, its backup owner and where the volume lives on your storage.
  • Scope states the server has no login, its single-instance limits and the access controls placed in front.

How we build

  • Pin the promptfoo image to a reviewed release tag and verify it before the first container starts.
  • Map ./promptfoo_data to /home/promptfoo/.promptfoo, then test that data survives a container restart.
  • Set PROMPTFOO_SHARE_CHUNK_SIZE only when large evals need it, and record the value you tested.

How we hand over

  • A runbook covering start, stop, upgrade, rollback and the persistent volume backup steps.
  • A network diagram and a record of which users, networks and CI runners can reach the server.
  • Test evidence and configuration records your compliance team can review, without us issuing any attestation.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after handover.
  • Upgrade work follows the promptfoo release notes, with a staging run and a rollback copy of the data directory.
  • Changes can be retested, and the server's access controls get a named owner in your team.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.