# Updating (https://docs.neuralisapp.com/getting-started/updating)

A release is one version for every package and companion image. An update
replaces the application, never the data: `~/.neuralis` and the vector store
stay where they are, and a stored data format the new release needs is raised
offline, with a checkpoint taken first. Take a
[backup](https://docs.neuralisapp.com/enterprise/deployment.md#backup-and-restore) before you start.

## Which install do you have? [#which-install-do-you-have]

How you update depends on how the folder that holds `.env` was made. Look at
that folder — `ls -a` shows the hidden `.env`:

| The folder holds | It was made by | Update |
|---|---|---|
| a `package.json` that depends on `neuralis`, and `node_modules/` | `npm create neuralis` | [one command](#npm-install-folder) |
| `.env` and the compose files, **no** `package.json` | the Docker installer (`install.sh`) or setup run from the image | [one command](#image-only-folder) |
| the host's own source (`src/`, `bin/`, the host `package.json`) | `git clone` of the public host repository | [git, then the images](#git-clone) |

`npx neuralis update` works in the first and the third kind. An image-only
folder has no package to run it from: there the `neuralis` command the installer
puts on your machine runs the same update from the image.

## npm install folder [#npm-install-folder]

```bash
cd my-neuralis
npx neuralis update            # plan only: the folder, the services and the version it would move to
npx neuralis update --apply    # update to the latest release
```

`--apply` installs the release exactly (the `@neuralis/*` packages come with it;
the packages you registered are untouched), moves the image tag in `.env` and
every companion image still on the release default (in `.env` and the platform
configuration; a custom image is reported and left alone), then runs the rest
itself: it regenerates the compose file, stops the app (Qdrant keeps running),
raises the stored data formats, recreates the stack and waits for the health
check. A folder that registers packages of its own rebuilds its derived image
(`npx neuralis rebuild`) in place of the plain restart. It refuses before moving
anything when the app answers on its port but no compose service of the folder
runs it. A failing step stops it, and it prints where it stopped, what already
ran and the way back.
`--version <x>` updates to a named release instead of the latest and
`--manifest <https-url|file>` to a named release line; without either, the
update never moves an install to an older version.

## Image-only folder [#image-only-folder]

The Docker installer and setup run from the image make this folder. Run the
installer once more: on a folder that already holds an install it runs no
setup — it installs the `neuralis` command and offers the update.

```bash
curl -fsSL https://neuralisapp.com/install.sh | sh
```

From then on the update is one command, run in the install folder:

```bash
cd ~/neuralis              # the folder that holds .env and docker-compose.yml
neuralis update            # plan only: the folder, the services and the version it would move to
neuralis update --apply    # update to the latest release
```

From any other folder, name it: `neuralis --install ~/neuralis update --apply`.
Setup records each install folder in `~/.neuralis`, and with exactly one
recorded, `neuralis` finds it from anywhere without `--install`. A folder made
before 0.3.3 has no record until its first update or `setup --compose-only`
writes one. It runs the command line from
the image as your user: the installer writes it as a small script,
`~/.local/bin/neuralis`, or installs `@neuralis/cli` with npm where Node.js 22.22
or newer can install it globally. `--apply` pulls the new image first (a failed
pull moves nothing), then moves the image tag and the companion images and runs
the same steps as in an npm folder — compose file, app stop, data formats,
restart, health check — with the same refusals and the same printed way back.
`--version <x>` and `--manifest <https-url|file>` work as above.

## Git clone [#git-clone]

```bash
NEURALIS_VERSION=0.4.2         # the release to move to
git fetch --tags && git checkout "v$NEURALIS_VERSION" && npm install
npx neuralis update --version "$NEURALIS_VERSION" --apply   # the image tag and companion images
```

Then regenerate the compose file (`npx neuralis setup --compose-only`), stop the
app (`docker compose stop neuralis`), raise the data formats
(`npx neuralis upgrade --apply`) and recreate the stack
(`docker compose up -d -V`) — the command prints these steps. A clone run
natively stops its process, raises the data formats the same way
(`npx neuralis upgrade --apply`), then `npm run build` and `npx neuralis start`
replace the compose steps.

## From 0.1.0 (once) [#from-010-once]

The 0.1.0 scaffolder unpacked the host package into the install folder, and its
own update command never moves the host. With the app stopped, convert the
folder to the npm layout once, then update:

```bash
docker compose stop neuralis
npx --yes create-neuralis@0.4.2 convert .
npx neuralis update --apply
```

The conversion keeps `.env`, `.npmrc`, both compose files and every dependency
line you added; it deletes exactly the files the 0.1.0 package shipped, behind a
checkpoint in the folder's `checkpoints/`, and prints the way back. Re-running
it resumes; a converted folder is left alone. A host-broker unit written before
the conversion is replaced once by `neuralis device install` on that machine.

## The `neuralis` command, a device and the desktop app [#the-neuralis-command-a-device-and-the-desktop-app]

The `neuralis` command (`@neuralis/cli`) updates itself first. When npm
installed it globally, `neuralis update --apply` moves it to the newest
published release and continues in the new one, then updates the install folder
it finds as above (in it, `--install DIR`, or the one the data folder records),
and finally restarts the device service on this machine, if one is installed, on
the new command — after a copy of its folder (in `~/.neuralis/device/backups/`, as private as the
folder itself). The command the installer wrote as a script, and the one
the desktop app carries, move with the image and the app. On a machine with no
install folder — a laptop that is only a device, or a client of your agent tool
— `neuralis update --apply` moves just the command and the device; `--cli` does
that anywhere and never touches an install:

```bash
neuralis update --cli            # plan only
neuralis update --cli --apply    # the command line (and a device service) only
```

Nothing updates on its own while you work: every move is this one command. The
[desktop app](https://docs.neuralisapp.com/getting-started/desktop-app.md#every-day) updates itself on Windows
and as an AppImage; the deb and the macOS preview point you to the new release.

## Steps a release adds [#steps-a-release-adds]

A release that raises a stored data format names it in the update's plan, and
the upgrade step runs it once with the app stopped:

- **Path-rule subjects by role strength** — raises the stored source
  configuration once (`neuralis upgrade --apply`): an npm or image-only folder's
  `update --apply` runs it, a Docker clone or a native install runs it by hand
  before the app starts again, and the desktop app runs it by itself before its
  host starts.
- **Private agents** — makes every agent private to its creator: each
  project's data policy takes the private-agent rules, and every user who was
  assigned to an agent, or already holds a conversation with it, and is still
  a member stays attached to it. An agent's MCP key keeps working as its
  creator's key. Runs the same way as the step above.
- **Paired devices** — registers the server's existing host broker as its
  device and names it in every host source; when the host sources name no
  single owner the dry run asks for `NEURALIS_DEVICE_OWNER=USER_ID`. Run
  `neuralis device install` on the server afterwards.
- **The CLI sign-in** — stamps every stored OAuth grant with the MCP resource
  it was issued for, so connected MCP clients keep their sign-in.
- **The session secret in the data home** — writes
  `app/config/session-secret.key` from `.env`, so nobody is signed out. Going
  back to a release from before it means putting `NEXTAUTH_SECRET=` with that
  file's content back into `.env` first.
- **From 0.1.0** — marks every vector point once with its embedding proof (no
  re-embed): Qdrant must be running while the app is stopped, and a large index
  keeps it busy for a few minutes.
- **One Neuralis tree source** — a separate source attached to the Neuralis
  tree's `skills/` folder joins the one declared Neuralis tree source; any
  other such source is named in the plan and left as it is.
- **Merged permissions** — rewrites every stored role, package grant and
  package access rule to the merged feature ids (for example `exec.local` and
  `terminal.local` become `server.shell`, `files.search` becomes `files.read`).
  Built-in roles keep what they could do and gain only what a merge implies:
  a viewer may search what it already reads, a member and a manager may fork
  their own conversations, and a manager gets the shell inside the virtual
  desktops it already controls. A custom role that held only
  part of a merged set gains the rest, except for two pairs: a role holding
  only one half of the server-without-the-sandbox pair or of the
  other-members'-computers pair loses that half. The update never stops for
  this: the plan and the apply output name each such role with what it gained
  or lost, and each one is recorded in the audit log as
  `role.features_merged` (Admin → Logs, filter by action `role`). Review those
  roles in Admin → Roles afterwards.
- **New default role grants** reach existing projects through the same offline
  upgrade, so an older build refuses that data instead of serving it read-only.
  Builds older than the data-format ledger have no such guard: the first
  published beta is the oldest safe rollback.

In an image-only folder `neuralis upgrade --apply` runs in the app's own compose
service while the app is stopped.

## After the update [#after-the-update]

- **Going back a version**, the stored data formats and checkpoints:
  [Deployment](https://docs.neuralisapp.com/enterprise/deployment.md#upgrading-and-going-back-a-version).
- **Qdrant's own version** is a separate, deliberate step
  (`npx neuralis qdrant-upgrade`, see the
  [production checklist](https://docs.neuralisapp.com/enterprise/deployment.md#production-checklist)).
- **What changed** in each release: the [changelog](https://docs.neuralisapp.com/getting-started/changelog.md).