# Build and run Redis Open Source on macOS 14 (Sonoma), 15 (Sequoia), and 26 (Tahoe)

```json metadata
{
  "schema_version": 2,
  "title": "Build and run Redis Open Source on macOS 14 (Sonoma), 15 (Sequoia), and 26 (Tahoe)",
  "description": "",
  "categories": ["docs","operate","stack","oss"],
  "tableOfContents": {"sections":[{"id":"1-install-homebrew","title":"1. Install homebrew"},{"id":"2-install-required-packages","title":"2. Install required packages"},{"id":"3-install-rust","title":"3. Install Rust"},{"id":"4-download-and-extract-the-redis-source","title":"4. Download and extract the Redis source"},{"id":"5-build-redis","title":"5. Build Redis"},{"id":"6-optional-verify-the-installation","title":"6. (Optional) Verify the installation"},{"id":"7-start-redis","title":"7. Start Redis"}]}

,
  "codeExamples": []
}
```


Follow the steps below to build and run Redis Open Source with all data structures from its source code on a system running macOS 14 (Sonoma), macOS 15 (Sequoia), or macOS 26 (Tahoe). These instructions apply to both Intel and Apple Silicon (ARM) Macs.

> [!NOTE]
> Three RediSearch-specific build constraints apply on macOS and are handled in the steps below:
>
> - The cross-language LTO that RediSearch enables by default requires Linux; its build script aborts on macOS with `Error: LTO is only supported on Linux`. Step 5 sets `LTO=0` to disable it.
> - RediSearch's Rust workspace uses edition 2024 and features stabilized in Rust 1.94, so the Rust toolchain in step 3 is pinned to `1.94.0`. Older Rust fails with `feature edition2024 is required`.
> - RediSearch's CMake build calls `libtool -static` (BSD libtool syntax). Step 6's `PATH` prepends `$HOMEBREW_PREFIX/opt/libtool/libexec/gnubin`, so Homebrew's GNU `libtool` is used for that step instead of macOS's `/usr/bin/libtool`.

## 1. Install homebrew

If Homebrew isn't already installed, follow the installation instructions on the [Homebrew home page](https://brew.sh).

## 2. Install required packages

```bash
export HOMEBREW_NO_AUTO_UPDATE=1
brew update
brew install coreutils
brew install make
brew install openssl
brew install llvm@18
brew install cmake
brew install gnu-sed
brew install automake
brew install libtool
brew install wget
```

## 3. Install Rust

Rust is required to build the JSON package.

```bash
RUST_INSTALLER=rust-1.94.0-$(if [ "$(uname -m)" = "arm64" ]; then echo "aarch64"; else echo "x86_64"; fi)-apple-darwin
wget --quiet -O ${RUST_INSTALLER}.tar.xz https://static.rust-lang.org/dist/${RUST_INSTALLER}.tar.xz
tar -xf ${RUST_INSTALLER}.tar.xz
(cd ${RUST_INSTALLER} && sudo ./install.sh)
```

## 4. Download and extract the Redis source

The Redis source code is available from [the Redis GitHub site](https://github.com/redis/redis/releases). Select the release you want to build and then select the .tar.gz file from the **Assets** drop down menu. You can verify the integrity of these downloads by checking them against the digests in the [redis-hashes GitHub repository](https://github.com/redis/redis-hashes).

Create a directory for the src, for example `~/src`.

```bash
mkdir ~/src
```

Copy the tar(1) file to `~/src`.

Alternatively, you can download the file directly using the `wget` command, as shown below.

```bash
cd ~/src
wget -O redis-<version>.tar.gz https://github.com/redis/redis/archive/refs/tags/<version>.tar.gz
```

Replace `<version>` with the three-digit Redis release number, for example `8.0.0`.

Extract the source:

```bash
cd ~/src
tar xvf redis-<version>.tar.gz
rm redis-<version>.tar.gz
```

## 5. Build Redis

```bash
cd ~/src/redis-<version>
export HOMEBREW_PREFIX="$(brew --prefix)"
export BUILD_WITH_MODULES=yes
export BUILD_TLS=yes
export LTO=0
PATH="$HOMEBREW_PREFIX/opt/libtool/libexec/gnubin:$HOMEBREW_PREFIX/opt/llvm@18/bin:$HOMEBREW_PREFIX/opt/make/libexec/gnubin:$HOMEBREW_PREFIX/opt/gnu-sed/libexec/gnubin:$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
export LDFLAGS="-L$HOMEBREW_PREFIX/opt/llvm@18/lib"
export CPPFLAGS="-I$HOMEBREW_PREFIX/opt/llvm@18/include"
mkdir -p build_dir/etc
make -C redis-8.0 -j "$(nproc)" all OS=macos
make -C redis-8.0 install PREFIX=$(pwd)/build_dir OS=macos
```

## 6. (Optional) Verify the installation

Check the installed Redis server and CLI versions:

```bash
cd ~/src/redis-<version>
build_dir/bin/redis-server --version
build_dir/bin/redis-cli --version
```

## 7. Start Redis

To start Redis, use the following command:

```bash
cd ~/src/redis-<version>
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
build_dir/bin/redis-server redis.conf
```

> [!NOTE]
> Before Redis 8.10, specify `redis-full.conf` instead of `redis.conf`.

To validate that the available modules have been installed, run the [`INFO`](https://redis.io/docs/latest/commands/info) command and look for lines similar to the following:

```bash
build_dir/bin/redis-cli INFO
...
# Modules
module:name=ReJSON,ver=20803,api=1,filters=0,usedby=[search],using=[],options=[handle-io-errors]
module:name=search,ver=21005,api=1,filters=0,usedby=[],using=[ReJSON],options=[handle-io-errors]
module:name=bf,ver=20802,api=1,filters=0,usedby=[],using=[],options=[]
module:name=timeseries,ver=11202,api=1,filters=0,usedby=[],using=[],options=[handle-io-errors]
module:name=RedisCompat,ver=1,api=1,filters=0,usedby=[],using=[],options=[]
module:name=vectorset,ver=1,api=1,filters=0,usedby=[],using=[],options=[]
...
```

