> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://docs.ampdb.io/api/mcp` to find what you need.

# Installation

You install `ampd` with `ampup`, Amp's installer and version manager, or run it from Amp's Docker image. Both come with
two command-line tools: [`ampctl`](/clis/ampctl), which manages Amp through the [Admin API](/managing-amp/admin-api),
and [`ampsql`](/clis/ampsql), which runs SQL queries.

## Prerequisites

* **A supported platform**: macOS or Linux, on x86_64 or ARM64 (Apple silicon, aarch64). On anything else,
  [build from source](/running-amp/installation#build-from-source).
* **Access to the `edgeandnode/amp` repository on GitHub**, where Amp's releases are published. `ampup` uses your
  [GitHub CLI](https://cli.github.com) login (`gh auth login`) or, if you set one, a token in `GITHUB_TOKEN`.
* **PostgreSQL 16 or newer**, for the [metadata database](/running-amp/metadata-database). See
  [Install PostgreSQL](/running-amp/installation#install-postgresql).

## Install with ampup

::::steps
### Install ampup and Amp

The install script downloads `ampup` into `~/.amp/bin`, adds that directory to your `PATH`, and installs the latest
release of Amp:

```bash
curl --proto '=https' --tlsv1.2 -sSf https://ampup.sh/install | sh
```

To change what it does, pass options after `sh -s --`, like
`curl --proto '=https' --tlsv1.2 -sSf https://ampup.sh/install | sh -s -- --no-modify-path`:

| Option                          | Description                                                                                     |
| ------------------------------- | ----------------------------------------------------------------------------------------------- |
| `--install-dir <INSTALL_DIR>`   | Where to install, instead of `~/.amp`.                                                          |
| `--no-modify-path`              | Doesn't change your shell's startup file. Add `~/.amp/bin` to your `PATH` yourself.             |
| `--no-install-latest`           | Installs `ampup` only, without a release of Amp.                                                |
| `--github-token <GITHUB_TOKEN>` | The GitHub token to download releases with, instead of `GITHUB_TOKEN` or your GitHub CLI login. |

### Load your new PATH

Start a new terminal, or run the `source` command the script printed. The file depends on your shell: `~/.zshenv` for
zsh (`$ZDOTDIR/.zshenv` if you set `ZDOTDIR`), `~/.bashrc` for bash, `~/.config/fish/config.fish` for fish, and
`~/.profile` for others:

```bash
source ~/.zshenv
```

### Check the installation

:::terminal
```bash
ampd --version
```

```
ampd v0.0.42
```
:::
::::

If the download fails with `Status: HTTP 404`, `ampup` couldn't access the release: log in with `gh auth login`, or set
`GITHUB_TOKEN` to a token that can read `edgeandnode/amp`, then run `ampup install`.

## Manage versions

`ampup` keeps each version it installs, and points `ampd`, `ampctl`, and `ampsql` at the one in use:

```bash
# Install the latest release, or a given one
ampup install
ampup install v0.0.42

# List the installed versions, and switch between them
ampup list
ampup use v0.0.42

# Update Amp, and ampup itself
ampup update
ampup self update
```

Find the releases on [Amp's releases page](https://github.com/edgeandnode/amp/releases). Every `ampup` command is in
its [reference](/clis/ampup).

## Build from source

`ampup` can also build Amp from its source code, for a platform without prebuilt binaries or a version that isn't
released. You need [Rust](https://rustup.rs) and Git. The build takes a while.

```bash
# The main branch
ampup build

# A branch, a pull request, a commit, or a local clone
ampup build --branch my-branch
ampup build --pr 3377
ampup build --commit 555b7a3
ampup build --path ./amp
```

## Run with Docker

Amp's image, `ghcr.io/edgeandnode/amp`, runs `ampd` on Linux (x86_64 and ARM64), and contains `ampctl` and `ampsql`
too. Its tags are:

* A release, like `v0.0.42`.
* `latest`, the latest release.

The image is private: log in to the GitHub Container Registry first. Set `GITHUB_USER` to your GitHub username and
`GITHUB_TOKEN` to a token with the `read:packages` scope, then:

```bash
echo "$GITHUB_TOKEN" | docker login ghcr.io --username "$GITHUB_USER" --password-stdin
```

The image's entry point is `ampd`, so the container's command is an `ampd` command:

:::terminal
```bash
docker run --rm ghcr.io/edgeandnode/amp:v0.0.42 --version
```

```
ampd v0.0.42
```
:::

The image doesn't include a PostgreSQL server, so solo mode can't [manage
one](/running-amp/solo-mode#managed-postgresql) inside a container: point it at your own instead. [Distributed
Mode](/running-amp/distributed-mode#run-with-docker-compose) has a complete example with Docker Compose.

## Install PostgreSQL

Amp needs PostgreSQL 16 or newer for its [metadata database](/running-amp/metadata-database). You can run it in any way
you like, such as a managed database from your cloud provider or a container:

```bash
docker run -d --name amp-metadb -p 5432:5432 \
  -e POSTGRES_USER=amp -e POSTGRES_PASSWORD=amp -e POSTGRES_DB=amp \
  postgres:16
```

Solo mode can also [run a PostgreSQL server for you](/running-amp/solo-mode#managed-postgresql), from the `initdb` and
`postgres` programs of a local installation. Both must be on your `PATH`:

* **macOS**, with [Homebrew](https://brew.sh): `brew install postgresql@17`. Homebrew doesn't add versioned formulas to
  your `PATH`, so add it: `export PATH="$(brew --prefix postgresql@17)/bin:$PATH"`.
* **Debian and Ubuntu**: install PostgreSQL from [its APT
  repository](https://www.postgresql.org/download/linux/debian/), since your distribution's may be older than 16. Its
  programs are in `/usr/lib/postgresql/17/bin`, which isn't on your `PATH` by default:
  `export PATH="/usr/lib/postgresql/17/bin:$PATH"`.

Check that they're found, and that their version is 16 or newer:

:::terminal
```bash
initdb --version
```

```
initdb (PostgreSQL) 16.13
```
:::

## Install ADBC drivers

[Export jobs](/managing-amp/pipelines) write datasets into
PostgreSQL or Snowflake through ADBC drivers, libraries that `ampd` loads when an export starts. You only need them to
export, on the machines that run [workers](/running-amp/worker). Amp's [Docker image](/running-amp/installation#run-with-docker) has both.

* **PostgreSQL**: [`ampup adbc install postgresql`](/clis/ampup#ampup-adbc-install) installs the driver beside the
  `ampd` of the version in use. Install it again for each version you use.
* **Snowflake**: `ampup` can't install it. Download the archive for your platform from the version's release, like
  `adbc-driver-snowflake-linux-x86_64.tar.gz`, and extract the driver beside `ampd`. On macOS, with Apple silicon:

  ```bash
  gh release download v0.0.42 --repo edgeandnode/amp --pattern adbc-driver-snowflake-darwin-aarch64.tar.gz
  tar -xzf adbc-driver-snowflake-darwin-aarch64.tar.gz -C ~/.amp/versions/v0.0.42 amp-adbc-driver-snowflake.dylib
  ```

`ampd` loads a driver from its file, like `amp-adbc-driver-postgresql.dylib` on macOS or
`amp-adbc-driver-postgresql.so` on Linux, in the first of these directories that has it:

1. The directory in `AMP_ADBC_DRIVERS_DIR`, if you set it.
2. The directory `ampd` is in. For a version that `ampup` installed, that's the version's directory, like
   `~/.amp/versions/v0.0.42`, even though you run `ampd` from `~/.amp/bin`.
3. `/usr/local/lib/amp` on macOS, or `/usr/lib/amp` on Linux, where the Docker image has its drivers.

A version you [built from source](/running-amp/installation#build-from-source) has no release to download drivers from: set
`AMP_ADBC_DRIVERS_DIR` to the directory of a release that has them.

When none of the directories has the driver, the export fails as it starts, and its job's
[status](/clis/ampctl/job#ampctl-job-status) lists the directories it searched:

```
ADBC driver "amp-adbc-driver-postgresql.dylib" not found (searched: ["/Users/you/.amp/versions/v0.0.42", "/usr/local/lib/amp"])
```

## Next steps

* Start Amp on your machine with [solo mode](/running-amp/solo-mode).
* Follow the [quickstart](/get-started/quickstart) to extract a chain and query it.
