---
title: "Deploy OpenFGA"
description: "Deploy and host OpenFGA with Railway"
category: "Authentication"
url: https://railway.com/deploy/openfga
---

# Deploy OpenFGA

Deploy and host OpenFGA with Railway

**[Deploy OpenFGA on Railway](https://railway.com/template/openfga)**

- **Creator:** Andrés Aguiar's Projects
- **Category:** Authentication
- **Total deploys:** 20

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:16

### OpenFGA https://raw.githubusercontent.com/openfga/community/refs/heads/main/brand-assets/icon/color/openfga-icon-color.svg

- **Image:** openfga/openfga
- **Start command:** `./openfga run`
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host OpenFGA on Railway

 is a scalable open source authorization system for developers that allows implementing authorization for any kind of application and smoothly evolve as complexity increases over time. It is owned by the [Cloud Native Computing Foundation](https://cncf.io)

[OpenFGA](https://openfga.dev) is a high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar. It incorporates powerful Relationship-Based Access Control (ReBAC) and Attribute Based Access Control (ABAC) concepts with a domain-specific language that makes it easy to craft authorization and permission solutions that can grow and evolve to any use case, at any scale.

It is owned by the [Cloud Native Computing Foundation](https://cncf.io).

## About Hosting OpenFGA

This template runs a single instance of OpenFGA and Postgres. When the OpenFGA container, it runs the `openfga migrate` command first. This approach does not work if you run multiple OpenFGA nodes. If that's the case, you'll need to manually run `openfga migrate` whenever you update to a new OpenFGA version.

OpenFGA is configured with a [pre-shared key](https://openfga.dev/docs/getting-started/setup-openfga/configure-openfga#pre-shared-key-authentication) that you need to specify in the `OPENFGA_AUTHN_PRESHARED_KEYS` variable.

## Common Use Cases

You can use OpenFGA to implement authorization for any application. You can see some examples [here](https://github.com/openfga/sample-stores) and some of the companies using it [here](https://github.com/openfga/community/blob/main/ADOPTERS.md).

## Dependencies for OpenFGA Hosting

- PostgreSQL

### Deployment Dependencies

- [OpenFGA documentation](https://openfga.dev/)
- [OpenFGA Repository](https://github.com/openfga/openfga)
- [OpenFGA Examples](https://github.com/openfga/sample-stores)

## Why Deploy OpenFGA 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 OpenFGA 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

- [Keycloak](https://railway.com/deploy/mSwigX) — Keycloak template with keywind theme + apple and discord providers
- [lua-protector](https://railway.com/deploy/lua-protector) — Test deployed my project first
- [bknd](https://railway.com/deploy/p4nTYL) — Feature-rich yet lightweight backend

Open this page in a browser: https://railway.com/deploy/openfga
