---
title: Installation
description: Clone Nibiru, install dependencies, set permissions, run your first migration.
---

## Requirements

- **PHP** ≥ 8.2 with these extensions: `pdo`, `gd`, `memcached`, `curl`.
- **Composer** for PHP dependencies.
- **A database**: MariaDB / MySQL ≥ 10.4, or PostgreSQL ≥ 13. ODBC if you're connecting to a non-native source.
- **Smarty** (installed via Composer).
- A web server with **mod_rewrite** (Apache) or equivalent (`vhost.conf` is included for nginx-style docroots).

## Clone & install

```bash
git clone https://github.com/alllinux/Nibiru my-app
cd my-app
composer install
```

Composer installs into `core/l/` (Nibiru uses an unusual `vendor-dir` to keep all framework code under `core/`).

## Configure

Copy the example INI file and edit your environment:

```bash
cp application/settings/config/settings.development.ini.example \
   application/settings/config/settings.development.ini
```

The minimum sections you need to set:

```ini
[ENGINE]
templates    = "/../../application/view/templates/"
templates_c  = "/../../application/view/templates_c/"
cache        = "/../../application/view/cache/"
caching      = false
debug        = true
error.controller = "error"

[SETTINGS]
page.url = "https://my-app.local"
navigation = "/../../application/settings/config/navigation/main.json"
modules.path = "/../../application/module/"
entries.per.page = 25
smarty.css[] = "/public/css/app.css"
smarty.js[]  = "/public/js/app.js"
timezone = "Europe/Vienna"

[DATABASE]
driver   = "pdo"           ; one of: mysql, pdo, postgres, psql, postgresql
hostname = "localhost"
port     = 3306
username = "nibiru"
password = "secret"
basename = "nibiru_dev"
encoding = "utf8mb4"
is.active = true

[SECURITY]
password_hash = "change-me-at-once"

[GENERATOR]
database = true            ; auto-generate models from DB tables
```

`APPLICATION_ENV` selects which file is loaded — `settings.development.ini` by default.

```bash
export APPLICATION_ENV=production   # picks settings.production.ini
```

## Bootstrap folders & permissions

```bash
./nibiru -s
```

This creates / fixes permissions on `application/view/templates_c/`, `application/view/cache/`, log directories, etc.

## Run your first migration

Migration files live in `application/settings/config/database/` as numbered SQL files (`001-acl.sql`, `002-account.sql`, …). Run them all with:

```bash
./nibiru -mi local
```

The migrator records what it has applied so re-running is safe. To apply against staging or production, change the environment:

```bash
APPLICATION_ENV=production ./nibiru -mi production
```

:::caution[Reset commands are destructive]
`./nibiru -mi-reset {env}` drops the migrations table and forgets which files were applied. Only use it on a brand-new database you don't mind reseeding.
:::

## First boot

Point your web server's docroot at the project root (the directory that contains `index.php`). For nginx, use the included `vhost.conf` as a starting point. For Apache, the default `.htaccess` route rewrite into `index.php` is sufficient.

Browse to `/` and you should see the index template. From there, [the Quick Start](/start/quick-start/) walks you through your first controller and view.
