Deploy Promptfoo
Test and red-team LLM prompts and agents; private, password-protected UI
Promptfoo
Just deployed
/home/promptfoo/.promptfoo
Deploy and Host Promptfoo on Railway
Promptfoo is an open-source (MIT) tool for testing and red-teaming LLM prompts, agents and RAG apps. You define prompts, providers and assertions, run evals from the CLI or CI, and compare outputs side by side. This template deploys Promptfoo 0.126.0's self-hosted server: the web UI and API that store and share eval results.
About Hosting Promptfoo
Promptfoo's self-hosted server is a Node.js app that keeps everything in a SQLite database plus a blobs folder, so it needs a persistent volume. Upstream ships it with no login, and shared evals often contain prompts, outputs and system instructions, so it should never sit on an open URL. This template runs the official image behind a small Caddy proxy that adds a login with a generated password and an open /healthz path for Railway. Share links made in the UI point back to your own server, never to promptfoo.app. Updates arrive as Railway update notices when the template repo bumps the pinned version.
Common Use Cases
- Collect and share eval results from local runs and CI pipelines in one private web UI
- Compare prompts, models and providers side by side before shipping a change
- Review red-team and security scan results for an LLM app with your team
Dependencies for Promptfoo Hosting
- One Railway service built from aalfath/promptfoo-railway-template: Promptfoo plus a Caddy login proxy
- A Railway volume at
/home/promptfoo/.promptfoofor the SQLite database, blobs and cache
Deployment Dependencies
- Promptfoo self-hosting docs
- Promptfoo 0.126.0 release and the official image
ghcr.io/promptfoo/promptfoo - Caddy 2.11.9 for the login and health path
- Optional: an OpenAI API key (or another provider key) only if you want to run evals from the web UI
Implementation Details
After deploy: open the public URL and sign in with user promptfoo and the PROMPTFOO_PASSWORD value from the Promptfoo service's Variables tab. No setup wizard is involved.
Share evals from your machine or CI (the login goes in the API URL):
export PROMPTFOO_REMOTE_API_BASE_URL="https://promptfoo:YOUR-PASSWORD@YOUR-DOMAIN.up.railway.app"
export PROMPTFOO_REMOTE_APP_BASE_URL="https://YOUR-DOMAIN.up.railway.app"
npx promptfoo@latest eval --share
Variables: PROMPTFOO_PASSWORD is generated. OPENAI_API_KEY is optional (get one at platform.openai.com/api-keys) and is used only when you run evals from the web UI; OPENAI_BASE_URL lets you point it at any OpenAI-compatible API. Add other provider keys (ANTHROPIC_API_KEY, ...) the same way.
Resources: idles at about 120 MB RAM and runs on a 0.5 GB service; give it 1 GB or more for large evals or red-team runs from the UI. Upstream's self-hosted server is meant for one team: one replica, no user accounts or SSO (the single login is shared).
Updates: the service builds from the template repo, which pins the image by version and digest. When the repo moves to a new release, Railway shows you an update notice; read the repo's CHANGELOG.md, then apply it. Your data stays on the volume.
Why Deploy Promptfoo on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Promptfoo on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
Promptfoo
aalfath/promptfoo-railway-template
