惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Engineering at Meta
Engineering at Meta
有赞技术团队
有赞技术团队
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
IT之家
IT之家
MongoDB | Blog
MongoDB | Blog
Y
Y Combinator Blog
B
Blog
The GitHub Blog
The GitHub Blog
M
MIT News - Artificial intelligence
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Microsoft Azure Blog
Microsoft Azure Blog
D
DataBreaches.Net
I
InfoQ
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
H
Help Net Security

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Deploying Instant Open-Source Firebase Alternative on Ubu...
Sanskriti Harmukh · 2026-06-17 · via DEV Community

Instant (InstantDB) is an open-source, real-time backend platform (a self-hosted alternative to Firebase) built around a PostgreSQL store with relational queries, authentication, and live sync. This guide deploys Instant using Docker Compose with PostgreSQL and Traefik for automatic HTTPS. By the end, you'll have Instant serving its backend API securely at your domain.


Set Up the Directory Structure

1. Create the project directory and clone Instant:

$ mkdir ~/instant
$ cd ~/instant
$ git clone https://github.com/instantdb/instant.git app
$ cd app/server

2. Move the bundled Compose file aside (we'll provide our own):

$ mv docker-compose.yml docker-compose.yml.bak

3. Create the environment file:

$ nano .env

TZ=UTC

DOMAIN=instant.example.com
EMAIL=admin@example.com

POSTGRES_USER=instant
POSTGRES_PASSWORD=YOUR_DATABASE_PASSWORD
POSTGRES_DB=instant


Deploy with Docker Compose

1. Create the Compose manifest:

$ nano docker-compose.yml

services:
  traefik:
    image: traefik:v3.6
    container_name: traefik
    command:
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
      - "--certificatesresolvers.letsencrypt.acme.email=${EMAIL}"
      - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./letsencrypt:/letsencrypt"
    restart: unless-stopped

  postgres:
    image: ghcr.io/instantdb/postgresql:postgresql-16-pg-hint-plan
    container_name: postgres
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
    command:
      - postgres
      - -c
      - wal_level=logical
      - -c
      - max_replication_slots=4
      - -c
      - max_wal_senders=4
      - -c
      - shared_preload_libraries=pg_hint_plan
      - -c
      - random_page_cost=1.1
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "instant"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

  server:
    build:
      context: .
      dockerfile: Dockerfile-dev
    container_name: instant
    working_dir: /app
    command: ["make", "dev-oss"]
    depends_on:
      postgres:
        condition: service_healthy
    environment:
      TZ: ${TZ}
      DATABASE_URL: "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}"
      NREPL_BIND_ADDRESS: "0.0.0.0"
    volumes:
      - ./:/app
    expose:
      - "8888"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.instant.rule=Host(`${DOMAIN}`)"
      - "traefik.http.routers.instant.entrypoints=websecure"
      - "traefik.http.routers.instant.tls.certresolver=letsencrypt"
      - "traefik.http.services.instant.loadbalancer.server.port=8888"
    restart: unless-stopped

2. Build and start the stack:

$ docker compose up -d --build

3. Verify the services and tail logs:

$ docker compose ps
$ docker compose logs


Verify the Backend

1. Test the HTTPS endpoint:

$ curl https://instant.example.com

You should see:

<code>Welcome to Instant's Backend!</code>

Note: First request may take ~1 minute while Let's Encrypt issues the certificate.

2. Confirm in a browser:

Open https://instant.example.com and verify the page loads over HTTPS.


Verify Database Connectivity

1. Open a psql session inside the postgres container:

$ docker compose exec postgres psql -U instant -d instant

2. Run sample DDL/DML:

CREATE TABLE messages (id SERIAL PRIMARY KEY, content TEXT NOT NULL, created_at TIMESTAMP DEFAULT NOW());
INSERT INTO messages (content) VALUES ('Hello from Instant'), ('Real-time sync test');
SELECT id, content, created_at FROM messages ORDER BY created_at DESC;
\q

3. Review backend logs:

$ docker compose logs --tail=20 server


Next Steps

Instant is running and served securely over HTTPS. From here you can:

  • Wire client SDKs against your domain for live-sync apps
  • Configure authentication providers and per-table permissions
  • Set up backups against the postgres-data volume for durability

For the full guide with additional tips, visit the original article on Vultr Docs.