> ## Documentation Index
> Fetch the complete documentation index at: https://help.xitter.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Run a Xitter instance on your own machine.

## Requirements

* [Bun](https://bun.sh) 1.4 or newer
* PostgreSQL 14 or newer, with an empty database
* Optional: [ffmpeg](https://ffmpeg.org) on the `PATH`, for video uploads

## Set up

**1. Get the code**

```sh theme={null}
git clone https://github.com/Xittered/xitter
cd xitter
bun install
```

**2. Create a database**

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

```sh theme={null}
createdb xitter
export DATABASE_URL=postgres://<user>@localhost:5432/xitter
```

**3. Download a client build**

You don't need an X account for this.

```sh theme={null}
bun scripts/fetch-client.ts
```

**4. Create the first account and make it an admin**

```sh theme={null}
bun scripts/create-user.ts <name> <password> "<display name>"
bun scripts/make-admin.ts <name>
```

**5. Start the server**

```sh theme={null}
bun src/server.ts
```

Open `http://localhost:3000` and sign in with the client's own form. The tables are created on the first start.

> [!TIP]
>
> 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:

```sh theme={null}
bun scripts/invite.ts
```

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.

| Option | Effect |
| - | - |
| `--latest` | Re-pins the current build. |
| `--token <auth_token>` | Pins the signed-in page, with that account's feature switches. Uses the `auth_token` cookie from a signed-in x.com tab. Nothing about the account is kept. |
| `--har <file>` | Same as `--token`, from a saved HAR file. |

> [!WARNING]
>
> 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](/self-hosting/configuration)**
>
> Environment variables for the server.

> **[Docker Compose](/self-hosting/docker)**
>
> Run in production with containers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.