This documentation contains information for installing HarperDB locally. Note that if you’d like to get up and running quickly, you can try a managed instance with HarperDB Cloud. HarperDB is a cross-platform database; we recommend Linux for production use, but HarperDB can run on Windows and Mac as well, for development purposes. Installation is usually very simple and just takes a few steps, but there are a few different options documented here.
HarperDB runs on Node.js, so if you do not have it installed, you need to do that first (if you have installed, you can skip to installing HarperDB, itself). Node.js can be downloaded and installed from their site. For Linux and Mac, we recommend installing and managing Node versions with NVM, which has instructions for installation, but generally NVM can be installed with:
And then logout and login, and then install Node.js using nvm. We recommend using LTS, but support all currently maintained Node versions (which is currently version 14 and newer, and make sure to always uses latest minor/patch for the major version):
Then you can install HarperDB with NPM and start it:
HarperDB will automatically start after installation.
If you are setting up a production server on Linux, we have much more extensive documentation on how to configure volumes for database storage, set up a systemd script, configure your operating system for use a database server in our linux installation guide.
If you would like to run HarperDB in Docker, install Docker Desktop on your Mac or Windows computer. Otherwise, install the Docker Engine on your Linux server.
Once Docker Desktop or Docker Engine is installed, visit our Docker Hub page for information and examples on how to run a HarperDB container.
If you need to install HarperDB on a device that doesn't have an Internet connection, you can choose your version and download the npm package and install it directly (you’ll still need Node.js and NPM):
Once you’ve downloaded the .tgz file, run the following command from the directory where you’ve placed it:
For more information visit the HarperDB Command Line Interface guide.
HarperDB comes with binaries for standard AMD64/x64 or ARM64 CPU architectures on Linux, Windows (x64 only), and Mac (including Apple Silicon). However, if you are installing on a less common platform (Alpine, for example), you will need to ensure that you have build tools installed for the installation process to compile the binaries (this is handled automatically), including:
Go: version 1.19.1
GCC
Make
Python v3.7, v3.8, v3.9, or v3.10
If you wish to install locally or already have a configured server, see the basic Installation Guide
The following is a recommended way to configure Linux and install HarperDB. These instructions should work reasonably well for any public cloud or on-premises Linux instance.
These instructions assume that the following has already been completed:
Linux is installed
Basic networking is configured
A non-root user account dedicated to HarperDB with sudo privileges exists
An additional volume for storing HarperDB files is attached to the Linux instance
Traffic to ports 9925 (HarperDB Operations API,) 9926 (HarperDB Custom Functions,) and 9932 (HarperDB Clustering) is permitted
For this example, we will use an AWS Ubuntu Server 22.04 LTS m5.large EC2 Instance with an additional General Purpose SSD EBS volume and the default “ubuntu” user account.
Logical Volume Manager (LVM) can be used to stripe multiple disks together to form a single logical volume. If striping disks together is not a requirement, skip these steps.
Find disk that already has a partition
Create array of free disks
Get quantity of free disks
Construct pvcreate command
Initialize disks for use by LVM
Create volume group
Create logical volume
Run lsblk
and note the device name of the additional volume
Create an ext4 filesystem on the volume (The below commands assume the device name is nvme1n1. If you used LVM to create logical volume, replace /dev/nvme1n1 with /dev/hdb_vg/hdb_lv)
Mount the file system and set the correct permissions for the directory
Create a fstab entry to mount the filesystem on boot
If a swap file or partition does not already exist, create and enable a 2GB swap file
Increase the open file limits for the ubuntu user
Install Node Version Manager (nvm)
Load nvm (or logout and then login)
Install Node.js using nvm (read more about specific Node version requirements)
Here is an example of installing HarperDB with minimal configuration.
Here is an example of installing HarperDB with commonly used additional configuration.
HarperDB will automatically start after installation. If you wish HarperDB to start when the OS boots, you have two options
You can set up a crontab:
Or you can create a systemd script at /etc/systemd/system/harperdb.service
Pasting the following contents into the file:
And then running the following:
For more information visit the HarperDB Command Line Interface guide and the HarperDB Configuration File guide.