Five Firebase alternatives ranked for teams that need SQL, their own cloud account or a backend they control, with code and a verdict on when to pick which.

The best Firebase alternative in 2026 for a growing backend is Encore, which lets you declare Postgres databases, typed APIs, buckets and background jobs in application code and provisions them in your own AWS or GCP account, while your app keeps Firebase Authentication if you want. If you want another hosted backend-as-a-service with the same shape as Firebase, pick Supabase. Appwrite fits a bundle you can self-host, Convex fits reactive TypeScript apps, and PocketBase fits small apps on one server.
Firebase gets an app to launch without a backend team, with Firestore, Authentication, Storage and Cloud Functions behind one console. It gets harder once reporting needs joins that Firestore documents represent awkwardly, or when usage-based reads make the bill hard to predict, as budget alerts do not cap charges.
Google has also marked Firebase Extensions as deprecated, so teams that built on them are planning replacements anyway and often move business logic out of Security Rules into a backend they own.
Verdict: pick Encore when the reason to leave is control (SQL, your own cloud account, a reviewable backend), and Supabase when the reason is the data model but you still want a hosted BaaS.
Encore brings infrastructure from code: the backend declares its Postgres databases, object storage buckets, Pub/Sub topics and cron jobs as typed objects next to the APIs that use them, and Encore runs them locally and provisions them in your own AWS or GCP account on deploy. It replaces the parts of Firebase that stop fitting, document data and Cloud Functions, with Postgres and typed endpoints, and leaves the rest in place.

Sign-in can stay where it is, as an Encore authentication handler can verify the Firebase ID tokens your clients already send, so the first service runs alongside Firebase from day one:
// auth/auth.ts
import { APIError, Gateway, Header } from "encore.dev/api";
import { authHandler } from "encore.dev/auth";
import { initializeApp } from "firebase-admin/app";
import { getAuth } from "firebase-admin/auth";
// Verifying ID tokens needs only the project ID, not a service account key.
const app = initializeApp({ projectId: "my-firebase-project" });
interface AuthParams {
authorization: Header<"Authorization">;
}
interface AuthData {
userID: string;
email: string | null;
}
export const auth = authHandler<AuthParams, AuthData>(async (params) => {
const token = params.authorization?.replace(/^Bearer /, "");
if (!token) throw APIError.unauthenticated("missing token");
try {
const decoded = await getAuth(app).verifyIdToken(token);
return { userID: decoded.uid, email: decoded.email ?? null };
} catch {
throw APIError.unauthenticated("invalid token");
}
});
export const gateway = new Gateway({ authHandler: auth });
A notes service then replaces a Firestore collection with a Postgres table, and the authorization that used to live in Security Rules becomes a WHERE clause in backend code:
// notes/notes.ts
import { api } from "encore.dev/api";
import { getAuthData } from "~encore/auth";
import { SQLDatabase } from "encore.dev/storage/sqldb";
const db = new SQLDatabase("notes", { migrations: "./migrations" });
interface Note {
id: number;
body: string;
}
export const create = api(
{ expose: true, auth: true, method: "POST", path: "/notes" },
async ({ body }: { body: string }): Promise<Note> => {
const { userID } = getAuthData()!;
const row = await db.queryRow<Note>`
INSERT INTO notes (owner_uid, body) VALUES (${userID}, ${body})
RETURNING id, body`;
return row!;
},
);
export const list = api(
{ expose: true, auth: true, method: "GET", path: "/notes" },
async (): Promise<{ notes: Note[] }> => {
const { userID } = getAuthData()!;
const notes: Note[] = [];
for await (const n of db.query<Note>`
SELECT id, body FROM notes WHERE owner_uid = ${userID} ORDER BY id DESC`) {
notes.push(n);
}
return { notes };
},
);
encore run starts Postgres locally with the migrations applied and serves both endpoints, so you can call them with a real Firebase ID token from your app's dev build. On deploy, the database becomes RDS on AWS or Cloud SQL on GCP, and Encore provisions an IAM role for the service, or a service account on GCP. Instance sizes, networking and backups are set per environment in the infrastructure configuration. The Coming from Firebase guide maps each Firebase product (Firestore, Storage, scheduled functions, triggers) to the Encore primitive that replaces it.
A coding agent working in this codebase sees the database, the auth handler and every endpoint in one place, so it can add a table and the endpoint that uses it in one change and run both locally, instead of editing client queries and Security Rules separately.
Firestore listeners and offline sync have no direct equivalent, so keep them in Firebase for the screens that need them, or rebuild them with streaming APIs and Pub/Sub events if you want to leave entirely.
Best fit: teams that have outgrown Firestore and want Postgres and reviewable backend APIs in their own AWS or GCP account, moving one operation at a time.
Run in your terminal to get started locally.
Supabase is the closest product to Firebase on Postgres: a hosted database with Auth, Storage, Realtime and Edge Functions behind client SDKs. Tables, foreign keys, joins and transactions fix the data-model problem, and Row Level Security policies take the place of Security Rules for clients that query the database directly.
An agent can write migrations, policies and client calls and test them against the local stack that npx supabase start brings up. The access logic still spans client code and database policies, so tests have to cover both the client path and any service-role key used on the backend.
Best fit: teams that want SQL while keeping a hosted BaaS workflow. Firestore data and queries still need reworking, and self-hosting is possible with provisioning, backups and upgrades handled by your team.
Appwrite bundles authentication, databases, file storage, functions and realtime APIs behind client and server SDKs, and runs either on Appwrite Cloud or on infrastructure you control.
Functions can run locally in Docker with appwrite run functions, but execution permissions, event triggers and timeouts are only enforced in a deployed or self-hosted project.
Best fit: teams that want a Firebase-shaped bundle they can self-host. Running it yourself means operating a whole platform of services, with updates, backups and scaling on your side.
Convex puts backend logic in TypeScript queries, mutations and actions, and query subscriptions update connected clients when data changes, which is the part of Firestore many apps miss most:
// convex/documents.ts (imports omitted; needs an auth provider and a by_owner index)
export const list = query({
args: {},
handler: async (ctx) => {
const identity = await ctx.auth.getUserIdentity();
if (!identity) throw new Error("Unauthorized");
return await ctx.db
.query("documents")
.withIndex("by_owner", (q) => q.eq("ownerId", identity.tokenIdentifier))
.collect();
},
});
Best fit: collaborative or realtime apps where the team wants queries and mutations in TypeScript and is comfortable on Convex's platform. Migration means rewriting Firestore SDK calls and Cloud Functions into Convex functions.
PocketBase packages SQLite, authentication, file storage, an admin UI and realtime subscriptions into one executable that ./pocketbase serve starts locally or on a server. It is still pre-1.0 (v0.40.6 in November 2026), and its documentation says it is not recommended for production-critical apps yet, as upgrades can need manual migration steps.
Best fit: small apps and prototypes that fit on one server, run by a team willing to operate it.
Leaving Firebase rarely happens in one step, so start with the operations that need SQL or private access to your cloud, put them behind Encore endpoints that verify Firebase ID tokens, and move the rest when there is a reason to. The quick start gets a first service running locally.
Encore for teams that want Postgres, typed backend APIs and file storage running in their own AWS or GCP account, while keeping Firebase Authentication if they like. Supabase is the closest BaaS replacement with Postgres, Auth, Storage and Realtime in one hosted product. Appwrite fits a self-hostable bundle, Convex fits reactive TypeScript apps, and PocketBase fits small apps on one server.
Yes. Collections, subcollections and document references need a relational schema and a transformation step, and queries, Security Rules, transactions and realtime or offline behavior need to be reviewed. Firestore exports are not Postgres dumps.
Yes. Move selected operations behind new backend APIs while keeping Firebase Authentication, Storage or Firestore where they fit, and keep Security Rules for clients that still access Firebase directly.
No. Supabase covers the same product areas (database, auth, storage, realtime, functions), but it is built on Postgres, so Firestore documents need a relational schema, Security Rules become Row Level Security policies, and client SDK calls change.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.