# Install Ptah

Install the three Ptah binaries with the verified release script and confirm they run.

Source: https://docs.ptah.run/v0.8.0/start/install/

import { Tabs, TabItem } from '@astrojs/starlight/components';

The release installer downloads the archive for your operating system and
architecture, verifies its SHA-256 checksum, and installs `ptah`, `ptah-compat`,
and `ptah-ls` without administrator rights.

Use [other installation methods](../install-options/) for Homebrew, a pinned or
customized installer, manual archive verification, `go install`, or a source
checkout.

## Prerequisites

- Linux or macOS: a terminal, `tar`, and either `curl` or `wget`.
- Windows: PowerShell 5.1 or later.

The default destination is `~/.local/bin` on Linux and macOS, or
`%LOCALAPPDATA%\Ptah\bin` on Windows.

## 1. Run the installer

<Tabs syncKey="install-platform">
<TabItem label="Linux and macOS">

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

Use `wget -qO- https://ptah.run/install.sh | sh` when `curl` is
not installed.

</TabItem>
<TabItem label="Windows">

```powershell
irm https://ptah.run/install.ps1 | iex
```

</TabItem>
</Tabs>

Expected output includes these stable results; the version, platform, archive,
and destination vary by machine:

```text
ptah: sha256 verified against checksums.txt
ptah: installed ptah, ptah-compat, ptah-ls in <install directory>
Version: <installed version>
```

The `Version:` line comes from the installed binary. The script runs it before
reporting success, so an archive that cannot execute on the current machine is
not left as an apparently successful install.

:::note
Piping a script into a shell is optional. The
[installation options](../install-options/#inspect-the-installer-before-running-it)
show how to download, read, and run the same script as separate steps.
:::

## 2. Put the install directory on `PATH`

On Linux and macOS, the installer prints this only when the destination is not
already on `PATH`:

```bash
export PATH="$HOME/.local/bin:$PATH"
```

Run it for the current terminal and add it to your shell startup file to keep
it. On Windows, the installer updates the user `Path` unless you disable that
behavior.

## 3. Verify all three binaries

```console
ptah version
ptah-compat version
ptah-ls --version
```

Each command prints a version, commit, build date, Go toolchain, and platform.
`ptah-compat` uses a `version` command rather than a `--version` flag.

The native and compatibility command trees are intentionally separate:

- `ptah` provides the native Ptah workflow;
- `ptah-compat` provides Atlas-compatible command paths;
- `ptah-ls` provides editor support for Go annotations.

## If verification fails

### `ptah: command not found`

Add the install directory to the running shell as shown above, then run
`ptah version` again. The binaries may already be installed correctly.

### The installer reports a checksum mismatch

Do not run the downloaded binary. Retry once to rule out an incomplete transfer.
If the mismatch repeats, use the signature-verification path on
[Other installation methods](../install-options/#verify-the-release-signature)
before trusting the archive or checksum file.

### A documented command is missing

The documentation version may be newer than the installed release. Use the
version selector in the header for released documentation, compare the binary's
`--help`, or install a newer release.

More symptoms are on [Troubleshooting](../../operate/troubleshooting/).

## Next step

Run the [quick start](../quick-start/) to apply and verify a schema change
against a disposable SQLite database.
