> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dbdock.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install DBDock globally, use with npx, or add it as a library dependency.

## Prerequisites

<CardGroup cols={2}>
  <Card title="Node.js 18+" icon="node-js">
    DBDock requires Node.js 18 or later.
  </Card>

  <Card title="PostgreSQL client tools" icon="database">
    `pg_dump`, `pg_restore`, and `psql` must be on your `PATH`.
  </Card>
</CardGroup>

### Install PostgreSQL client tools

<AccordionGroup>
  <Accordion title="macOS" icon="apple">
    ```bash theme={null}
    brew install postgresql
    ```
  </Accordion>

  <Accordion title="Ubuntu / Debian" icon="ubuntu">
    ```bash theme={null}
    sudo apt-get update
    sudo apt-get install postgresql-client
    ```
  </Accordion>

  <Accordion title="Fedora / RHEL" icon="fedora">
    ```bash theme={null}
    sudo dnf install postgresql
    ```
  </Accordion>

  <Accordion title="Windows" icon="windows">
    Download the installer from the [PostgreSQL downloads page](https://www.postgresql.org/download/windows/).
    Select only the "Command Line Tools" component if you don't need the full server.
  </Accordion>
</AccordionGroup>

Verify the tools are available:

```bash theme={null}
pg_dump --version
pg_restore --version
psql --version
```

## Install DBDock

<Tabs>
  <Tab title="npx (no install)">
    Always uses the latest published version. Best for one-off tasks.

    ```bash theme={null}
    npx dbdock --help
    ```
  </Tab>

  <Tab title="Global install">
    Best for daily use — `dbdock` is available from any directory.

    ```bash theme={null}
    npm install -g dbdock
    # or
    pnpm add -g dbdock
    # or
    yarn global add dbdock
    ```

    Verify:

    ```bash theme={null}
    dbdock --version
    ```
  </Tab>

  <Tab title="Project dependency">
    Use DBDock programmatically in a Node.js app.

    ```bash theme={null}
    npm install dbdock
    ```

    See the [SDK overview](/sdk/overview) to get started.
  </Tab>
</Tabs>

## Permission errors

If `npm install -g` fails with `EACCES`:

<AccordionGroup>
  <Accordion title="Fix: configure npm's global prefix">
    The recommended fix is to point npm at a directory you own:

    ```bash theme={null}
    mkdir -p ~/.npm-global
    npm config set prefix '~/.npm-global'
    echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
    source ~/.zshrc
    npm install -g dbdock
    ```
  </Accordion>

  <Accordion title="Workaround: sudo">
    Only if you understand the implications:

    ```bash theme={null}
    sudo npm install -g dbdock
    ```
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/get-started/quickstart">
    Run your first backup in 5 minutes.
  </Card>

  <Card title="Concepts" icon="book" href="/core/concepts">
    Understand how DBDock thinks about backups.
  </Card>
</CardGroup>
