Skip to main content
RocksDB provides comprehensive support for Linux distributions, with optimized builds for various package managers and architectures.

Prerequisites

Compiler Requirements

RocksDB requires a modern C++ compiler with C++20 support:
  • GCC: Version 11 or higher
  • Clang: Version 10 or higher
While RocksDB can compile without any dependencies, installing compression libraries significantly improves performance:
  • zlib: General-purpose compression
  • bzip2: High compression ratio
  • lz4: Extremely fast compression
  • snappy: Fast compression optimized for speed
  • zstandard: Fast real-time compression algorithm
Optional dependencies:
  • gflags: Required for command-line tools
  • clang-format: Required for code formatting checks

Ubuntu / Debian

1

Update compiler

Ensure you have GCC 11 or higher:
2

Install dependencies

Install compression libraries and tools:
3

Clone repository

4

Build RocksDB

Don’t use make or make all for production builds. These compile in debug mode, which is significantly slower than release mode.
5

Run tests (optional)

CentOS / RHEL / Fedora

1

Update compiler

Ensure you have GCC 11 or higher:
2

Install gflags from source

After installation, add the include and library paths:
3

Install compression libraries

4

Clone and build

Installing zstandard on older systems

If zstandard is not available through your package manager:

Build Options

Portable Build

By default, RocksDB optimizes for your specific CPU (-march=native). To build a binary compatible with different architectures:
For a reasonable compromise between optimization and compatibility on x86_64:
This supports most processors made since 2013 while maintaining good performance.

Debug vs Release

Production builds: Always use make static_lib or make shared_lib (release mode).Development builds: Use make all or make check (debug mode).

Verification

Verify your installation:

Next Steps

Getting Started

Learn the basics of using RocksDB

API Reference

Explore the complete API documentation