Skip to main content

Requirements

  • Bun 1.4 or newer
  • PostgreSQL 14 or newer, with an empty database
  • Optional: ffmpeg on the PATH, for video uploads

Set up

1

Get the code

2

Create a database

Use any name. Set DATABASE_URL if it isn’t the default (postgres://dev@localhost:5432/xitter).
3

Download a client build

You don’t need an X account for this.
4

Create the first account and make it an admin

5

Start the server

Open http://localhost:3000 and sign in with the client’s own form. The tables are created on the first start.
On Windows, run the commands in Git Bash, or set variables in PowerShell with $env:DATABASE_URL = "...".

Add more accounts

Sign-up is invite-only. Make invite codes in the admin panel (/admin > Invites) or with:
On the sign-in form, a username that doesn’t exist yet starts sign-up and asks for the code. An invite link (/signup?code=<code>) fills the code in.

Client builds

Without an account, fetch-client.ts pins the build x.com gives signed-out visitors at /i/tweetdeck, with the guest set of feature switches.
An auth_token cookie is a live login to your X account. Use it only for fetch-client.ts and don’t share it.The client/ folder holds X’s own client code. It is downloaded per instance and must not be committed or shared.

Next steps

Configuration

Environment variables for the server.

Docker Compose

Run in production with containers.