---
title: upgrade
---

import VersionLabel from '@site/src/components/Docs/VersionLabel';

The `moon upgrade` command can be used to upgrade your current moon binary (if installed globally)
to the latest version.

```shell
$ moon upgrade
```

:::caution

This command will only work if moon was installed in the `~/.moon` directory, using our official
[installation script](../install). If installed another way, you'll need to upgrade manually.

:::

### Options<VersionLabel version="2.4.0" />

- `--update-constraint` - After upgrading, update the
  [`versionConstraint`](../config/workspace#versionconstraint) in the workspace configuration to
  require the newly installed version.
