# Install and update SQL

_This page explains where the KDB-X installer puts the SQL interface, and how to install or update it yourself from the KX downloads portal._

The SQL interface is a single file, `s.k_`. `.s.init[]` and the `s)` prompt load it from the `q/` folder of your KDB-X installation directory.

## Installed by default

The [KDB-X installer](../../get_started/kdb-x-install.md) downloads the latest SQL release and places `s.k_` in `q/` in your installation directory, which defaults to `$HOME/.kx`. You do not need to install it separately after a standard installation.

> **Note — Linux ARM**
>
> The installer skips the SQL download on Linux ARM (aarch64), because the archive also contains [pgwire](../pgwire/install.md), which is not built for that platform. The SQL interface itself works on Linux ARM. Follow the manual steps below with the Linux x86-64 archive, and copy only `s.k_`.
>
## Install or update manually

Install manually when you want a newer SQL release than the one your installer shipped, or on Linux ARM.

### Before you begin

- Know your KDB-X installation directory. The default is `$HOME/.kx`. The commands below use that path. If you installed KDB-X elsewhere, replace it with your installation directory. The `q/` folder is next to the `bin/` folder that holds the `q` executable, which `which q` shows you.

### 1. Download the archive

Download the archive for your platform from the [SQL directory in the KX downloads portal](https://portal.dl.kx.com/assets/raw/kdb-x/sql/). The `~latest~` path always points at the newest release. Each archive contains `s.k_`, the pgwire executable, a `readme` and a `changelog`. The `s.k_` file is the same in every archive.

| **Archive** | **Platform** |
|---|---|
| `l64-sql.zip` | Linux x86-64, and Linux ARM for `s.k_` only |
| `m64-sql.zip` | macOS (Intel and Apple Silicon) |
| `w64-sql.zip` | Windows |

=== "Linux"
    ```bash
    curl -L -O https://portal.dl.kx.com/assets/raw/kdb-x/sql/~latest~/l64-sql.zip
    ```
=== "macOS"
    ```bash
    curl -L -O https://portal.dl.kx.com/assets/raw/kdb-x/sql/~latest~/m64-sql.zip
    ```
=== "Windows"
    Download [w64-sql.zip](https://portal.dl.kx.com/assets/raw/kdb-x/sql/~latest~/w64-sql.zip) in your browser.

To install a specific version instead, replace `~latest~` with the version number, for example `1.2.3`.

### 2. Extract and copy the file

Extract the archive, then copy `s.k_` into `q/` in your installation directory. Copying over the existing file updates it.

=== "Linux"
    ```bash
    unzip -q l64-sql.zip -d sql
    cp sql/s.k_ "$HOME/.kx/q/"
    ```
=== "macOS"
    ```bash
    unzip -q m64-sql.zip -d sql
    cp sql/s.k_ "$HOME/.kx/q/"
    ```
=== "Windows"
    Extract the archive, then copy `s.k_` into `q/` in your KDB-X installation

The same archive contains the pgwire executable. To update it at the same time, follow [Install and update pgwire](../pgwire/install.md).

### 3. Verify the installation

Start q and initialize the SQL interface. `.s.rel` returns the release date of the loaded `s.k_`, which you can compare with the [SQL release notes](release-notes/changelog.md).
```q
q).s.init[]
q).s.rel
2026.10.20
```

If `.s.init[]` fails with an error, `s.k_` is not in `q/` in the installation directory that q is using.

## Next steps

- Run your first SQL statements with the [SQL quickstart](quickstart.md).
- Connect PostgreSQL clients to KDB-X with [pgwire](../pgwire/introduction.md).
- Read what changed in each release in the [SQL release notes](release-notes/changelog.md).
