Self-hosting Call
Deploy as a standalone Docker application. All you need is a Postgres database and accounts with Ably and Daily. Each deployment serves a single organization.
Prerequisites
- A place to deploy your Docker container with Compose v2.
- A Postgres database. One is included in the Compose file, or point
DATABASE_URLat your own. - An Ably account for realtime chat and visit events.
- A Daily account for video calls.
1. Clone the repository
Clone the repo and change into the Docker directory.
git clone https://github.com/N2O-com/embed.git
cd embed/docker2. Configure your environment
Copy the example env file and fill in the secrets. At a minimum set BETTER_AUTH_SECRET, ABLY_API_KEY, DAILY_API_KEY, and DAILY_DOMAIN.
cp .env.example .env
openssl rand -base64 32 # paste into BETTER_AUTH_SECRET3. Start the stack
This starts Postgres, runs database migrations once, then serves the dashboard on http://localhost:3000.
docker compose up --build4. Create the first account
The first user to sign up becomes the administrator. After that, sign-ups are invite-only. Invite teammates from the dashboard, or set AUTH_STAFF_DOMAIN so anyone at your company domain can self-register.
5. Embed the widget
Create an embed token in the dashboard, then add the script to any site. The bundle is served from jsDelivr; point data-api at your deployment so the widget talks to your instance.
<script
src="https://cdn.jsdelivr.net/npm/@lukestei/embed"
data-token="YOUR_EMBED_TOKEN"
data-api="https://your-app.example.com"
defer
></script>Optional: rate limiting
The public widget endpoints (visit init, status updates, and realtime tokens) are unauthenticated, so a busy or hostile page can generate a lot of requests. Per-IP rate limiting is built in but off by default. To turn it on, create a free Upstash Redis database and set both UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN. With either unset the limiter is a no-op — fine for a private instance already behind your own proxy or WAF.
UPSTASH_REDIS_REST_URL=https://your-db.upstash.io
UPSTASH_REDIS_REST_TOKEN=your-rest-tokenSingle-org by design
The self-hosted edition serves one organization per deployment. Multi-tenant orgs, billing, and provisioning live in the managed platform; the open-source core stays focused on running your own instance.
Full documentation lives in the repository.