# First-run setup (https://docs.neuralisapp.com/getting-started/first-run)

First-time setup is one interactive command. Run it from the Neuralis
application folder before starting the app (and before the first
`docker compose up` — it creates a missing data home and the data directories
with correct ownership):

```bash
npx neuralis setup
```

With Docker alone, the same wizard runs from the image into your install folder —
the command is in [installation](https://docs.neuralisapp.com/getting-started/installation.md#2-docker-image-recommended-for-teams) —
and asks the same questions. Until it has run, a container started from the image
answers every page with "Neuralis is not set up yet" and the setup commands, and
reports itself unhealthy: nobody can sign in to an instance that has no session
secret or owner account.

The script auto-detects your environment — platform (Linux, macOS, Windows,
WSL2), Docker availability, a running Qdrant, a running Ollama, and any
existing Neuralis data directory — and only asks for what genuinely requires
human input. Docker setup maps the chosen external MCP port to the container listener on 3101.

## What the script asks [#what-the-script-asks]

By default setup asks only for the owner account, the public origin, a free
port when one is taken and — on a checkout with Docker — Docker or native; every
other question takes its default (no provider key, the compose-managed Qdrant,
a detected local LLM server added, embedding switched off, the project
`My Workspace`), and the summary names where each is set in the app.
`npx neuralis setup --advanced` asks all of them:

1. **Owner account.** Email, password (minimum 8 characters, hashed with
   bcrypt before it is stored), and display name. This is the admin user with
   full access — the only account that exists after setup.
2. **Deployment mode.** Docker stack or native process. This decides how
   loopback service URLs are recorded: in Docker mode, `127.0.0.1` URLs for
   host-native services (such as a local Ollama) are rewritten to
   `host.docker.internal` so the container can reach them.
3. **AI provider keys.** Anthropic, Google Gemini, and DeepSeek up front;
   MiniMax, Kimi, Qwen, and xAI behind a "more providers" prompt. Every key is
   optional — skip them all and add keys later in the admin UI.
4. **OpenAI.** Wired separately because there are two paths: a plain API key
   (per-token billing) or **Sign in with ChatGPT** (OAuth against a ChatGPT
   subscription for Codex models). You can also import an existing official
   Codex CLI login from `~/.codex/auth.json`, configure both, or skip.
5. **Qdrant.** Use the compose-managed sidecar (Docker), point at an external
   Qdrant URL, let the script download and start a Qdrant binary (native, no
   Docker), or skip — skipping means keyword-only search and no persistent
   vector memory. For the compose-managed and binary modes setup mints a
   Qdrant API key into `.env` (preserved on re-runs) and the server enforces
   it; for an external instance you are asked for its key instead.
6. **Custom LLM endpoints.** The script probes the standard ports for Ollama,
   LM Studio, vLLM, llama.cpp server, and LocalAI, and lets you register any
   reachable endpoint as a chat-model source. You can also add one by hand —
   including a remote gateway: the wizard asks for its API key (stored
   encrypted in the credential store, never in `.env`) and whether the address
   is private or public, which is what decides whether the outbound address
   check applies. Everything here is editable later in the admin
   **Credentials** tab. `--ollama existing|docker|none` answers the Ollama
   question without asking it; choosing one also turns on local embeddings
   (`qwen3-embedding:0.6b`, no key). The desktop app asks the same on its first
   start, with a fourth way — download Ollama for the app (≈1.5 GB; ≈0.2 GB on a
   Mac) — and fetches the model in the background after the start. Ollama stays
   on this computer's loopback in every mode.
7. **Embeddings are optional.** Pick **No embedding model** (or leave the
   embedding key empty) to index content, search text and fields, and discover
   source skills without an embedding model or embedding API costs — embedding
   is then switched off, so no provider is called. Hosting and chat-model costs are separate. To add
   semantic search, choose a supported provider or an OpenAI-compatible
   `/v1/embeddings` endpoint with an explicit model and dimension. Keyed
   providers use their own embedding credential, separate from chat credentials.
   Existing installations keep their configured model on setup reruns.
   First activation and later model changes use an estimated rebuild you start
   explicitly in the admin Vector section; saving a key alone does not start a
   full paid rebuild. See [memory and sync](https://docs.neuralisapp.com/brain-core/sources.md).
8. **Machine desktop.** The first beta includes Ubuntu + XFCE for the
   [machine package](https://docs.neuralisapp.com/machine-core.md). Its Neuralis image download can run
   in the background or be skipped; opening a desktop may still wait for the
   download to finish. Operators can configure their own compatible image
   through `machineImage`. Of the core packages — admin, agents, brain and the
   virtual desktop — only the virtual desktop can be left off (its package
   declares itself optional; the others do not): it is off
   without Docker, `--advanced` asks, and `--no-desktop` leaves it off. Off, the
   package stays installed but is not loaded (no desktop, no `machine_use`, no
   MCP servers that need a container) until **Admin → Config**
   `disabledBuiltinPackages` turns it on again, on restart.
9. **Project name.** Your first project; the name is slugified into the
   project id.

## What it writes [#what-it-writes]

| Artifact | Location | Contents |
|---|---|---|
| Data directory skeleton | `~/.neuralis/` | `app/` (platform zone) and `projects/<id>/` (project zone) |
| Owner record | `~/.neuralis/app/users/` | The owner account with the bcrypt password hash |
| Project record | `~/.neuralis/app/projects/` | The first project, with you as owner |
| Default sources | per project | The `data://` and `packages://` filesystem sources |
| Credential keys | `~/.neuralis/app/` | A generated master key and installation salt for credential encryption |
| Session secret | `~/.neuralis/app/config/session-secret.key` | The secret that signs every sign-in, kept in the data home beside the credential keys |
| Encrypted credentials | `~/.neuralis/app/credentials/` | Every provider key you entered, AES-256-GCM encrypted |
| Platform config | `~/.neuralis/app/config/platform.json` | Embedding model and dimension, custom LLM and embedding endpoints, runtime settings |
| `.env` | application folder | Boot-critical values only: ports, the Qdrant API key, data-root path, deployment flags |
| `docker-compose.yml` | next to `.env` | The Docker topology, generated for this machine: services (app, Qdrant when compose-managed, Ollama when chosen), concrete user/group IDs and ports, a version-stamp header |

## The four configuration layers [#the-four-configuration-layers]

Setup splits configuration four ways for the lifetime of the deployment:
`.env` holds boot-critical topology only (ports, URLs, the data-root path; the
session secret lives in the data home), platform config holds runtime settings
edited in the admin UI, the encrypted credential store holds every long-lived
secret — provider keys you typed during setup land there, never in `.env` or a
compose environment block — and the generated `docker-compose.yml` is
machine-specific topology that `npx neuralis setup --compose-only` regenerates.
See [configuration](https://docs.neuralisapp.com/enterprise/configuration.md) for the full model and
[credentials](https://docs.neuralisapp.com/package-system/credentials.md) for scoping.

## Sign in and create your first agent [#sign-in-and-create-your-first-agent]

Start the app (`docker compose up -d`, or `npx neuralis start` in a native clone) and open
`http://localhost:3100`. Sign in with the owner email and password from setup.

A fresh project contains no agents, so the workspace shows a single **"Create
your first agent"** prompt. Give the agent a name and create it — agents are
AI assistants with their own model selection, system prompt, and tool access
(see [agent-core](https://docs.neuralisapp.com/agent-core.md)).

## Start the first conversation [#start-the-first-conversation]

With an agent selected, the chat widget opens automatically. Type a message
and send it. The composer's bottom bar carries the runtime controls — model
picker, reasoning effort, permission profile, and per-conversation package
toggles — all covered in the [workspace tour](https://docs.neuralisapp.com/getting-started/workspace.md).

![A configured workspace showing the Package Constellation and its package contributions](https://docs.neuralisapp.com/img/getting-started/first-run-1.webp)

*The Package Constellation in a customized installation. Its package set and agent choices are examples, not the default installation.*

If you skipped every provider during setup, connect one first: open the admin
widget, go to the **Credentials** tab, and add a provider API key (writing one
needs `project.credentials.write`, which no role below the `admin` tier holds by
default). The matching models appear in the chat model picker immediately —
see [providers and models](https://docs.neuralisapp.com/agent-core/providers-and-models.md).