Running self-hosted promptfoo with Docker

Running the promptfoo server from its container image gives a team one shared instance inside its own infrastructure. The work that matters is the data volume that keeps promptfoo.db, version pinning, provider keys and the access controls placed in front of a server that has no login.

On this page

Running self-hosted promptfoo with Docker for a shared team server

The self-hosted promptfoo app is an Express server that serves the web UI and API from a container, runs as a single instance and has no built-in login. A Docker deployment is therefore only as safe as the data volume it writes to, the version it pins and the access controls you place around it. Teams usually need this when eval results must be visible to more than one person, or when red team evidence should sit in one central place that reviewers can open later. Before you deploy, understand what the server does not do: evals run on the machine that starts them and talk directly with the model provider, so the server stores results and configuration and is not a gateway in the path of model traffic.

Start with the data. The server keeps its SQLite database, promptfoo.db, in a data directory, so mount that directory to a volume that survives container replacement and back it up on a schedule you have tested for restores. Only one container should write to that file, because the database cannot be shared across replicas. Next, pin the version. Choose an explicit image tag, confirm the exact image path and tag in the official self-hosting docs, and avoid floating tags such as latest on a server that holds audit evidence. Provider keys should reach the container as environment variables set at runtime, so they stay out of the image, out of any compose file committed to git and out of shared results.

Because there is no login, the access layer is yours to build. Put the server behind a reverse proxy or VPN that enforces single sign-on or client certificates from your identity provider, terminate TLS in front of it and limit network paths to the reviewers who need it. Then test the setup: start the container, upload one eval, restart the container and confirm the results still appear, and check from outside the allowed network that the UI and API refuse connections. Record the release the server runs and compare it with the promptfoo releases on GitHub before each change, so reviewers can trace results to a version. If reviewers later need SSO, role-based access or horizontal scaling, plan for that decision early, because the self-hosted server has none of those built in.

How the container, volume, CLI and model providers connect

The diagram starts with staff browsers and CLI users or CI jobs inside your network. Their requests pass through your reverse proxy or gateway, where your own access controls apply, before reaching the promptfoo container, which serves the web UI and API. The server stores results in promptfoo.db on a named volume or host path. Provider keys reach the container as environment variables. Model calls leave the network to the providers under test, and CLI runs also call those providers directly. Check that the proxy is the only route into the server, that the volume survives container restarts, and that outbound access is limited to the providers you approved.

Trust boundary, container, volume and outbound model calls for a self-hosted promptfoo server.

Which Docker configuration choices fit which team

This table compares five Docker configuration choices for the self-hosted promptfoo server: image tag, data storage, provider key handling, network exposure, and the move from a single container to Docker Compose. Read each row by asking which team you are and what your team can operate and verify itself. The main takeaway is that the server has no login and keeps its data in a local SQLite database, so access control and data location are decisions you must make and check.

DecisionWhen it fitsTrade-offConfirm in the official docs
Image tagTeams that need repeatable installs and change records: pin one release tag.Upgrades become deliberate steps, but someone must watch releases and schedule them. A floating tag picks up changes without review.Tag names the image publishes on ghcr.io, and release notes for each version before you upgrade.
Data storageSingle-host teams who want data to outlive the container: a named Docker volume for the promptfoo data.Docker manages volume location, so backups need a deliberate step. A bind mount is easy to copy, but depends on host paths and file ownership.Exact path of promptfoo.db and blobs inside the container, and any setting that moves the config directory.
Provider key handlingLocal evaluation or one host: an env file readable only by the service user. Orchestrated hosts: the platform's secret store.Env files sit on disk and can leak into copies or backups. Inline flags appear in shell history and process listings.Exact provider variable names the server reads, and whether any key is sent to a remote service.
Network exposureA private network segment with firewall rules that limit which clients reach the port. Proxy-only fits teams needing login in front of it.No login exists, so any client that reaches the port can use it. A proxy helps only if it is the sole route in.Listening port and bind address settings, and whether any authentication option exists in your pinned release.
Single container or Docker Compose laterOne container for a pilot run by one operator. Compose once several settings, volumes and restarts need one repeatable file.A single container is quick, but settings live in shell commands. Compose keeps them in one file, but the server still runs as a single replica.Compose examples and upgrade steps in the self-hosting docs, and the Compose file version your engine supports.

Why the data volume decides whether promptfoo.db survives a restart

Self-hosted promptfoo keeps its data in a local SQLite file, promptfoo.db, so the container's writable data directory must sit on a volume that outlives the container. If you run the image without a volume, the database lives in the container's writable layer. Replacing that container during an upgrade, which means pulling a new image tag and recreating the container, discards the layer along with every eval, result and setting it holds. Test this before the first real run: start the container, create a small eval, remove the container, start a new one from the same image and confirm the eval is still listed. Confirm the exact data path the image uses in the self-hosting documentation before you write the mount.

For a team that will back up the data, choose between a named volume and a host path based on who owns the backups. A named volume is managed by the Docker engine and moves easily between containers on the same host, but its files sit under the engine's storage directory, so your backup tooling must reach into that location or run through a container. A host path places promptfoo.db in a directory your existing backup agent already covers, and the owner and permissions are visible to the operations staff who run the backups. Either way, stop the container or take a consistent copy of the database before copying it, because copying a live SQLite file can capture a partial write. The self-hosting documentation is the place to confirm what the image expects in that directory.

Keep exactly one container writing to that database. SQLite is a file, so a second replica that mounts the same volume becomes a second writer to one file, and the self-hosting documentation states that the database cannot be shared across replicas. Avoid running two containers on one volume during a rolling replacement as well. Treat the volume as a security decision: its location and permissions determine who can read evals, provider output and anything else the application stores. Set the owner and mode deliberately, limit host access to the account that runs the container and mount the volume read-write only for the process that needs it. Backup schedules, retention and restore testing belong on the persistence page, and this section should settle only where the data lives and who can reach it.

Setup sequence for self-hosted promptfoo with Docker

This sequence takes a self-hosted promptfoo server from a pinned image to a running instance that your team reaches only through controls you own. Each step closes with a check: the UI loads, the database survives a restart, and CLI access works only from approved networks. The server has no login of its own, so the access controls in the final steps are part of the deployment.

  1. Confirm the image path and version

    The platform owner checks the image path and tag in the official self-hosting docs and on the promptfoo releases page, then pins that tag in the deployment record. Record the version and the Node.js requirement for each machine that runs the CLI too. The supplied npm release 0.124.1 requires Node.js 22.22.0 or newer, so older CLI hosts need an upgrade first. Done when the pinned tag, the version and each CLI host's Node.js version are recorded and approved by your change owner.

  2. Create the data volume

    The platform owner creates a named volume or a host directory on storage that your backup process covers, then mounts it at the data path given in the official docs. The file promptfoo.db is written there, so the data has to live in the volume, which survives container removal. Set ownership so the container user can write to the path. Done when Docker lists the volume or host directory, it is empty before the first start, and its name or path is recorded in the deployment notes.

  3. Store provider keys in an env file

    The engineer writes provider API keys into an env file stored outside the Git repository, readable only by the account that runs Docker. The container reads the keys from the env file at start, so they stay off the command line and out of shell history. Done when a search of the repository finds no key values and the container starts with the provider variables it needs.

  4. Start the container on an internal address

    The engineer starts the container with the pinned tag, the data volume, the env file and one published port. Bind that port to a private interface address on the host, so the UI is reachable only from internal networks. Confirm the container port in the official docs before writing the run command. Done when the UI loads from an internal client at the bound address, and a connection attempt from outside the approved range fails.

  5. Confirm data survives a container restart

    The engineer creates a test project or eval in the UI, then stops and restarts the container with the same volume and env file. Confirm that the database file is present in the volume, for example by listing the data directory from the host or through the container. Done when promptfoo.db appears in the volume and the test project still shows in the UI after the restart. If the file is missing, stop and check the mount path before going further.

  6. Place the server behind access controls

    The platform owner places the server behind a reverse proxy, VPN or internal gateway that enforces authentication and network rules, because the server has no login, roles or SSO of its own. Limit inbound traffic to the approved networks and named admin hosts. Confirm with your security team which controls satisfy your policy. Done when an unauthenticated request from outside the approved networks is blocked, and an approved user reaches the UI through the proxy.

  7. Verify CLI access from approved networks

    The engineer points the promptfoo CLI on an approved host at the server, using a host that meets the Node.js requirement recorded in the first step. The engineer runs a small eval with sharing turned on, then repeats the same run from a host outside the approved networks. Done when the approved host reaches the server and the upload completes, the outside host fails to connect, and both results are recorded in the deployment notes.

Securing self-hosted promptfoo with Docker when it has no login

The promptfoo server ships without built-in authentication, SSO or roles, so the controls below sit around the container. Each card names one risk, the control to put in place, and what to confirm in your environment before a team starts using the server.

Authentication sits in front

The self-hosted server has no login, SSO or role model, so a client that reaches the port can use the web UI and API without signing in. Put an authenticating reverse proxy or gateway in front of the container and let only that component reach the port. Confirm which identity provider your team uses, that the proxy enforces sign-in on API routes as well as the UI, and who can change the proxy configuration. Native SSO and roles belong to the paid Enterprise edition, so weigh that option if your team needs them inside promptfoo.

Self-hosting docs

Limit who can reach the port

The server serves evaluation results and test data through the same port as the UI and API, so anyone on a network path to that port can read them. Publish the port only on the interface and network your reviewers use, and keep it off public addresses. Confirm which subnets, VPN ranges or load balancers can connect, and whether a host firewall rule blocks every other source. Test the setting from outside the allowed network before the server goes live.

Provider keys in container environment

Model provider keys usually reach the container as environment variables, and anyone who can inspect the container can read them. Load keys from your secret manager or orchestrator secret store at start time, and keep them out of committed .env files. Confirm who holds Docker daemon or socket access on the host, who can run docker inspect against the container, and whether CI logs or startup output ever print the environment. Rotate keys on a schedule and after any change in who has host access.

Protect the data volume

Evaluation results live in a local SQLite database, promptfoo.db, on the data volume, so a copy of that file is a copy of the results. Set host directory ownership and file permissions so only the service account and approved administrators can read it, and confirm the user ID the container writes as. Ask your platform team whether the host disk or volume is encrypted at rest and who can mount or snapshot it. Give backups of the file the same access level as the live volume.

Pin and verify the image

A floating tag such as latest can change between restarts, so the server running in production may not be the version your team tested. Pin the image to a specific release tag and record the digest you deployed. Compare the tag with the release list on GitHub before you pull, and confirm that any internal registry mirror holds the same image. Repeat the check on every upgrade, and record which release each environment runs.

Promptfoo releases

Control outbound model traffic

The product documentation states that evals talk directly with the LLM, so every configured provider is an outbound destination from the container. Allow egress only to the providers and red team targets on your approved list, and deny all other destinations at the network layer. Confirm each endpoint against your provider agreements, whether a grading or judge model adds another destination, and whether the server contacts anything at start-up. Log denied connections so gaps in the allow list show up early.

How to pin and upgrade the image by team situation

A team preparing evidence for a regulated review needs to show which promptfoo version produced each result. Pin the image to one exact tag for the whole review period, and treat that tag as part of the test record. Changing the version mid-review can alter the software behind results that an auditor later asks you to reproduce, so any change should follow a documented decision.

  • Pin one exact tag: Use the full tag you checked on the promptfoo releases page. Avoid floating labels such as latest, and confirm with your registry that the tag is not re-pointed.
  • Record the digest: Store the image digest with the tag in the review file, so the exact image can be identified even if a tag label is reused.
  • Back up before any change: Copy the data volume that holds promptfoo.db, and export the eval results you plan to cite, before you touch the tag.
  • Record the CLI version: Note the CLI version that wrote each run, and confirm in the release notes whether it must match the server version.
  • Freeze until the review closes: Schedule any upgrade after the review, and keep the previous image available so you can restore the pinned state.

After any change, confirm that the web UI loads, that earlier evals still appear with their original timestamps, and that the CLI connects to the server and lists them.

Limits of the Docker setup to confirm before a team relies on it

The Docker setup gives you a working promptfoo server quickly, but it is built for one operator on one host. The six cards below cover what that means in practice: scaling, data storage, access control, the vendor's production guidance and the paid path for teams. Work through them with your security and platform owners before a shared team relies on the server.

One instance, no scaling out

The Docker setup runs one promptfoo server instance, and the documentation describes no horizontal scaling. A second container behind a load balancer will not add capacity or redundancy, so plan for a single host with a restart policy and a tested recovery procedure. Ask your team how long an interrupted evaluation can wait, and whether a host failure or maintenance window would stop work in progress. Size the host for your largest planned eval runs before you go live.

SQLite cannot be shared

Promptfoo stores its state in a local SQLite file, promptfoo.db, on the data volume. The documentation says that database cannot be shared across replicas, so a second container cannot be pointed at the same file to take over traffic. Treat the volume as the home of your evaluation history: include the database in backups and test a restore on a separate host. Confirm with your platform team who can read the volume and whether your storage snapshots capture a live SQLite file consistently.

No login, RBAC or SSO

The server has no built-in authentication, no role-based access control and no SSO. Anyone who can reach the port can open the web interface and the API, and every user acts with the same access. Put the server behind your own identity-aware proxy, VPN or private network path, and confirm the proxy blocks unauthenticated requests before they reach promptfoo. Ask your security team which logs will show who opened which eval.

Official docs advise against production

The promptfoo self-hosting documentation states the server is not recommended for production use. Treat that as the vendor's stated boundary for this deployment, and record it in your risk assessment with the date you read it. Decide whether your use is a team evaluation service, a pilot or a gate in your delivery pipeline, because each one needs different controls. Check the page again before each upgrade, since guidance can change between releases.

Self-hosting docs

Map team access rules

Your team probably has rules about who sees which projects, who can run red teams against which applications and who can export results. The server treats every user alike, so promptfoo will not enforce those rules for you. Write them down, then decide which ones your proxy, network segmentation or separate instances will enforce and which you accept as process controls. Confirm this mapping with your compliance lead before any sensitive application is connected.

Enterprise and On-Premise paths

The paid Enterprise edition adds team sharing, teams-based access control, SSO, and custom roles and permissions. On-Premise runs that functionality on your own infrastructure with complete data isolation and a dedicated deployment engineer. Both are sold at custom pricing, so ask for a written quote that names the features, deployment work and support terms you need. Confirm current edition features on the pricing page before you plan around them, since the list can change.

Pricing page

What teams ask before deploying self-hosted promptfoo with Docker

Does self-hosted promptfoo with Docker cost anything to run?

The Community edition is free, and the promptfoo software is MIT licensed, so the software itself carries no license fee for a Docker deployment. The Community edition includes all LLM evaluation features, all model providers and integrations, and red teaming with 10k probes per month, with community support. Your costs are the infrastructure that runs the container, the storage for the data volume, the model provider usage your evals trigger, and the staff time to operate it. Enterprise and On-Premise use custom pricing, so if you need team sharing, SSO, custom roles or on-premises support, ask promptfoo for a quote. DeployOpen's fee follows from a written, fixed scope, and DeployOpen does not publish a price list.

How much effort does a promptfoo Docker deployment take?

The effort depends mainly on how much you must build around the container, because the self-hosted server has no login of its own. The main drivers are:

  • Access controls: placing the server behind your reverse proxy, identity provider or VPN, and deciding exactly who can reach it.
  • Provider keys: passing model provider keys through environment variables sourced from your secrets store, and rotating them without exposing them in images or shell history.
  • Volume backups: backing up the data volume that holds promptfoo.db on a schedule you have tested for restores.
  • Upgrade testing: pinning an image version, running your evals against a new version, then moving the pin forward.

A team that already runs a reverse proxy, an identity provider and backup tooling has less to build than a team that does not. Ask any partner to show the effort split across these four areas in the written scope.

How long does it take to deploy promptfoo with Docker?

The duration depends on your scope, so confirm the timeline against your own environment before you plan a release date. Starting the container is the short part. The calendar time usually comes from access work, provider key handling, backup restore testing and upgrade testing, and from any queue for your identity or infrastructure teams. Ask for a timeline that lists each of these as its own item, with an owner and a finish point for each. For DeployOpen engagements, scope, deliverables and timelines are agreed in writing before work starts, so the timeline appears in the agreement before any work begins.

What does our team need to provide for a promptfoo Docker deployment?

Your team provides the infrastructure, the identity owners and a named version owner. The software is MIT licensed, so the main dependencies are on your side. Concretely:

  • Infrastructure: a Linux host or container platform you control, network placement, storage for the data volume and outbound access to your approved model providers.
  • Identity owners: the people who decide how users reach the server, including the reverse proxy and SSO setup, because the self-hosted server has no built-in authentication or SSO.
  • A named version owner: one person who pins the image tag, reviews release notes, runs upgrade tests and approves each move to a new version.

Name these owners before work starts so decisions about access and upgrades do not stall. A partner can take on parts of the build, but access decisions and version approvals stay with your organization.

Can our internal team deploy self-hosted promptfoo with Docker alone?

Yes, an internal team can run the Docker steps alone, because the promptfoo self-hosting documentation covers the container, the data volume, version pinning and provider keys. The harder parts are the access layer and the evidence. The server has no login, so one owner must run the reverse proxy, SSO integration and network rules that decide who can reach it. A second owner must keep the evidence current, including backup and restore records, version approvals and change history that security reviewers will ask for. DeployOpen prepares systems, controls and evidence for compliance assessments, but independent auditors and certification bodies issue any audit report. If your team cannot staff those two owners, a partner can build and document them inside your infrastructure under a written scope.

When do promptfoo's single-instance limits mean On-Prem or another setup?

Consider On-Prem or another setup when you need capabilities the single instance cannot provide, such as multiple replicas, RBAC, SSO or built-in authentication. The self-hosted server stores data in a local SQLite database that cannot be shared across replicas, and it has no RBAC, no horizontal scaling and no built-in authentication or SSO. The documentation says it is not recommended for production use, so treat that as a clear boundary for multi-team production work. promptfoo On-Premise runs the Enterprise functionality on your own infrastructure with complete data isolation and a dedicated deployment engineer, at custom pricing. Confirm with promptfoo which features each edition includes before you commit, and test whether a single Docker instance behind your own access controls meets your requirements for a limited pilot.

How should we store provider keys and protect the promptfoo data volume?

Pass provider keys as environment variables sourced from your secrets manager, and keep the data volume on storage that follows your normal backup and access controls. Keys should not be baked into the image, written into a committed Compose file or left in shell history. The data volume holds promptfoo.db, so restrict who can read the host path or volume, and back it up on a schedule you have tested for restores. After each start, check that the container receives the expected keys and that data persists across a container restart and a version pin change. Rotate provider keys on your normal schedule, and confirm with your security team which secrets store and log retention rules apply.

How DeployOpen scopes and delivers a self-hosted promptfoo deployment

DeployOpen treats a self-hosted promptfoo server as a small, single-instance service inside your own infrastructure. We agree the scope in writing first, then build the container, data volume and access layer, and hand over the runbook your team needs. Engagements are fixed-scope, and ongoing support is available as a retainer.

How we scope

  • The written scope names the image tag, the host, the data volume and the owner of each provider key.
  • It records that promptfoo runs as one container with one SQLite file, which cannot be shared across replicas.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • Pin the ghcr.io image to a specific version tag and record the tag in the change log.
  • Mount a persistent volume so promptfoo.db survives container restarts and image upgrades.
  • Pass provider keys as environment variables from your secrets store, and check that nothing lands in logs.

How we hand over

  • A runbook with the run command, volume layout, version pin and the upgrade steps we followed.
  • Network and access notes covering the reverse proxy, allowed sources and the authentication layer you place in front.
  • A restore test for the promptfoo.db file, with the result recorded in the handover file.

How we support

  • Optional retainer covering upgrades to new image tags, reviewed against the release notes before rollout.
  • Access control reviews when team membership changes, since promptfoo has no built-in login or roles.
  • Scope for a move to Enterprise On-Premise or another setup if team needs outgrow the single-instance limits.

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.