Nhost
The Open Source Firebase Alternative with GraphQL, PostgreSQL, and Serverless Functions.
Why consider Nhost?
Nhost is an open-source BaaS platform providing PostgreSQL, instant GraphQL APIs (Hasura), authentication, storage, and serverless Node.js/Go functions.
Learn Nhost by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide11 sections
What is Nhost?
Nhost is an open-source Backend as a Service (BaaS) and developer platform built on top of PostgreSQL, Hasura GraphQL Engine, and Node.js. Positioned as the "GraphQL alternative to Firebase and Supabase," Nhost provides everything developers need to build, scale, and host modern full-stack web and mobile applications.
Nhost integrates a PostgreSQL database, an instant real-time GraphQL API with auto-generated queries, mutations, and subscriptions via Hasura, a complete user authentication service with social logins, S3-compatible file storage with image transformations, and serverless functions runtime.
Who Is It For?
- GraphQL & React Developers: Building modern web applications with typed GraphQL schemas (Apollo Client, URQL, TanStack Query).
- Mobile & Full-Stack Developers: Developing Flutter, React Native, or Next.js applications requiring real-time WebSocket subscriptions.
- Startups: Bootstrapping scalable backend architectures with production PostgreSQL databases without infrastructure management overhead.
Key Features
- Instant real-time GraphQL API generated automatically from PostgreSQL tables and relationships via Hasura.
- Integrated authentication service with support for passwordless magic links, SMS OTP, OAuth (Google, GitHub, Apple), and MFA.
- S3-compatible asset storage with on-the-fly image transformations and granular permission rules.
- Serverless Functions runtime for executing custom TypeScript, JavaScript, and Go backend code.
- Official client SDKs for React, Next.js, Vue, Svelte, and Flutter.
Local Development with Nhost CLI
Install the official Nhost CLI to run a full local backend stack on your development machine:
# Install Nhost CLInpm install -g nhost# Initialize a new Nhost projectnhost init# Start the full local BaaS stack (Postgres, Hasura, Auth, Storage, Functions)nhost upOnce started, access the local developer dashboard at http://localhost:13374 and the GraphQL endpoint at http://localhost:13374/v1/graphql.
Client Integration Example (Next.js & React)
import { NhostClient, NhostProvider, useAuthenticated } from '@nhost/react';const nhost = new NhostClient({ subdomain: 'localhost:13374', region: ''});function App() { return ( <NhostProvider nhost={nhost}> <UserProfile /> </NhostProvider> );}function UserProfile() { const isAuthenticated = useAuthenticated(); return ( <div> {isAuthenticated ? <p>Welcome back!</p> : <p>Please log in.</p>} </div> );}Practical Use Cases
1. Real-Time Chat & Collaborative Application
A development team builds a real-time messaging application using Nhost GraphQL subscriptions; new messages stream to connected web and mobile clients instantly over WebSockets.
2. Serverless E-Commerce Backend
A Next.js storefront uses Nhost for customer authentication and product catalogs, utilizing Nhost Serverless Functions to handle Stripe checkout webhooks and invoice generation.
3. Mobile Social Media Platform
A mobile engineer connects a Flutter app to Nhost, managing user profiles, image uploads with automated thumbnails, and database permissions using PostgreSQL row-level security.
Troubleshooting and Limitations
- Hasura Console Metadata Sync: When modifying database tables via SQL migrations, ensure Hasura metadata is tracked and exported using the Nhost CLI (
nhost hasura metadata export). - Function Runtime Isolation: Nhost serverless functions run inside isolated Node.js/Go runtimes; ensure all required third-party npm packages are included in your project's
functions/package.json.
Official Resources
- Official Website: https://nhost.io
- GitHub Repository: https://github.com/nhost/nhost
- Documentation: https://docs.nhost.io
Related tools
More options with a similar category or technology profile.
diskus
Minimal, fast alternative to du -sh written in Rust using multi-threaded directory traversal.
peco
Simplistic interactive filtering tool for Unix pipelines, process lists, and file trees.
Dapr CLI
Command-line tool for managing Dapr distributed application runtime environments and sidecars.
Freeze
Generate beautiful image screenshots and SVGs of code snippets and terminal outputs.