# Install and upgrade
> Install the MotherDuck CLI on macOS, Linux, or Windows, keep it current with motherduck upgrade, and control where it stores its files.
## Quick install

### macOS

```bash
curl -s https://install.motherduck.com | SKIP_DUCKDB_CLI=1 sh
```

Runs on Apple silicon (aarch64) and Intel (x86_64).

### Linux

```bash
curl -s https://install.motherduck.com | SKIP_DUCKDB_CLI=1 sh
```

Runs on aarch64 and x86_64, and needs glibc. Only glibc builds are published,
so musl-based distributions such as Alpine stop with an error rather than a
failed exec. 32-bit hosts do the same.

### Windows

```powershell
powershell -c "$env:SKIP_DUCKDB_CLI=1; irm https://install.motherduck.com | iex"
```

Runs on aarch64 and x86_64. Where PowerShell's execution policy blocks this,
see [Windows without PowerShell](#windows-without-powershell).

The installer downloads the build for your platform, installs it under
`~/.motherduck/`, and puts it on your `PATH`.

Open a new shell so the `PATH` change applies, then check the install:

```bash
motherduck --version
```

:::note
The MotherDuck CLI bundles the DuckDB library. The minimal version of DuckDB bundled is the supported DuckDB version.
:::

## Windows without PowerShell

On hosts where PowerShell's execution policy blocks the quick install,
`install.bat` installs the DuckDB CLI only, then points at the PowerShell
installer for the MotherDuck CLI:

```bat
curl -sfL -o install.bat https://install.motherduck.com/install.bat && install.bat
```

It can't detect ARM64 or install the MotherDuck CLI, so use the PowerShell
script wherever you can.

## Install the DuckDB library and headers

On macOS and Linux, the installer can also install the DuckDB shared library
and C/C++ headers, for building programs that link against DuckDB. The
PowerShell and `install.bat` installers don't support this.

```bash
curl -s https://install.motherduck.com | WITH_LIBDUCKDB=1 WITH_HEADERS=1 sh
```

Any non-empty value turns an option on, and each works alone or together:

- `WITH_LIBDUCKDB` installs the shared library: `libduckdb.so` on Linux,
  `libduckdb.dylib` on macOS.
- `WITH_HEADERS` installs the headers `duckdb.h` and `duckdb.hpp`.

Both combine with `SKIP_DUCKDB_CLI=1` and `SKIP_MOTHERDUCK_CLI=1`. To install
only the library and headers, set both `SKIP_` variables:

```bash
curl -s https://install.motherduck.com | SKIP_DUCKDB_CLI=1 SKIP_MOTHERDUCK_CLI=1 WITH_LIBDUCKDB=1 WITH_HEADERS=1 sh
```

The library uses the same DuckDB version as the DuckDB CLI install:
`DUCKDB_VERSION` if you set it, otherwise the latest DuckDB version MotherDuck
supports, so it matches the `motherduck` extension. The files go into
`~/.duckdb/lib/<version>/`, and re-running the installer at the same version
leaves them in place.

The installer prints the compiler flags to use and doesn't change your shell
startup files or `LD_LIBRARY_PATH`. For example:

```bash
DUCKDB_LIB="$HOME/.duckdb/lib/<version>"
cc app.c -I"$DUCKDB_LIB" -L"$DUCKDB_LIB" -lduckdb -Wl,-rpath,"$DUCKDB_LIB" -o app
```

These options need `unzip`, which bare Debian and Ubuntu images don't include.
musl-based Linux isn't supported.

## Upgrade

```bash
motherduck upgrade
```

Replaces the MotherDuck CLI binary on your `PATH`. It does not upgrade the
DuckDB CLI in `~/.duckdb/`, which has its own version: update that through
[DuckDB's own installation](/getting-started/interfaces/connect-query-from-duckdb-cli.mdx#installation).
On a CLI that's already current, `upgrade` says so rather than downloading
again.

## Next steps

- [Sign in](./authentication.md), or create an account with `motherduck new`
- [Quickstart](./quickstart.md)
- [Command reference](/sql-reference/motherduck-cli/)


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fgetting-started%2Finterfaces%2Fmotherduck-cli%2Finstall%2F&page_title=Install%20and%20upgrade&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
