Skip to content

Commit 09a6c16

Browse files
committed
DEV: add build from source procedures
1 parent 8a7a522 commit 09a6c16

File tree

8 files changed

+723
-1
lines changed

8 files changed

+723
-1
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- stack
6+
- oss
7+
description: Build Redis Community Edition on Linux and macOS
8+
linkTitle: Build Redis CE from source
9+
stack: true
10+
title: Build Redis Community Edition
11+
weight: 20
12+
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" >}}).
13+
bannerChildren: true
14+
---
15+
16+
Build instruction are provided for the following platforms:
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- stack
6+
- oss
7+
linkTitle: Debian 12 (Bookworm)
8+
title: Build Redis Community Edition from source on Debian
9+
weight: 5
10+
---
11+
12+
Follow the steps below to build Redis from source on a system running Debian 12 ("bookworm"):
13+
14+
## 1. Install required dependencies
15+
16+
First, update your package lists and install the development tools and libraries needed to build Redis:
17+
18+
```bash
19+
sudo apt-get update
20+
sudo apt-get install -y --no-install-recommends \
21+
ca-certificates \
22+
wget \
23+
dpkg-dev \
24+
gcc \
25+
g++ \
26+
libc6-dev \
27+
libssl-dev \
28+
make \
29+
git \
30+
cmake \
31+
python3 \
32+
python3-pip \
33+
python3-venv \
34+
python3-dev \
35+
unzip \
36+
rsync \
37+
clang \
38+
automake \
39+
autoconf \
40+
libtool
41+
```
42+
43+
## 2. Download the Redis source code
44+
45+
Download the Redis source code archive from GitHub. For example, to download version `8.0-m04`:
46+
47+
```bash
48+
wget -O redis.tar.gz https://github.com/redis/redis/archive/refs/tags/8.0-m04.tar.gz
49+
```
50+
51+
Verify the SHA-256 checksum of the archive to ensure integrity:
52+
53+
```bash
54+
echo "6902a938c629a33f14d49881b1b60e6621c29e445554f882ce7ec48f2743d516 *redis.tar.gz" | sha256sum -c -
55+
```
56+
57+
## 3. Extract the source archive
58+
59+
Create a directory for the source code and extract the contents into it:
60+
61+
```bash
62+
mkdir -p /usr/src/redis
63+
tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1
64+
rm redis.tar.gz
65+
```
66+
67+
## 4. Build Redis
68+
69+
Set the appropriate environment variables to enable TLS, modules, and other build options, then compile and install Redis:
70+
71+
```bash
72+
export BUILD_TLS=yes
73+
export BUILD_WITH_MODULES=yes
74+
export INSTALL_RUST_TOOLCHAIN=yes
75+
export DISABLE_WERRORS=yes
76+
77+
make -C /usr/src/redis -j "$(nproc)" all
78+
sudo make -C /usr/src/redis install
79+
```
80+
81+
This builds the Redis server, CLI, and any included modules.
82+
83+
## 5. (Optional) Verify the installation
84+
85+
You can confirm that Redis has been built and installed successfully by checking the version:
86+
87+
```bash
88+
redis-server --version
89+
redis-cli --version
90+
```
91+
92+
## 6. Starting Redis with modules
93+
94+
To start Redis with modules like RediSearch, RedisJSON, RedisTimeSeries, and RedisBloom, use the `--loadmodule` option for each module:
95+
96+
```bash
97+
redis-server \
98+
--loadmodule /usr/local/lib/redis/modules/redisearch.so \
99+
--loadmodule /usr/local/lib/redis/modules/rejson.so \
100+
--loadmodule /usr/local/lib/redis/modules/redistimeseries.so \
101+
--loadmodule /usr/local/lib/redis/modules/redisbloom.so
102+
```
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- stack
6+
- oss
7+
linkTitle: Debian 11 (Bullseye)
8+
title: Build Redis Community Edition from source on Debian
9+
weight: 5
10+
---
11+
12+
Follow the steps below to build Redis from source on a system running Debian 11 ("bullseye"):
13+
14+
## 1. Install required dependencies
15+
16+
First, update your package lists and install the development tools and libraries needed to build Redis:
17+
18+
```bash
19+
sudo apt-get update
20+
sudo apt-get install -y --no-install-recommends \
21+
ca-certificates \
22+
wget \
23+
dpkg-dev \
24+
gcc \
25+
g++ \
26+
libc6-dev \
27+
libssl-dev \
28+
make \
29+
git \
30+
cmake \
31+
python3 \
32+
python3-pip \
33+
python3-venv \
34+
python3-dev \
35+
unzip \
36+
rsync \
37+
clang \
38+
automake \
39+
autoconf \
40+
libtool
41+
```
42+
43+
## 2. Download the Redis source code
44+
45+
Download the Redis source code archive from GitHub. For example, to download version `8.0-m04`:
46+
47+
```bash
48+
wget -O redis.tar.gz https://github.com/redis/redis/archive/refs/tags/8.0-m04.tar.gz
49+
```
50+
51+
Verify the SHA-256 checksum of the archive to ensure integrity:
52+
53+
```bash
54+
echo "6902a938c629a33f14d49881b1b60e6621c29e445554f882ce7ec48f2743d516 *redis.tar.gz" | sha256sum -c -
55+
```
56+
57+
## 3. Extract the source archive
58+
59+
Create a directory for the source code and extract the contents into it:
60+
61+
```bash
62+
mkdir -p /usr/src/redis
63+
tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1
64+
rm redis.tar.gz
65+
```
66+
67+
## 4. Build Redis
68+
69+
Set the appropriate environment variables to enable TLS, modules, and other build options, then compile and install Redis:
70+
71+
```bash
72+
export BUILD_TLS=yes
73+
export BUILD_WITH_MODULES=yes
74+
export INSTALL_RUST_TOOLCHAIN=yes
75+
export DISABLE_WERRORS=yes
76+
77+
make -C /usr/src/redis -j "$(nproc)" all
78+
sudo make -C /usr/src/redis install
79+
```
80+
81+
This builds the Redis server, CLI, and any included modules.
82+
83+
## 5. (Optional) Verify the installation
84+
85+
You can confirm that Redis has been built and installed successfully by checking the version:
86+
87+
```bash
88+
redis-server --version
89+
redis-cli --version
90+
```
91+
92+
## 6. Starting Redis with modules
93+
94+
To start Redis with modules like RediSearch, RedisJSON, RedisTimeSeries, and RedisBloom, use the `--loadmodule` option for each module:
95+
96+
```bash
97+
redis-server \
98+
--loadmodule /usr/local/lib/redis/modules/redisearch.so \
99+
--loadmodule /usr/local/lib/redis/modules/rejson.so \
100+
--loadmodule /usr/local/lib/redis/modules/redistimeseries.so \
101+
--loadmodule /usr/local/lib/redis/modules/redisbloom.so
102+
```
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
categories:
3+
- docs
4+
- operate
5+
- stack
6+
- oss
7+
linkTitle: Rocky Linux 8
8+
title: Build Redis Community Edition from source on Rocky Linux
9+
weight: 5
10+
---
11+
12+
Follow the steps below to build Redis from source on a system running Rocky Linux 8:
13+
14+
## 1. Prepare the system
15+
16+
Clean the package metadata, enable required repositories, and install development tools:
17+
18+
```bash
19+
sudo dnf clean all
20+
21+
# Add GoReleaser repo
22+
sudo tee /etc/yum.repos.d/goreleaser.repo > /dev/null <<EOF
23+
[goreleaser]
24+
name=GoReleaser
25+
baseurl=https://repo.goreleaser.com/yum/
26+
enabled=1
27+
gpgcheck=0
28+
EOF
29+
30+
sudo dnf update -y
31+
sudo dnf groupinstall "Development Tools" -y
32+
sudo dnf config-manager --set-enabled powertools
33+
sudo dnf install -y epel-release
34+
```
35+
36+
## 2. Install required packages
37+
38+
Install the build dependencies, Python 3.11, and supporting tools:
39+
40+
```bash
41+
sudo dnf install -y --nobest --skip-broken \
42+
pkg-config \
43+
wget \
44+
gcc-toolset-13-gcc \
45+
gcc-toolset-13-gcc-c++ \
46+
git \
47+
make \
48+
openssl \
49+
openssl-devel \
50+
python3.11 \
51+
python3.11-pip \
52+
python3.11-devel \
53+
unzip \
54+
rsync \
55+
clang \
56+
curl \
57+
libtool \
58+
automake \
59+
autoconf \
60+
jq \
61+
systemd-devel
62+
```
63+
64+
Create a Python virtual environment:
65+
66+
```bash
67+
python3.11 -m venv /opt/venv
68+
```
69+
70+
Enable the GCC toolset:
71+
72+
```bash
73+
sudo cp /opt/rh/gcc-toolset-13/enable /etc/profile.d/gcc-toolset-13.sh
74+
echo "source /etc/profile.d/gcc-toolset-13.sh" | sudo tee -a /etc/bashrc
75+
```
76+
77+
## 3. Install CMake
78+
79+
Install CMake 3.25.1 manually:
80+
81+
```bash
82+
CMAKE_VERSION=3.25.1
83+
ARCH=$(uname -m)
84+
85+
if [ "$ARCH" = "x86_64" ]; then
86+
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-x86_64.sh
87+
else
88+
CMAKE_FILE=cmake-${CMAKE_VERSION}-linux-aarch64.sh
89+
fi
90+
91+
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_FILE}
92+
chmod +x ${CMAKE_FILE}
93+
./${CMAKE_FILE} --skip-license --prefix=/usr/local --exclude-subdir
94+
rm ${CMAKE_FILE}
95+
96+
cmake --version
97+
```
98+
99+
## 4. Download and extract the Redis source
100+
101+
Download Redis 8.0-m04 and verify its checksum:
102+
103+
```bash
104+
wget -O redis.tar.gz https://github.com/redis/redis/archive/refs/tags/8.0-m04.tar.gz
105+
echo "6902a938c629a33f14d49881b1b60e6621c29e445554f882ce7ec48f2743d516 *redis.tar.gz" | sha256sum -c -
106+
107+
mkdir -p /usr/src/redis
108+
tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1
109+
rm redis.tar.gz
110+
```
111+
112+
## 5. Build Redis
113+
114+
Enable the GCC toolset and build Redis with support for TLS and modules:
115+
116+
```bash
117+
source /etc/profile.d/gcc-toolset-13.sh
118+
cd /usr/src/redis
119+
120+
export BUILD_TLS=yes
121+
export BUILD_WITH_MODULES=yes
122+
export INSTALL_RUST_TOOLCHAIN=yes
123+
export DISABLE_WERRORS=yes
124+
125+
make -j "$(nproc)" all
126+
sudo make install
127+
```
128+
129+
## 6. (Optional) Verify the installation
130+
131+
Check the installed Redis server and CLI versions:
132+
133+
```bash
134+
redis-server --version
135+
redis-cli --version
136+
```
137+
138+
## 7. Starting Redis with modules
139+
140+
To start Redis with RediSearch, RedisJSON, RedisTimeSeries, and RedisBloom modules, use the following command:
141+
142+
```bash
143+
redis-server \
144+
--loadmodule /usr/local/lib/redis/modules/redisearch.so \
145+
--loadmodule /usr/local/lib/redis/modules/rejson.so \
146+
--loadmodule /usr/local/lib/redis/modules/redistimeseries.so \
147+
--loadmodule /usr/local/lib/redis/modules/redisbloom.so
148+
```

0 commit comments

Comments
 (0)