> 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>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://qubit.deadbits.ai/getting-started/manual-install.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
