---
title: "Deploy Promptfoo"
description: "Test and red-team LLM prompts and agents; private, password-protected UI"
category: "AI/ML"
url: https://railway.com/deploy/promptfoo-1
---

# Deploy Promptfoo

Test and red-team LLM prompts and agents; private, password-protected UI

**[Deploy Promptfoo on Railway](https://railway.com/template/promptfoo-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/promptfoo-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** AI/ML

## Template content

### Promptfoo https://raw.githubusercontent.com/promptfoo/promptfoo/0.126.0/site/static/apple-touch-icon.png

- **Source:** https://github.com/aalfath/promptfoo-railway-template
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# 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](https://github.com/aalfath/promptfoo-railway-template): Promptfoo plus a Caddy login proxy
* A Railway volume at `/home/promptfoo/.promptfoo` for the SQLite database, blobs and cache

### Deployment Dependencies

* [Promptfoo self-hosting docs](https://www.promptfoo.dev/docs/usage/self-hosting/)
* [Promptfoo 0.126.0 release](https://github.com/promptfoo/promptfoo/releases/tag/0.126.0) and the official image `ghcr.io/promptfoo/promptfoo`
* [Caddy 2.11.9](https://github.com/caddyserver/caddy/releases/tag/v2.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):

```sh
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.



## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/promptfoo-1
