Skip to content
16 changes: 16 additions & 0 deletions content/operate/oss_and_stack/install/build-stack/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
categories:
- docs
- operate
- stack
- oss
description: Build Redis Community Edition on Linux and macOS
linkTitle: Build Redis CE from source
stack: true
title: Build Redis Community Edition
weight: 20
bannerText: These build instructions are not yet complete for Redis CE 8.0 GA. For build instructions prior to Redis CE 8.0, see [this page]({{< relref "/operate/oss_and_stack/install/archive/install-redis/install-redis-from-source" >}}).
bannerChildren: true
---

Build instruction are provided for the following platforms:
102 changes: 102 additions & 0 deletions content/operate/oss_and_stack/install/build-stack/debian-bookwarm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
categories:
- docs
- operate
- stack
- oss
linkTitle: Debian 12 (Bookworm)
title: Build Redis Community Edition from source on Debian
weight: 5
---

Follow the steps below to build Redis from source on a system running Debian 12 ("bookworm"):

## 1. Install required dependencies

First, update your package lists and install the development tools and libraries needed to build Redis:

```bash
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
ca-certificates \
wget \
dpkg-dev \
gcc \
g++ \
libc6-dev \
libssl-dev \
make \
git \
cmake \
python3 \
python3-pip \
python3-venv \
python3-dev \
unzip \
rsync \
clang \
automake \
autoconf \
libtool
```

## 2. Download the Redis source code

Download the Redis source code archive from GitHub. For example, to download version `8.0-m04`:

```bash
wget -O redis.tar.gz https://github.com/redis/redis/archive/refs/tags/8.0-m04.tar.gz
```

Verify the SHA-256 checksum of the archive to ensure integrity:

```bash
echo "6902a938c629a33f14d49881b1b60e6621c29e445554f882ce7ec48f2743d516 *redis.tar.gz" | sha256sum -c -
```

## 3. Extract the source archive

Create a directory for the source code and extract the contents into it:

```bash
mkdir -p /usr/src/redis
tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1
rm redis.tar.gz
```

## 4. Build Redis

Set the appropriate environment variables to enable TLS, modules, and other build options, then compile and install Redis:

```bash
export BUILD_TLS=yes
export BUILD_WITH_MODULES=yes
export INSTALL_RUST_TOOLCHAIN=yes
export DISABLE_WERRORS=yes

make -C /usr/src/redis -j "$(nproc)" all
sudo make -C /usr/src/redis install
```

This builds the Redis server, CLI, and any included modules.

## 5. (Optional) Verify the installation

You can confirm that Redis has been built and installed successfully by checking the version:

```bash
redis-server --version
redis-cli --version
```

## 6. Starting Redis with modules

To start Redis with modules like RediSearch, RedisJSON, RedisTimeSeries, and RedisBloom, use the `--loadmodule` option for each module:

```bash
redis-server \
--loadmodule /usr/local/lib/redis/modules/redisearch.so \
--loadmodule /usr/local/lib/redis/modules/rejson.so \
--loadmodule /usr/local/lib/redis/modules/redistimeseries.so \
--loadmodule /usr/local/lib/redis/modules/redisbloom.so
```
102 changes: 102 additions & 0 deletions content/operate/oss_and_stack/install/build-stack/debian-bullseye.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
categories:
- docs
- operate
- stack
- oss
linkTitle: Debian 11 (Bullseye)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should just include a guide for the latest version of each of these? to encourage using the latest version? Only bookworm, noble, and rhel/rocky/alma 9? @LiorKogan

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should provide instructions for all the OSes we test against.
They are now going to be listed in the Redis 8.0 release notes

  • Ubuntu 20.04 (Focal Fossa), 22.04 (Jammy Jellyfish), 24.04 (Noble Numbat)
  • CentOS 9
  • Rocky Linux 8.10, 9.5
  • AlmaLinux 8.10, 9.5
  • Debian 11 (Bullseye), 12 (Bookworm)
  • macOS 13 (Ventura), 14 (Sonoma), 15 (Sequoia)

Let me know if we need to fix something

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CentOS 9 wasn't on your list. If I need to add it, I'll need a Dockerfile from @adobrzhansky. Isn't CentOS dead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title: Build Redis Community Edition from source on Debian
weight: 5
---

Follow the steps below to build Redis from source on a system running Debian 11 ("bullseye"):

## 1. Install required dependencies

First, update your package lists and install the development tools and libraries needed to build Redis:

```bash
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
ca-certificates \
wget \
dpkg-dev \
gcc \
g++ \
libc6-dev \
libssl-dev \
make \
git \
cmake \
python3 \
python3-pip \
python3-venv \
python3-dev \
unzip \
rsync \
clang \
automake \
autoconf \
libtool
```

## 2. Download the Redis source code

Download the Redis source code archive from GitHub. For example, to download version `8.0-m04`:

```bash
wget -O redis.tar.gz https://github.com/redis/redis/archive/refs/tags/8.0-m04.tar.gz
```

Verify the SHA-256 checksum of the archive to ensure integrity:

```bash
echo "6902a938c629a33f14d49881b1b60e6621c29e445554f882ce7ec48f2743d516 *redis.tar.gz" | sha256sum -c -
```

## 3. Extract the source archive

Create a directory for the source code and extract the contents into it:

```bash
mkdir -p /usr/src/redis
tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1
rm redis.tar.gz
```

## 4. Build Redis

Set the appropriate environment variables to enable TLS, modules, and other build options, then compile and install Redis:

```bash
export BUILD_TLS=yes
export BUILD_WITH_MODULES=yes
export INSTALL_RUST_TOOLCHAIN=yes
export DISABLE_WERRORS=yes

make -C /usr/src/redis -j "$(nproc)" all
sudo make -C /usr/src/redis install
```

This builds the Redis server, CLI, and any included modules.

## 5. (Optional) Verify the installation

You can confirm that Redis has been built and installed successfully by checking the version:

```bash
redis-server --version
redis-cli --version
```

## 6. Starting Redis with modules

To start Redis with modules like RediSearch, RedisJSON, RedisTimeSeries, and RedisBloom, use the `--loadmodule` option for each module:

```bash
redis-server \
--loadmodule /usr/local/lib/redis/modules/redisearch.so \
--loadmodule /usr/local/lib/redis/modules/rejson.so \
--loadmodule /usr/local/lib/redis/modules/redistimeseries.so \
--loadmodule /usr/local/lib/redis/modules/redisbloom.so
```
148 changes: 148 additions & 0 deletions content/operate/oss_and_stack/install/build-stack/rocky-8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
---
categories:
- docs
- operate
- stack
- oss
linkTitle: Rocky Linux 8
title: Build Redis Community Edition from source on Rocky Linux
weight: 5
---

Follow the steps below to build Redis from source on a system running Rocky Linux 8:

## 1. Prepare the system

Clean the package metadata, enable required repositories, and install development tools:

```bash
sudo dnf clean all

# Add GoReleaser repo
sudo tee /etc/yum.repos.d/goreleaser.repo > /dev/null <<EOF
[goreleaser]
name=GoReleaser
baseurl=https://repo.goreleaser.com/yum/
enabled=1
gpgcheck=0
EOF

sudo dnf update -y
sudo dnf groupinstall "Development Tools" -y
sudo dnf config-manager --set-enabled powertools
sudo dnf install -y epel-release
```

## 2. Install required packages

Install the build dependencies, Python 3.11, and supporting tools:

```bash
sudo dnf install -y --nobest --skip-broken \
pkg-config \
wget \
gcc-toolset-13-gcc \
gcc-toolset-13-gcc-c++ \
git \
make \
openssl \
openssl-devel \
python3.11 \
python3.11-pip \
python3.11-devel \
unzip \
rsync \
clang \
curl \
libtool \
automake \
autoconf \
jq \
systemd-devel
```

Create a Python virtual environment:

```bash
python3.11 -m venv /opt/venv
```

Enable the GCC toolset:

```bash
sudo cp /opt/rh/gcc-toolset-13/enable /etc/profile.d/gcc-toolset-13.sh
echo "source /etc/profile.d/gcc-toolset-13.sh" | sudo tee -a /etc/bashrc
```

## 3. Install CMake

Install CMake 3.25.1 manually:

```bash
CMAKE_VERSION=3.25.1
ARCH=$(uname -m)

if [ "$ARCH" = "x86_64" ]; then
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-x86_64.sh
else
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-aarch64.sh
fi

wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_FILE}
chmod +x ${CMAKE_FILE}
./${CMAKE_FILE} --skip-license --prefix=/usr/local --exclude-subdir
rm ${CMAKE_FILE}

cmake --version
```

## 4. Download and extract the Redis source

Download Redis 8.0-m04 and verify its checksum:

```bash
wget -O redis.tar.gz https://github.com/redis/redis/archive/refs/tags/8.0-m04.tar.gz
echo "6902a938c629a33f14d49881b1b60e6621c29e445554f882ce7ec48f2743d516 *redis.tar.gz" | sha256sum -c -

mkdir -p /usr/src/redis
tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1
rm redis.tar.gz
```

## 5. Build Redis

Enable the GCC toolset and build Redis with support for TLS and modules:

```bash
source /etc/profile.d/gcc-toolset-13.sh
cd /usr/src/redis

export BUILD_TLS=yes
export BUILD_WITH_MODULES=yes
export INSTALL_RUST_TOOLCHAIN=yes
export DISABLE_WERRORS=yes

make -j "$(nproc)" all
sudo make install
```

## 6. (Optional) Verify the installation

Check the installed Redis server and CLI versions:

```bash
redis-server --version
redis-cli --version
```

## 7. Starting Redis with modules

To start Redis with RediSearch, RedisJSON, RedisTimeSeries, and RedisBloom modules, use the following command:

```bash
redis-server \
--loadmodule /usr/local/lib/redis/modules/redisearch.so \
--loadmodule /usr/local/lib/redis/modules/rejson.so \
--loadmodule /usr/local/lib/redis/modules/redistimeseries.so \
--loadmodule /usr/local/lib/redis/modules/redisbloom.so
```
Loading