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

# Installation

> Detailed installation guide for Wryft Chat

## System Requirements

* **OS**: Linux, macOS, or Windows (WSL2)
* **RAM**: 2GB minimum, 4GB recommended
* **Storage**: 1GB for application + database storage

## Install Dependencies

<Tabs>
  <Tab title="macOS">
    ```bash theme={null}
    # Install Homebrew
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

    # Install dependencies
    brew install node rust postgresql
    ```
  </Tab>

  <Tab title="Ubuntu/Debian">
    ```bash theme={null}
    # Update packages
    sudo apt update

    # Install Node.js
    curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
    sudo apt install -y nodejs

    # Install Rust
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

    # Install PostgreSQL
    sudo apt install -y postgresql postgresql-contrib
    ```
  </Tab>

  <Tab title="Windows (WSL2)">
    ```bash theme={null}
    # Install WSL2 first, then follow Ubuntu instructions
    wsl --install
    ```
  </Tab>
</Tabs>

## Docker Setup (Recommended)

```bash theme={null}
# Install Docker Desktop
# Visit: https://www.docker.com/products/docker-desktop

# Start services
docker-compose up -d
```

This starts:

* PostgreSQL (port 5432)
* MinIO (port 9000)
* Redis (port 6379)

## Manual Setup

### PostgreSQL

```bash theme={null}
# Create database
createdb wryft

# Run migrations
for f in backend/migrations/*.sql; do
  psql -d wryft -f "$f"
done
```

### MinIO

```bash theme={null}
# Run setup script
./setup-minio.sh
```

### Redis (Optional)

```bash theme={null}
# Install Redis
brew install redis  # macOS
sudo apt install redis-server  # Ubuntu

# Start Redis
redis-server
```

## Environment Configuration

### Backend (.env)

```bash theme={null}
cd backend
cp .env.example .env
```

Edit `backend/.env`:

```env theme={null}
DATABASE_URL=postgresql://postgres:password@localhost/wryft
REDIS_URL=redis://localhost:6379
S3_ENDPOINT=http://localhost:9000
S3_ACCESS_KEY=minioadmin
S3_SECRET_KEY=minioadmin
S3_BUCKET=wryft
```

### Frontend (.env)

```bash theme={null}
cd wryft-web
cp .env.example .env
```

Edit `wryft-web/.env`:

```env theme={null}
VITE_API_URL=http://localhost:3001/api
VITE_WS_URL=ws://localhost:3001
```

## Verify Installation

```bash theme={null}
# Check Node.js
node --version  # Should be 18+

# Check Rust
rustc --version  # Should be 1.70+

# Check PostgreSQL
psql --version  # Should be 14+

# Check Docker
docker --version
docker-compose --version
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="Port already in use">
    Change ports in `.env` files or stop conflicting services
  </Accordion>

  <Accordion title="Database connection failed">
    Verify PostgreSQL is running: `pg_isready`
  </Accordion>

  <Accordion title="Rust compilation errors">
    Update Rust: `rustup update`
  </Accordion>
</AccordionGroup>

## Next Steps

<Card title="Quickstart" icon="rocket" href="/quickstart">
  Start the application
</Card>
