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

# Installation

> Install and configure Orphelix CLI

# Installation

## Prerequisites

Before installing Orphelix, ensure you have:

* **Node.js** >= 24.0.0 ([Download](https://nodejs.org/))
* **kubectl** installed and configured (optional, for real cluster access) ([Install Guide](https://kubernetes.io/docs/tasks/tools/))
* **Git** to clone the repository
* **macOS** or **Linux** operating system

## Install from Source

Clone and set up Orphelix:

```bash theme={null}
# Clone the repository
git clone https://github.com/corapoid/orphelix.git
cd orphelix/app
```

That's it! The CLI is available via `npm run orphelix`.

## First Run

Start Orphelix for the first time:

```bash theme={null}
npm run orphelix start
```

### What Happens on First Run?

The CLI will automatically:

1. **Check Dependencies**
   ```
   📦 Checking dependencies...
   ✅ Node.js version: v24.11.1
   ```

2. **Install npm Packages** (if needed)
   ```
   📦 Installing dependencies...
   [npm install output]
   ✅ Dependencies installed
   ```

3. **Build Standalone App** (if needed)
   ```
   🔨 Building standalone application...
   [build output]
   ✅ Build complete
   ```

4. **Configure Hostname** (interactive)
   ```
   🌐 Configure custom hostname orphelix.local?
      This requires sudo to modify /etc/hosts

      Configure now? [Y/n]: y

   [sudo] Password for user:
   ✅ Hostname configured
   ```

5. **Initialize Database**
   ```
   💾 Initializing database...
   ✅ Database initialized at ./orphelix.db
   ```

6. **Start Application**
   ```
   🚀 Starting Orphelix...
   ✅ Orphelix is running!
   📍 Open in browser: http://orphelix.local:3000
   📍 Or: http://localhost:3000

   🔔 Notification worker started

   📊 View logs: npm run orphelix logs
   🛑 Stop: npm run orphelix stop
   ```

## Configuration Options

### Custom Port

Run on a different port:

```bash theme={null}
# Via command flag
npm run orphelix start -- --port 8080

# Via environment variable
export ORPHELIX_PORT=8080
npm run orphelix start
```

### Skip Hostname Configuration

If you don't want to configure `orphelix.local`, answer "No" when prompted:

```
Configure custom hostname orphelix.local? [Y/n]: n
⏭️  Skipped hostname configuration
```

You can still access via `http://localhost:3000`

## Verify Everything is Working

After installation, check the status:

```bash theme={null}
npm run orphelix status
```

Expected output:

```
┌────────────┬────┬──────┬────────┬─────┬─────────┐
│ name       │ id │ mode │ status │ cpu │ memory  │
├────────────┼────┼──────┼────────┼─────┼─────────┤
│ orphelix   │ 0  │ fork │ online │ 0%  │ 150 MB  │
└────────────┴────┴──────┴────────┴─────┴─────────┘
```

Open in browser:

```bash theme={null}
npm run orphelix open
```

## Directory Structure

After installation, Orphelix creates:

```
orphelix/app/
├── orphelix.db              # SQLite database
├── orphelix.db-shm          # Database shared memory
├── orphelix.db-wal          # Database write-ahead log
├── .next/standalone/        # Built application
├── logs/                    # Application logs
└── node_modules/            # Dependencies
```

Backups are stored in:

```
~/orphelix-backups/
├── orphelix-backup-2025-11-26-100000.db
├── orphelix-backup-2025-11-25-150000.db
└── ...
```

## Troubleshooting Installation

### "Node version too old"

Upgrade to Node.js 24 or higher:

```bash theme={null}
# Using nvm
nvm install 24
nvm use 24

# Or download from nodejs.org
```

### "kubectl not found"

Install kubectl (only needed for real cluster access):

```bash theme={null}
# macOS
brew install kubectl

# Linux (Ubuntu/Debian)
sudo apt-get install kubectl

# Or follow official guide
# https://kubernetes.io/docs/tasks/tools/
```

### "Port 3000 already in use"

Use a different port:

```bash theme={null}
npm run orphelix start -- --port 8080
```

Or kill the process using port 3000:

```bash theme={null}
lsof -ti:3000 | xargs kill
```

### Database initialization failed

Remove the database and restart:

```bash theme={null}
npm run orphelix stop
rm orphelix.db*
npm run orphelix start
```

## Uninstallation

To remove Orphelix:

```bash theme={null}
# Stop and remove from PM2
npm run orphelix delete

# Remove the repository
cd ..
rm -rf orphelix

# Remove data (optional)
rm -rf ~/orphelix-backups
```

## Next Steps

> [card] [Start Command](https://orphelix.mintlify.site/cli/commands/start.md)
>
> Learn about the start command

> [card] [Configuration](https://orphelix.mintlify.site/user/configuration/settings.md)
>
> Configure Orphelix settings

> [card] [Auto-Startup](https://orphelix.mintlify.site/cli/commands/startup.md)
>
> Enable auto-startup on boot

> [card] [Troubleshooting](https://orphelix.mintlify.site/cli/troubleshooting.md)
>
> Common issues and solutions


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