# Install

> Install the pier CLI on macOS or Linux, log in, and keep it current

URL: https://pier.run/docs/install

## Install

```bash
curl -fsSL https://pier.run/install | sh
```

The installer detects the OS and architecture (macOS and Linux, `amd64` and `arm64`)
and puts a single binary at `~/.local/bin/pier`. Set `PIER_INSTALL_DIR` to choose another
directory. Make sure the directory is on your `PATH`:

```bash
pier --version
```

## Log in

```bash
pier login
```

Opens the browser for a one-time code and stores a session for `https://api.pier.run`.
On a machine without a browser, `pier login --no-browser` prints the URL and waits for
the code. `pier whoami` shows the user and workspace the session belongs to.

Sessions are stored per **profile**, so a second controller (a self-hosted Pier, a
staging API) can be logged in at the same time:

```bash
pier login https://api.example.internal --profile internal
pier --profile internal ls
pier profiles            # list; * marks the default
pier profiles use internal
```

`PIER_PROFILE` selects a profile for one shell.

## Upgrade and remove

```bash
pier upgrade      # replace the binary with the latest release
pier uninstall    # remove the binary, the stored sessions and the local helper
```

## Next

[Quickstart](/docs/quickstart) deploys a first container. [Concepts](/docs/concepts)
defines workspace, project, environment and target.
