-
Notifications
You must be signed in to change notification settings - Fork 286
DEV: add build from source procedures #1319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
09a6c16
56c516d
7888116
29b55ac
84a2dec
f8ca1ef
b416dea
7ed8541
21013c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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: | ||
dwdougherty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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"): | ||
dwdougherty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## 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 | ||
dwdougherty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 - | ||
dwdougherty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ## 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: | ||
dwdougherty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```bash | ||
| redis-server \ | ||
dwdougherty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --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 | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| --- | ||
| categories: | ||
| - docs | ||
| - operate | ||
| - stack | ||
| - oss | ||
| linkTitle: Debian 11 (Bullseye) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should provide instructions for all the OSes we test against.
Let me know if we need to fix something
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adamiBs we have CentOS9 in https://github.com/redis/redis-rpm |
||
| title: Build Redis Community Edition from source on Debian | ||
dwdougherty marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 | ||
| ``` | ||
| 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 | ||
| ``` |
Uh oh!
There was an error while loading. Please reload this page.