
Deploy Nango
Self-hosted Nango: OAuth and API keys for 1,000+ APIs, with Postgres
Connect-UI
Just deployed
Just deployed
Just deployed
/var/lib/postgresql/data
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:
- Open the Nango service's public URL and sign in as
adminwith theNANGO_DASHBOARD_PASSWORDfrom the Nango service's Variables tab. - In Environment Settings, copy the secret API key of the
devorprodenvironment. Your backend sends it asAuthorization: Bearer YOUR-SECRET-KEY. - Create an integration. For OAuth apps, register
https://YOUR-NANGO-DOMAIN/oauth/callbackas the redirect URL at the provider. - From your backend, call
POST /connect/sessionsand send your user to the returnedconnect_link, which opens the Connect UI service of this deployment. - 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.
Template Content