git clone https://github.com/RedisJSON/RedisJSON.git
git checkout v2.2.0
sudo apt-get install -y clang
curl https://sh.rustup.rs -sSf | sh
cd RedisJSON
cargo build --release
mkdir /etc/redis/modules/
cd RedisJSON/target/release
mv librejson.so /etc/redis/modules/
loadmodule /etc/redis/modules/librejson.so
sudo service redis-server restart
or just install redis stack
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis-stack-server
thanks a lot