Railway

Deploy Permify Latest

Permify is an open-source service for fine-grained authorization.

Deploy Permify Latest

Just deployed

/var/lib/postgresql/data

Deploy and Host Permify on Railway

About Hosting Permify

Permify is an open-source authorization service for building and managing fine-grained access controls. Inspired by Google Zanzibar, it supports RBAC, ReBAC, and ABAC patterns, allowing applications to perform scalable permission checks and model complex authorization relationships.

Railway hosts Permify as a stateless service alongside PostgreSQL for persistent authorization data. The services communicate over Railway's private network, while Permify can expose gRPC on port 3478 and REST on port 3476. Railway simplifies deployment, networking, HTTPS, and scaling without requiring manual infrastructure configuration. PostgreSQL stores authorization schemas, relationship tuples, and permission data, while Permify instances can scale horizontally as application traffic grows.

Common Use Cases

  • Fine-Grained Access Control: Determine whether a user can access or modify a specific resource with low-latency permission checks.
  • Multi-Tenant Authorization: Build isolated authorization models for organizations or tenants in SaaS applications.
  • Role-Based Access Control (RBAC): Implement hierarchical roles such as Admin, Manager, and Member with inherited permissions.
  • Relationship-Based Access Control (ReBAC): Model permissions based on relationships between users and resources, such as folder and file sharing.

Dependencies for Permify Hosting

  • PostgreSQL Database — Required for storing authorization schemas, relationship tuples, and permission data. The database is included in this template and communicates with Permify over Railway's private network.

Deployment Dependencies

Implementation Details

Docker

The provided deployment documentation does not specify a Docker image or Dockerfile. No custom Docker image is therefore documented for this template.

If the repository includes a Dockerfile, Railway automatically detects and builds it during deployment.

Public Networking

Permify exposes two application interfaces:

Proxy TypeTarget PortPurpose
HTTP Proxy3476REST API and /healthz health endpoint
TCP Proxy3478gRPC API

Applications connecting through Railway's private network can use the Permify private domain rather than a public endpoint.

Environment Variables

The application consuming Permify should configure the following variables:

VariableRequiredDescription
PERMIFY_HOSTYesPermify's Railway private domain. Use ${{Permify.RAILWAY_PRIVATE_DOMAIN}}.
PERMIFY_GRPC_PORTYesgRPC port used by Permify. Set to 3478.
PERMIFY_API_KEYYesAPI key used to authenticate requests to Permify. Reference ${{Permify.PERMIFY_AUTHN_PRESHARED_KEYS}}.

Use Railway's Raw Editor to configure the variables:

PERMIFY_HOST=${{Permify.RAILWAY_PRIVATE_DOMAIN}}
PERMIFY_GRPC_PORT=3478
PERMIFY_API_KEY=${{Permify.PERMIFY_AUTHN_PRESHARED_KEYS}}

API authentication is enabled for this deployment. The configured pre-shared key should be used by applications when authenticating with Permify.

Persistent Storage

Persistent storage is provided by the PostgreSQL dependency rather than a documented Railway Volume. PostgreSQL stores Permify authorization schemas, relationship tuples, and permission data.

No separate Railway Volume mount path is documented for Permify.

Database

PostgreSQL is required by this deployment.

Add the PostgreSQL service alongside the Permify service in the Railway project. Permify communicates with PostgreSQL through Railway's private network.

The PostgreSQL connection configuration is part of the deployment setup. The provided documentation does not specify individual PostgreSQL environment variable names, so no additional variables are listed here.

Build & Start

No custom build or start commands are documented in the provided deployment configuration.

If the repository contains a Dockerfile, Railway automatically builds the service from it.

Accessing the Application

After deployment, configure the required networking for the Permify service:

  1. Open the Permify service in Railway.
  2. Go to Settings → Networking.
  3. Generate a Railway Domain if public REST access is required.
  4. Use the generated domain to access the REST API on port 3476.
  5. Applications using Railway's private network can connect through PERMIFY_HOST and gRPC port 3478.
  6. The /healthz endpoint on port 3476 can be used to verify service health.

API authentication is enabled, so clients should provide the configured Permify API key when making authenticated requests.

Why Deploy Permify 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 Permify 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

More templates in this category

View Template
Keycloak
Keycloak template with keywind theme + apple and discord providers

beuz
757
View Template
lua-protector
Test deployed my project first

trianaq765-cmd's Project
32
View Template
bknd
Feature-rich yet lightweight backend

10