> For the complete documentation index, see [llms.txt](https://qubit.deadbits.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://qubit.deadbits.ai/getting-started/manual-install.md).

# Manual Install

### Prerequisites

* Python 3.12+
* PostgreSQL 15+ with pgvector extension
* Redis 7+

### Database Setup

{% stepper %}
{% step %}
**Create a new database and enable pgvector**

```sql
createdb qubit
\c qubit
CREATE EXTENSION vector;
```

{% endstep %}

{% step %}
**Set up your environment variables**

| Variable          | Description                        | Required |
| ----------------- | ---------------------------------- | -------- |
| `DB_PASSWORD`     | PostgreSQL password                | Yes      |
| `AUTH_SECRET_KEY` | Secret key for JWT tokens          | Yes      |
| `OPENAI_API_KEY`  | OpenAI API key for semantic search | Yes      |
| `ADMIN_USERNAME`  | Admin username                     | Yes      |
| `ADMIN_EMAIL`     | Admin email                        | Yes      |
| `ADMIN_PASSWORD`  | Admin password                     | Yes      |
| {% endstep %}     |                                    |          |

{% step %}
**Set up your environment variables**

```bash
export DATABASE_URL="postgresql://postgres:password@localhost:5432/qubit"
export REDIS_URL="redis://localhost:6379/0"
export AUTH_SECRET_KEY="your_secret_key_here"
export OPENAI_API_KEY="your_openai_key_here"
```

{% endstep %}
{% endstepper %}

### Install & Run

{% stepper %}
{% step %}
Install dependencies and run database migrations

```bash
pip install -r requirements.txt
alembic upgrade head
```

{% endstep %}

{% step %}
Create an admin user

```bash
python -m qubit.scripts.create_admin --username admin --email admin@example.com --password your_password
```

{% endstep %}

{% step %}
Start the application

```bash
python -m qubit.main --config data/config.yaml
```

{% endstep %}
{% endstepper %}

The application will be available at <http://localhost:8000>.
