Build from Source
Build and install DiceDB from source code
DiceDB supports Linux, macOS, OpenBSD, NetBSD, and FreeBSD. Building from source gives you the latest features and allows you to customize the build options.
Prerequisites
Before building DiceDB, ensure you have:
- A C compiler (GCC or Clang)
- Make
- Git (for cloning the repository)
Clone
DiceDB uses Git Submodules
and hence while cloning the repository make sure you pass the --recursive flag
git clone git@github.com/dicedb/dice --recursiveBuilding DiceDB
Basic Compilation
The simplest way to build DiceDB is:
makeThis will compile DiceDB with default settings for your platform.
Build Options
DiceDB supports several optional build features:
TLS Support
To enable Transport Layer Security:
# Integrated TLS support
make BUILD_TLS=yes
# Module-based TLS
make BUILD_TLS=moduleRDMA Support (Experimental)
For RDMA support:
# Integrated RDMA
make BUILD_RDMA=yes
# Module-based RDMA
make BUILD_RDMA=moduleSystemd Integration
To enable systemd support on Linux:
make USE_SYSTEMD=yesFast Float Optimization
For optimized performance with sorted sets:
make USE_FAST_FLOAT=yes32-bit Build
To build a 32-bit binary:
make 32bitCustom Binary Suffix
To append a custom suffix to program names:
make PROG_SUFFIX="-custom"Testing
After compilation, validate your build:
# Run all tests
make test
# Run specific test suites
make test-unit # Unit tests
make test-modules # Module tests
make test-cluster # Cluster testsInstallation
Install the compiled binaries to /usr/local/bin:
make installBy default, this installs to /usr/local/bin. You can customize the installation prefix:
make PREFIX=/opt/dicedb installProduction Setup (Linux)
For production deployments on Ubuntu/Debian systems, you can use the provided utility script to configure init scripts and configuration files:
cd utils
./install_server.shThis script will:
- Create the necessary directories
- Configure the init script
- Set up the default configuration
- Start the DiceDB service
Verifying the Installation
After installation, verify that DiceDB is working:
# Start the server
dicedb-server
# In another terminal, connect with the CLI
dicedb-cli pingYou should receive a PONG response.