Self host InstantDB on your own servers
  • TypeScript 46.6%
  • Clojure 43.9%
  • JavaScript 2.6%
  • Python 2.6%
  • PLpgSQL 1.3%
  • Other 2.9%
Find a file
nobody 92fa1eb081
All checks were successful
Clojure CI / detect_changes (push) Successful in 14s
Clojure CI / lint (push) Has been skipped
Clojure CI / clj-build-check (push) Has been skipped
Clojure CI / clj-check (0) (push) Has been skipped
JS CI / detect_changes (push) Successful in 13s
JS CI / Check formatting (push) Has been skipped
JS CI / Build & Test packages (push) Has been skipped
chore: remove deploy.sh in favor of Nushell deploy scripts
Delete self-hosting/deploy.sh, which handled both the server uberjar
and dashboard deploys in one script — it's superseded by
deploy-server.nu and deploy-dashboard.nu. Update the ci-build command
docs to point at the new scripts, and drop the stale planning doc
(groovy-painting-parasol.md) now that the self-hosting work it
described has landed.
2026-08-20 21:56:06 -07:00
.claude/commands chore: remove deploy.sh in favor of Nushell deploy scripts 2026-08-20 21:56:06 -07:00
.github ci: run clj tests after build and lint jobs 2026-08-08 09:39:00 -07:00
client fix: strip basePath before router.replace in dash layout 2026-08-13 08:59:31 -07:00
dev-llm-docs/prompts [llm-rules] Use Joe's rules (#2421) 2026-03-26 16:11:46 -07:00
examples Add Python SDK (#2705) 2026-06-08 13:10:47 -07:00
self-hosting chore: remove deploy.sh in favor of Nushell deploy scripts 2026-08-20 21:56:06 -07:00
server fix: make idle-in-transaction test deterministic; verify runner timer QoS 2026-08-08 10:24:56 -07:00
.envrc chore: port dev tooling from self-host branch 2026-08-08 07:49:32 -07:00
.git-blame-ignore-revs Ignore tailwind sorting commit (#1982) 2025-11-21 16:42:52 -08:00
.gitignore chore: ignore redo state, CI secrets, and self-hosting env file 2026-08-07 18:54:02 -07:00
default.do chore: port dev tooling from self-host branch 2026-08-08 07:49:32 -07:00
dev-llm-rules.md Inline dev-llm-rules into AGENTS.md instead of redirect (#2435) 2026-03-27 15:40:07 -07:00
LICENSE.md ༼ つ ◕_◕ ༽つ give Instant 2024-08-22 09:53:10 -07:00
Makefile Inline dev-llm-rules into AGENTS.md instead of redirect (#2435) 2026-03-27 15:40:07 -07:00
README.md [GH] Update README 2-line description (#2550) 2026-04-13 14:00:42 -04:00
todo.plan fix: prune www to dashboard-only for self-hosted build 2026-08-08 11:55:21 -07:00
vercel.json Make vercel happy (#2766) 2026-06-19 19:13:38 -07:00

Shows the Instant logo

stars

Get Started · Examples · Try the Demo · Docs · Discord

Instant is the best backend for AI-coded apps. You get auth, permissions, storage, presence, and streams — everything you need to ship apps your users will love.

You write relational queries in the shape of the data you want and Instant handles all the data fetching, permission checking, and offline caching. When you change data, optimistic updates and rollbacks are handled for you as well. Plus, every query is multiplayer by default.

We also support ephemeral updates, like cursors, or who's online. Currently we have SDKs for Javascript, React, and React Native.

How does it look? Here's a barebones chat app in about 12 lines:

// ༼ つ ◕_◕ ༽つ Real-time Chat
// ----------------------------------
// * Updates instantly
// * Multiplayer
// * Works offline

import { init, id } from "@instantdb/react";

const db = init({ 
  appId: process.env.NEXT_PUBLIC_APP_ID,
});

function Chat() {
  // 1. Read
  const { isLoading, error, data } = db.useQuery({
    messages: {},
  });

  // 2. Write
  const addMessage = (message) => {
    db.transact(db.tx.messages[id()].update(message));
  };

  // 3. Render!
  return <UI data={data} onAdd={addMessage} />;
}

Want to see for yourself? try a demo in your browser.

Motivation

Writing modern apps is full of schleps. Most of the time you start with the server: stand up databases, caches, ORMs, and endpoints. Then you write client-side code: stores, selectors, mutators. Finally you paint a screen. If you add multiplayer you need to think about stateful servers, and if you support offline mode, you need to think about IndexedDB and transaction queues.

To make things worse, whenever you add a new feature, you go through the same song and dance over and over again: add models, write endpoints, stores, selectors, and finally the UI.

Could it be better?

In 2021, we realized that most of the schleps we face as UI engineers are actually database problems in disguise. (We got into greater detail in this essay)

Shows how Instant compresses schleps

If you had a database on the client, you wouldn't need to think about stores, selectors, endpoints, or local caches: just write queries. If these queries were multiplayer by default, you wouldn't have to worry about stateful servers. And if your database supported rollback, you'd get optimistic updates for free.

So we built Instant. Instant gives you a database you can use in the client, so you can focus on whats important: building a great UX for your users, and doing it quickly.

Architectural Overview

Here's how Instant works at a high level:

Shows how Instant compresses schleps

Under the hood, we store all user data as triples in one big Postgres database. A multi-tenant setup lets us offer a free tier that never pauses.

A sync server written in Clojure talks to Postgres. We wrote a query engine that understands datalog and InstaQL, a relational language that looks a lot like GraphQL:

// give me all users, their posts and comments
{
  users: {
    posts: {
      comments: {
      }
    }
  }
}

Taking inspiration from Asanas WorldStore and Figmas LiveGraph, we tail postgres WAL to detect novelty and invalidate relevant queries.

For the frontend, we wrote a client-side triple store. The SDK handles persisting a cache of recent queries to IndexedDB on web, and AsyncStorage in React Native.

All data goes through a permission system powered by Google's CEL library.

Getting Started

The easiest way to get started with Instant is by signing up on instantdb.com. You can create a functional app in 5 minutes or less.

If you have any questions, you can jump in on our discord.

Contributing

You can start by joining our discord and introducing yourself. Even if you don't contribute code, we always love feedback.

If you want to make changes, start by reading the client and server READMEs. There you'll find instructions to start Instant locally.