---
title: "Deploy Nango"
description: "Self-hosted Nango: OAuth and API keys for 1,000+ APIs, with Postgres"
category: "Automation"
url: https://railway.com/deploy/nango-1
---

# Deploy Nango

Self-hosted Nango: OAuth and API keys for 1,000+ APIs, with Postgres

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

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

- **Creator:** Agaz Self-Host
- **Category:** Automation

## Template content

### Connect-UI https://raw.githubusercontent.com/NangoHQ/nango/v0.72.6/packages/webapp/public/logo512.png

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

### Nango https://raw.githubusercontent.com/NangoHQ/nango/v0.72.6/packages/webapp/public/logo512.png

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

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

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

## Documentation

# Deploy and Host Nango on Railway

Nango is an open-source platform for API authorization. It handles OAuth flows, API keys and token refresh for more than 1,000 APIs, stores your users' credentials encrypted, and proxies requests to those APIs, so your product and AI agents can act on behalf of your users without building each integration's auth yourself.

## About Hosting Nango

This template runs Nango's free self-hosted edition (version 0.72.6) as three services: the Nango server with its dashboard and API, the Connect UI page your end users see when they connect an account, and Railway Postgres with a volume, which holds all of Nango's data. Both app services build from a public GitHub repo that pins Nango's official image by version and digest. The dashboard is protected by basic auth with a generated password, and signup is off. The encryption key, admin key and database password are generated per deployment, and the deploy asks for nothing. Nango runs its database migrations on start, and the server has a health check on /ready.

## Common Use Cases

* Let users of your SaaS connect their GitHub, Google, Slack, HubSpot or Salesforce accounts with OAuth
* Give AI agents and backend jobs fresh access tokens or an authenticated proxy to third-party APIs
* Keep end-user API credentials in your own infrastructure instead of a hosted vendor

## Dependencies for Nango Hosting

* Nango server (official image `nangohq/nango-server`, free self-hosted edition)
* PostgreSQL (Railway Postgres 18 with a volume)

### Deployment Dependencies

* Source repo: https://github.com/aalfath/nango-railway-template
* Nango self-hosting docs: https://nango.dev/docs/guides/platform/self-hosting/self-managed
* Nango licence (Elastic License 2.0): https://github.com/NangoHQ/nango/blob/master/LICENSE

### Implementation Details

After deploy:

1. Open the Nango service's public URL and sign in as `admin` with the `NANGO_DASHBOARD_PASSWORD` from the Nango service's Variables tab.
2. In Environment Settings, copy the secret API key of the `dev` or `prod` environment. Your backend sends it as `Authorization: Bearer YOUR-SECRET-KEY`.
3. Create an integration. For OAuth apps, register `https://YOUR-NANGO-DOMAIN/oauth/callback` as the redirect URL at the provider.
4. From your backend, call `POST /connect/sessions` and send your user to the returned `connect_link`, which opens the Connect UI service of this deployment.
5. Use the proxy, or fetch fresh tokens with `GET /connections/YOUR-CONNECTION-ID`.

Keep a copy of `NANGO_ENCRYPTION_KEY` and never change it once data exists: Nango cannot rotate it and will not start with a different key. If you add a custom domain, update `NANGO_SERVER_URL` (Nango) and `NANGO_API_URL` (Connect-UI).

The free edition includes API auth, the proxy and auth/proxy observability. Syncs, actions, webhooks, MCP, RBAC and SSO need Nango Cloud or Enterprise. Optional settings such as SMTP or Elasticsearch activity logs are listed in the repo README.

Updates: both app services build from the repo's `main` branch. When the pinned Nango version is bumped there, Railway shows an "update available" notice in your project and you choose when to apply it. Read the repo's CHANGELOG.md first, and back up Postgres before a large version jump.

Nango is licensed under the Elastic License 2.0: you may self-host it for your own use, but not offer it to others as a hosted service. This template is not affiliated with Nango.

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

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

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