---
title: luna upgrade
description: Replace the luna CLI with the version Luna runs, or with a version you name.
related:
  - /cli/version
  - /cli
  - /quickstart
---

`luna upgrade` replaces this `luna` CLI with the version Luna runs, so the two match.

```bash
luna upgrade
```

## Reference

```bash
luna upgrade [OPTIONS]
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `--version <VERSION>` | text | The version Luna runs | Installs this version instead, such as `0.0.27`. A leading `v` is allowed. |

## Good to know

- The CLI asks Luna which version it runs, and downloads that build for this machine from Luna. When Luna has no build of that version, it downloads one from Luna's releases instead.
- A download from Luna is checked against its size and SHA-256 hash. The new CLI must then start and report the version asked for. If any check fails, nothing changes.
- The new CLI replaces the old one in place, in the same folder. Run the command as a user who can write there, with `sudo` if the folder needs it.
- When the version asked for is installed already, nothing changes.
- Every command that reaches Luna warns on standard error when this CLI's version differs from Luna's. An older CLI turns away what a newer SDK writes, and a newer one asks for what Luna does not have yet. Set `LUNA_NO_VERSION_CHECK=1` to turn the warning off.

## Examples

### Match the version Luna runs

```bash
luna upgrade
```

### Install one version

```bash
luna upgrade --version 0.0.26
```

### Upgrade a CLI in a folder only root can write to

```bash
sudo luna upgrade
```
