---
title: "Deploy HAPI FHIR server"
description: "Protected HAPI FHIR R4 server with durable PostgreSQL storage."
category: "Other"
url: https://railway.com/deploy/hapi-fhir-server
---

# Deploy HAPI FHIR server

Protected HAPI FHIR R4 server with durable PostgreSQL storage.

**[Deploy HAPI FHIR server on Railway](https://railway.com/template/hapi-fhir-server)**

- **Creator:** Anton Orel's Projects
- **Category:** Other
- **Total deploys:** 1

## Template content

### HAPI FHIR

- **Image:** hapiproject/hapi:v8.10.0-3@sha256:55213612779ab3eeec919226b7bad378f0061ade823393a61d7dd46dd5087a3d
- **Health check:** /fhir/metadata

### FHIR Gateway

- **Image:** caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648
- **Start command:** `/bin/sh -ec 'password_hash="$(caddy hash-password --plaintext "$FHIR_PASSWORD")"; printf "%s\n" "$CADDY_CONFIG" | sed -e "s|__USERNAME__|$FHIR_USERNAME|g" -e "s|__PASSWORD_HASH__|$password_hash|g" -e "s|__UPSTREAM__|$FHIR_UPSTREAM|g" >/tmp/Caddyfile; exec caddy run --config /tmp/Caddyfile --adapter caddyfile'`
- **Health check:** /healthz
- **Public domain:** Yes

### HAPI PostgreSQL

- **Image:** postgres:16-alpine@sha256:57c72fd2a128e416c7fcc499958864df5301e940bca0a56f58fddf30ffc07777

## Documentation

# Deploy and Host HAPI FHIR server on Railway

HAPI FHIR is an open-source FHIR server for storing, searching, and exchanging healthcare resources through the standard FHIR R4 API.

## About Hosting HAPI FHIR server

This template runs HAPI FHIR JPA Starter 8.10.0 with durable PostgreSQL storage. A Basic Auth Caddy gateway is the only public service, so the upstream server and database remain on Railway's private network.

## Why Deploy HAPI FHIR server on Railway

Railway supplies managed HTTPS, private networking, generated credentials, health-gated deploys, and persistent PostgreSQL storage. The template adds the access boundary the upstream starter explicitly leaves to deployers.

## Common Use Cases

- Build and test FHIR R4 integrations against a persistent private endpoint.
- Store synthetic healthcare resources for internal development and interoperability testing.
- Evaluate HAPI FHIR before implementing organization-specific identity, authorization, auditing, and compliance controls.

## Dependencies for HAPI FHIR server Hosting

The deployment uses HAPI FHIR JPA Starter, Caddy, and PostgreSQL.

### Deployment Dependencies

- One public Railway domain for the authenticated gateway
- One private HAPI FHIR service
- One PostgreSQL 16 service with a 5 GB persistent volume
- Generated gateway and database credentials


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/hapi-fhir-server
