You can run kdb+ on Linux, macOS, or Windows.
You have the 64-bit On Demand Personal Edition interpreter, licensed for non-commercial use. (32-bit interpreters are licensed only for commercial use.)
The interpreter is enabled by a
kc.lic license-key file and requires an always-on Internet connection.
This version of kdb+ is not licensed for use on cloud servers.
You have the 64-bit interpreter and a
kc.lic license-key file
You have a 32-bit interpreter.
32-bit applications will not run in macOS 10.15+ (Catalina and later)
Step 1: Download¶
Internal distribution at customer sites
Most customers download the latest release of kdb+ (along with the accompanying
README.txt, the detailed change list) and make a limited number of approved kdb+ versions available from a central file server.
Designated Contacts should encourage developers to keep production systems up to date with these versions of kdb+. This can greatly simplify development, deployment and debugging.
Platforms and versions
The names of the ZIPs denote the platform (
l64.zip – 64-bit Linux;
w32.zip – 32-bit Windows, etc.).
Numerical release versions of the form 3.5, or 4.0 are production code. Versions of kdb+ with a trailing
t in the name such as
3.7t are test versions and are neither intended nor supported for production use.
Step 2: Unzip your download¶
Here we assume you install kdb+ in your
HOME directory on Linux or macOS; or in
C:\ on Windows, and set the environment variable
os QHOME --------------- Linux ~/q macOS ~/q Windows c:\q
You can install kdb+ anywhere as long as you set the path in
Open a command shell and
cd to your downloads directory.
Unzip the downloaded ZIP to produce a folder
q in your install location.
unzip l64.zip -d $HOME/q
unzip m64.zip -d $HOME/q
Expand-Archive w64.zip -DestinationPath C:\q
rlwrap for Linux and macOS
On Linux and macOS the
rlwrap command allows the Up arrow to retrieve earlier expressions in the q session. It is very useful and we recommend installing it.
Ask for its version number:
rlwrap -v. If you see one,
rlwrap is already installed. Otherwise, you will see
rlwrap: command not found.
How to run 32-bit kdb+ on 64-bit Linux
uname -m command to determine whether your machine is using the 32-bit or 64-bit Linux distribution.
If the result is
i386or similar, you are running a 32-bit Linux distribution
x86_64, you are running a 64-bit Linux distribution
To install 32-bit kdb+ on a 64-bit Linux distribution, you need a 32-bit library. Use your usual package manager to install i686 or i386: for example,
sudo apt-get install libc6-i386.
Step 3: Install the license file¶
If you have a license file,
kc.lic, put it in the
QHOME directory will then contain:
├── kc.lic ├── l64/ │ └── q └── q.k
├── kc.lic ├── m64/ │ └── q └── q.k
├── kc.lic ├── w64/ │ └── q └── q.k
(32-bit versions have
32 in the folder name instead of
Kdb+ looks for a license file in
QHOME. To keep your license file elsewhere, set its path in environment variable
Step 4: Confirm success¶
Confirm kdb+ is working: launch your first q session.
cd spctl --add q/m64/q xattr -d com.apple.quarantine q/m64/q q/m64/q
Authorizing macOS Catalina to run kdb+
MacOS Catalina (10.15) introduced tighter security. At this point it may display a warning that it does not recognize the software.
xattr commands above have not authorized the OS to run q, open System Preferences > Security & Privacy.
You should see a notification that q has been blocked – and a button to override the block.
The q session opens with a banner like this.
KDB+ 4.0 2020.06.01 Copyright (C) 1993-2020 Kx Systems m64/ 12()core 65536MB sjt mackenzie.local 127.0.0.1 EXPIRE… q)
License files and 32-bit kdb+
32-bit kdb+ does not require a license file to run, but if it finds one at launch it will signal a license error if the license is not valid.
Try your first expression.
q)til 6 0 1 2 3 4 5
End the q session and return to the command shell.
Step 5: Edit your profile¶
q as a command allows you to invoke kdb+ without specifying the path to it.
The q interpreter refers to environment variable
QHOME for the location of certain files.
Without this variable, it will guess based on the path to the interpreter.
Better to set the variable explicitly.
QLIC environment variable tells kdb+ where to find a license key file. Absent the variable,
QHOME is used.
~/.bash_profilein a text editor, append the following line, and save the file. (Edit
~/.bashrcto define a q command for non-console processes.)
alias q='QHOME=~/q rlwrap -r ~/q/l64/q'
- In the command shell, use the revised profile:
~/.zshrcin a text editor, append the following lines, and save the file. (In macOS Mojave and earlier the profile is
alias q='QHOME=~/q rlwrap -r ~/q/m64/q'
- In the command shell, use the revised profile:
In the command shell issue the following commands:
setx QHOME "C:\q"
setx PATH "%PATH%;C:\q\w64"
(In the above, substitute
64 if you are installing 32-bit kdb+.)
Test the new command. Open a new command shell and type
Last login: Sat Jun 20 12:42:49 on ttys004 ❯ q KDB+ 4.0 2020.06.01 Copyright (C) 1993-2020 Kx Systems m64/ 12()core 65536MB sjt mackenzie.local 127.0.0.1 EXPIRE… q)
Interactive development environments¶
If you are a solo student, we recommend learning q by running it from a command shell, as a REPL, writing scripts in a text editor. The examples on this site are produced that way; visual fidelity should help you as you learn.
Notebooks are not, however, an IDE, and are unsuitable for studying features such as event handlers.
For more advanced study, use either the bare q REPL, or download and install our interactive development environment, KX Developer.