---
title: "Deploy Spicedb"
description: "Deploying Authzed Spicedb"
category: "Authentication"
url: https://railway.com/deploy/spicedb
---

# Deploy Spicedb

Deploying Authzed Spicedb

**[Deploy Spicedb on Railway](https://railway.com/template/spicedb)**

- **Creator:** Chronicle
- **Category:** Authentication
- **Total deploys:** 2

## Template content

### authzed/spicedb https://authzed.com/assets/brand/logomark/authzed-logomark-circle-color.svg

- **Image:** authzed/spicedb:v1.49.0
- **Start command:** `spicedb serve`

## Documentation

# Deploy and Host Spicedb on Railway

## What is Spicedb?

SpiceDB is an open-source, Google Zanzibar–inspired permissions database for building fine-grained, real-time authorization. You define a schema describing resources and relationships, then your apps write relationships and ask “can user X do action Y on resource Z?” via APIs and client libraries. ([AuthZed][1])

## About Hosting Spicedb

Hosting SpiceDB mainly involves running the SpiceDB service plus a supported datastore for durable relationship storage (commonly PostgreSQL for single-region setups, or CockroachDB/Spanner for higher throughput or multi-region needs). You’ll configure environment variables for datastore connection info and service ports, run migrations/bootstrapping as needed, and ensure your deployment has health checks, logs, and a plan for scaling. If you scale to multiple SpiceDB instances, you’ll also consider how requests are dispatched across instances and monitor performance. ([AuthZed][2])

## Common Use Cases

* Fine-grained RBAC/ABAC for SaaS apps (orgs, teams, roles, resources, and scoped permissions)
* Document/project sharing (“user can view/comment/edit this file/project because of group membership or explicit share”)
* Entitlements and feature access (“who can access feature X for account Y, with hierarchy and exceptions”)

## Dependencies for Spicedb Hosting

* A supported datastore (typically **PostgreSQL**; alternatives include CockroachDB, Spanner, MySQL with caveats) ([AuthZed][2])
* Environment variable / secrets management for connection strings and config ([Railway Docs][3])

### Deployment Dependencies

* SpiceDB documentation (overview / getting started): ([AuthZed][1])
* SpiceDB datastores (what DBs are supported and when to use them): ([AuthZed][2])
* Railway environment variables / config: ([Railway Docs][3])

### Implementation Details 

If you’re using Railway Postgres, you’ll typically:

* Provision a Postgres service in the same Railway project
* Set SpiceDB datastore config via Railway Variables (e.g., a Postgres connection URI)
* Expose SpiceDB’s API port(s) via Railway’s service settings
* Add a liveness/readiness check endpoint (or TCP check) and monitor logs/metrics

(Exact variable names/flags depend on which SpiceDB image/version you deploy and how you choose to pass configuration—flags vs env vars—so it’s best to follow the datastore and configuration sections in the SpiceDB docs.) ([AuthZed][2])

## Why Deploy Spicedb 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 Spicedb 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.



[1]: https://authzed.com/docs/spicedb/getting-started/discovering-spicedb?utm_source=chatgpt.com "SpiceDB Documentation - Authzed Docs"
[2]: https://authzed.com/docs/spicedb/concepts/datastores?utm_source=chatgpt.com "Datastores - Authzed Docs"
[3]: https://docs.railway.com/reference/variables?utm_source=chatgpt.com "Variables - Railway Docs"


## 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/spicedb
