Build the source code

Build the source code.


AlmaLinux 8 is the recommended Linux development platform for YugabyteDB.

The following instructions are for CentOS 7.


The commands below assume the following:

  • You have sudo access.
  • You are using a bash or zsh shell.
  • You are running the commands as the user who will be doing development.
# Modify to your preference:

sudo yum update -y
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y centos-release-scl epel-release
sudo yum install -y "${packages[@]}"
sudo ln -s /usr/bin/cmake3 /usr/local/bin/cmake
sudo ln -s /usr/bin/ctest3 /usr/local/bin/ctest
sudo mkdir /opt/yb-build

# If you'd like to use an unprivileged user for development, manually
# run/modify instructions from here onwards (change $USER, make sure shell
# variables are set appropriately when switching users).
sudo chown "$USER" /opt/yb-build
source <(echo 'source /opt/rh/rh-python38/enable' \
         | tee -a "$shellrc")
source <(echo 'source /opt/rh/rh-maven35/enable' \
         | tee -a "$shellrc")
source <(echo 'export YB_CCACHE_DIR="$HOME/.cache/yb_ccache"' \
         | tee -a "$shellrc")

git clone
cd yugabyte-db

Detailed instructions

Update and install basic development packages as follows:

sudo yum update -y
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y centos-release-scl epel-release git libatomic rsync which


By default, when running build, third-party libraries are not built, and pre-built libraries are downloaded. We also use Linuxbrew to provide some of the third-party dependencies. The build scripts automatically install these in directories under /opt/yb-build. In order for the build script to write under those directories, it needs proper permissions. One way to do that is as follows:

sudo mkdir /opt/yb-build
sudo chown "$USER" /opt/yb-build

Alternatively, specify the build options --no-download-thirdparty and/or --no-linuxbrew. Note that those options may require additional, undocumented steps.

Python 3

Python 3.7 or higher is required.

The following example installs Python 3.8.

sudo yum -y install rh-python38
# Also add the following line to your .bashrc or equivalent.
source /opt/rh/rh-python38/enable

CMake 3

CMake 3.17.3 or higher is required.

The package manager has that, but we still need to link the name cmake to cmake3. Do similarly for ctest.

sudo yum install -y cmake3
sudo ln -s /usr/bin/cmake3 /usr/local/bin/cmake
sudo ln -s /usr/bin/ctest3 /usr/local/bin/ctest


YugabyteDB core is written in C and C++, but the repository contains Java code needed to run some tests and sample applications. To build the Java part, you need:

  • Java Development Kit (JDK) 8 or 11.
  • Apache Maven 3.3 or later.

Install the following packages to satisfy the preceding requirements:

sudo yum install -y java-1.8.0-openjdk rh-maven35
# Also add the following line to your .bashrc or equivalent.
source /opt/rh/rh-maven35/enable


yugabyted-ui is a UI for yugabyted. By default, it is not built unless the corresponding build option is specified or a release package is being built. To build it, npm and Go 1.20 or higher are required.

sudo yum install -y npm golang

Ninja (optional)

Install Ninja for faster builds as follows:

sudo yum install -y ninja-build

Ccache (optional)

Install and configure Ccache for faster builds as follows:

sudo yum install -y ccache
# Also add the following line to your .bashrc or equivalent.
export YB_CCACHE_DIR="$HOME/.cache/yb_ccache"

GCC (optional)

To compile with GCC, install the following packages, and adjust the version numbers to match the GCC version you plan to use.

sudo yum install -y devtoolset-11 devtoolset-11-libatomic-devel

Note: there may be compilation issues (#22059).

Build the code

Assuming this repository is checked out in ~/code/yugabyte-db, do the following:

cd ~/code/yugabyte-db
./ release

The command above will build the release configuration, add the binaries into the build/release-<compiler>-dynamic-ninja directory, and create a build/latest symlink to that directory.


If you see errors, such as internal compiler error: Killed, the system has probably run out of memory. Try again by running the build script with less concurrency, for example, -j1.


If you get an error message such as

ValueError: Found no third-party release archives to download for OS type ubuntu20.04, compiler type matching gcc11, architecture x86_64, is_linuxbrew=False. See more details above.

it means that there is no third-party download available for that build configuration. Check the output that precedes the message for supported configurations.

For more details about building and testing, refer to Build and test.

Build release package (optional)

Perform the following steps to build a release package:

  1. Satisfy requirements for building yugabyted-ui.

  2. Install patchelf:

    sudo yum install -y patchelf
  3. Run the yb_release script using the following command:

    2023-02-10 23:19:46,459 [ INFO] Generated a package at '/home/user/code/yugabyte-db/build/yugabyte-'


The build may fail with "too many open files". In that case, increase the nofile limit in /etc/security/limits.conf as follows:

echo "* - nofile 1048576" | sudo tee -a /etc/security/limits.conf

Start a new shell session, and check the limit increase with ulimit -n.