title: Overview

text:
Redis implements rolling updates for software upgrades in Kubernetes deployments. The upgrade process includes updating three components:

  1. [Upgrade the Redis Enterprise operator](#upgrade-the-redis-enterprise-operator)
  1. [Upgrade the Redis Enterprise cluster (REC)](#upgrade-the-redis-enterprise-cluster)
  1. [Upgrade Redis Enterprise databases (REDB)](#upgrade-databases)

title: Prerequisites

text:
The following steps ensure you have the minimum versions of all components necessary to upgrade. **Without these minimum versions, the upgrade will freeze and require manual recovery.**

See the [troubleshooting](#troubleshooting) section for details on recovering a failed upgrade.

#### Kubernetes version

Check [Supported Kubernetes distributions]() to make sure your Kubernetes distribution is supported. If not, upgrade your Kubernetes distribution before upgrading the Redis operator.

#### Redis operator version

Your Redis Enterprise clusters must be running version 7.4.2-2 or later before upgrading to 7.8.2-6. See the [7.4 upgrade](https://redis.io/docs/latest/operate/kubernetes/7.4.6/upgrade/upgrade-olm/) for detailed steps.

#### Redis database version

Your Redis databases must be running version 7.2 or later before upgrading your cluster version. See [upgrade databases](#upgrade-databases) for detailed steps. You can find your database version in the [REDB `spec.redisVersion` field]().

title: User-defined modules

text:
If your databases use user-defined modules (custom non-bundled modules):

- Set `autoUpgradeRedisEnterprise: false` in the REC custom resource before upgrading the operator.
- Define the user-defined modules in the REC custom resource before upgrading the database.
- See [Edit `redisEnterpriseImageSpec`](#edit-redisenterpriseimagespec) for more details.

For more information about user-defined modules, see [User-defined modules]().

title: Valid license

text: Use `kubectl get rec` and verify the `LICENSE STATE` is valid on your REC before you start the upgrade process.

title: Upgrade the Redis Enterprise operator

text:
1. Select the **Redis Enterprise Operator** from the **Operators**>**Installed Operators** page.

2. Select the **Subscription** tab.

3. Verify your **Update approval** is set to "Manual".

4. To upgrade to the latest version, set your **Update Channel** to ‘production’. To upgrade to an older version, specify the desired version for your **Update Channel**.

5. Select **Upgrade available** shown under **Upgrade status**.

6. When the "Review manual InstallPlan" section appears, select **Preview installPlan** and then **Approve** after reviewing the details. This will start the operator upgrade.

You can monitor the upgrade from the **Installed Operators** page. A new Redis Enterprise Operator will appear in the list, with the status "Installing". OpenShift will delete the old operator, showing the "Cannot update" status during deletion.

title: Security context constraints

title: Upgrade the Redis Enterprise cluster

title: Edit `redisEnterpriseImageSpec`

title: Reapply roles and role bindings

title: Monitor the upgrade

title: Upgrade databases

text:
After the cluster is upgraded, you can upgrade your databases.

To upgrade your REDB, specify your new database version in the `spec.redisVersion` field in the REDB or REAADB custom resources. Supported database versions for operator versions include "7.2", "7.4", "8.0", and "8.2" (note this value is a string).

For Active-Active databases, the `redis.Version` change only needs to be applied on one participating cluster and will automatically propagate to all other participating clusters. All participating clusters must be running operator version 8.0.2-2 or later.

If your REAADB uses supported modules, keep the existing `moduleList` version numbers unchanged when upgrading `redisVersion`. The database will automatically use the module versions that are bundled with the new Redis version, regardless of what versions are specified in `moduleList`. After the upgrade is complete, you can optionally change the old version numbers from `moduleList`, but this change has no functional impact.

title: General upgrade notes

text:
Note that if your cluster [`redisUpgradePolicy`]() or your database [`redisVersion`]() are set to `major`, you won't be able to upgrade those databases to minor versions. See [Redis upgrade policy]() for more details.

The Redis Enterprise cluster (REC) can be updated automatically or manually. To trigger automatic upgrade of the REC after the operator upgrade completes, specify `autoUpgradeRedisEnterprise: true` in your REC spec. If you don't have automatic upgrade enabled, follow the below steps for the manual upgrade.

title: Troubleshooting

title: Invalid module version

title: Invalid database version


title: Upgrade Redis Enterprise for Kubernetes

summary: This task describes how to upgrade a Redis Enterprise cluster via the operator.

page_type: content

title: Overview

role: overview

text:
Redis implements rolling updates for software upgrades in Kubernetes deployments. The upgrade process includes updating three components:

  1. [Upgrade the Redis Enterprise operator](#upgrade-the-operator)
  1. [Upgrade the Redis Enterprise cluster (REC)](#upgrade-the-redis-enterprise-cluster-rec)
  1. [Upgrade Redis Enterprise databases (REDB)](#upgrade-databases)

title: Prerequisites

role: content

text:
Before upgrading, ensure you have the minimum versions of all components necessary for your target version. **Without these minimum versions, the upgrade may freeze and require manual recovery.**

See the [troubleshooting](#troubleshooting) section for details on recovering a failed upgrade.

title: Kubernetes version

text: Check [Supported Kubernetes distributions]() to make sure your Kubernetes distribution is supported by your target Redis Enterprise operator version. If not, upgrade your Kubernetes distribution before upgrading the Redis operator.

title: Redis operator version

text: Check the [Redis Enterprise for Kubernetes release notes]() for the minimum operator version required for your target upgrade. Some versions may require intermediate upgrades.

title: Redis database version

text: Check the release notes for your target version to determine the minimum Redis database version required. See [upgrade databases](#upgrade-databases) for detailed steps. You can find your database version in the [REDB `spec.redisVersion` field]().

title: User-defined modules

text:
If your databases use user-defined modules (custom non-bundled modules):

- Set `autoUpgradeRedisEnterprise: false` in the REC custom resource before upgrading the operator.
- Define the user-defined modules in the REC custom resource before upgrading the database.
- See [Edit `redisEnterpriseImageSpec`](#edit-redisenterpriseimagespec-in-the-rec-spec) for more details.

For more information about user-defined modules, see [User-defined modules]().

title: Valid license

title: Upgrade with Helm charts

text:
If you installed the Redis Enterprise operator using Helm charts, you can upgrade using Helm commands. This method automatically handles the operator upgrade and Custom Resource Definition (CRD) updates.

To upgrade using Helm:

[code example]

For example:

[code example]

For OpenShift installations, include the `openshift.mode=true` parameter:

[code example]

After the Helm upgrade completes, continue with [upgrading the Redis Enterprise cluster (REC)](#upgrade-the-redis-enterprise-cluster-rec) and [upgrading databases](#upgrade-databases).

For detailed Helm upgrade instructions, see [Upgrade the chart]().

title: Upgrade the operator

text: If your databases use user-defined modules, set `autoUpgradeRedisEnterprise: false` in the REC custom resource before upgrading the operator.

title: Download the bundle

text:
Make sure you pull the correct version of the bundle. You can find the version tags
by checking the [operator releases on GitHub](https://github.com/RedisLabs/redis-enterprise-k8s-docs/releases)
or by [using the GitHub API](https://docs.github.com/en/rest/reference/repos#releases).

You can download the bundle for the latest release with the following `curl` command:

[code example]

If you need a different release, replace `VERSION` in the above with a specific release tag.

title: Apply the bundle

text:
Apply the bundle to deploy the new operator binary. This will also apply any changes in the new release to custom resource definitions, roles, role binding, or operator service accounts.

If you are not pulling images from Docker Hub, update the operator image spec to point to your private repository.
If you have made changes to the role, role binding, RBAC, or custom resource definition (CRD) in the previous version, merge them with the updated declarations in the new version files.

Upgrade the bundle and operator with a single command, passing in the bundle YAML file:

[code example]

After running this command, you should see a result similar to this:

[code example]

title: Reapply the admission controller webhook {#reapply-webhook}

text: If you have the admission controller enabled, you need to manually reapply the `ValidatingWebhookConfiguration`.

title: Verify the operator is running

text:
You can check your deployment to verify the operator is running in your namespace.

[code example]

You should see a result similar to this:

[code example]

We recommend upgrading the REC as soon as possible after updating the operator. After the operator upgrade completes, the operator suspends the management of the REC and its associated REDBs, until the REC upgrade completes.

text:
The Redis Enterprise cluster (REC) can be updated automatically or manually. To trigger automatic upgrade of the REC after the operator upgrade completes, specify `autoUpgradeRedisEnterprise: true` in your REC spec. If you don't have automatic upgrade enabled, follow the below steps for the manual upgrade.

Before beginning the upgrade of the Redis Enterprise cluster, check the [Redis Enterprise for Kubernetes release notes]() to find the Redis Enterprise image tag for your target version.

After the operator upgrade is complete, you can upgrade Redis Enterprise cluster (REC).

For Active-Active databases, we recommend upgrading all participating clusters to the same operator version.

title: Edit `redisEnterpriseImageSpec` in the REC spec

text:
1. Edit the REC custom resource YAML file.

    [code example]

1. Replace the `versionTag:` declaration under `redisEnterpriseImageSpec` with the new version tag.

    [code example]

1. Define any user-defined modules used by databases in the cluster.

    [code example]

  The `name` field must match the `display_name` or `module_name` that appears in the module manifest (for example, "redisgears"). This enables the operator to run validation on the user-defined module. If these names don't match, the operator can't run validation on the user-defined module and preventable errors may occur.

Adding or modifying the `userDefinedModules` list triggers a rolling restart of the Redis Enterprise cluster pods in addition to the rolling upgrade for the version change.

1. Save the changes to apply.

title: Reapply roles and role bindings

text: If your operator is monitoring multiple namespaces, you'll need to [reapply your role and role bindings]() for each managed namespace. See [Manage databases in multiple namespaces]() for more details.

title: Monitor the upgrade

text:
You can view the state of the REC with `kubectl get rec`.

  During the upgrade, the state should be `Upgrade`.
  When the upgrade is complete and the cluster is ready to use, the state will change to `Running`.
  If the state is `InvalidUpgrade`, there is an error (usually relating to configuration) in the upgrade.

[code example]

To see the status of the current rolling upgrade, run:

[code example]

title: Upgrade databases

text: After the cluster is upgraded, you can upgrade your databases.

title: Upgrade REDB

text: To upgrade your REDB, specify your new database version in the `spec.redisVersion` field in the REDB or REAADB custom resources. Supported database versions for operator versions include "7.2", "7.4", "8.0", and "8.2" (note this value is a string).

title: Upgrade REAADB

text:
For Active-Active databases, the `redis.Version` change only needs to be applied on one participating cluster and will automatically propagate to all other participating clusters. All participating clusters must be running operator version 8.0.2-2 or later.

If your REAADB uses supported modules, keep the existing `moduleList` version numbers unchanged when upgrading `redisVersion`. The database will automatically use the module versions that are bundled with the new Redis version, regardless of what versions are specified in `moduleList`. After the upgrade is complete, you can optionally change the old version numbers from `moduleList`, but this change has no functional impact.

title: Upgrade with user-defined modules

text: If a user-defined module is used by any database in the cluster, the module must be defined in the REC custom resource before upgrading the database. See [Add user-defined modules to the REC]() for detailed instructions.

title: Upgrade policy

text: Note that if your cluster [`redisUpgradePolicy`]() or your database [`redisVersion`]() are set to `major`, you won't be able to upgrade those databases to minor versions. See [Redis upgrade policy]() for more details.

title: Troubleshooting

role: errors

text: If you start an upgrade without meeting the [prerequisites](#prerequisites), the operator will freeze the upgrade. Check the operator logs for the source of the error. The REDB reconsilliation doesn't work during an upgrade, so you need to apply a manual fix with the Redis Software API (examples below). The updates will also need to be added to the REDB custom resource.

title: User-defined modules

text:
If your databases use user-defined modules and you encounter upgrade issues:

1. **Verify `autoUpgradeRedisEnterprise` is set to `false`**: Check the REC spec to ensure automatic upgrades are disabled.

    [code example]

1. **Verify modules are defined in the REC**: Ensure all user-defined modules are listed in the REC `userDefinedModules` section before upgrading.

    [code example]

1. **Check module validation errors**: Review the REC status for module validation errors.

    [code example]

For more information about user-defined modules, see [User-defined modules]().

title: Invalid module version

text:
If the operator logs show an event related to an unsupported module, download the updated module locally, and install it using the `v2/modules` API endpoint.

[code example]

After updating the database with the Redis Software API, update the REDB custom resource to reflect the change.

title: Invalid database version

text:
If the operator logs show an event related to an incompatible database version, upgrade the database using the Redis Software API.

[code example]

After updating the modules with the Redis Software API, update the REDB custom resource to reflect the change.

section_id: upgrade-with-helm-charts

code: helm upgrade my-redis-enterprise redis/redis-enterprise-operator --version <chart-version>

code:
helm upgrade <release-name> redis/redis-enterprise-operator --version <chart-version> \
    --set openshift.mode=true

code:
VERSION=`curl --silent https://api.github.com/repos/RedisLabs/redis-enterprise-k8s-docs/releases/latest | grep tag_name | awk -F'"' '{print $4}'`
curl --silent -O https://raw.githubusercontent.com/RedisLabs/redis-enterprise-k8s-docs/$VERSION/bundle.yaml

section_id: download-the-bundle

code: kubectl apply -f bundle.yaml

section_id: apply-the-bundle

section_id: verify-the-operator-is-running

code:
NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
redis-enterprise-operator   1/1     1            1           0m36s

code: kubectl edit rec <your-rec.yaml>

code:
spec:
      redisEnterpriseImageSpec:
        imagePullPolicy:  IfNotPresent
        repository:       redislabs/redis
        versionTag:       <new-version-tag>

code:
spec:
      userDefinedModules:
        - name: "custom-module"
          source:
            https:
              url: "https://modules.company.com/search-v2.1.zip"
              credentialsSecret: "module-repo-creds"

code:
$ kubectl get rec
NAME   NODES   VERSION      STATE     SPEC STATUS   LICENSE STATE   SHARDS LIMIT   LICENSE EXPIRATION DATE   AGE
rec    3       8.0.2-17   Upgrade   Valid         Valid           4              2022-07-16T13:59:00Z      92m

section_id: monitor-the-upgrade

code: kubectl rollout status sts <REC_name>

code: kubectl get rec <cluster-name> -o jsonpath='{.spec.autoUpgradeRedisEnterprise}'

section_id: user-defined-modules

code: kubectl get rec <cluster-name> -o jsonpath='{.spec.userDefinedModules}' | jq

code: kubectl describe rec <cluster-name>

code: curl -sfk -u <rec_username>:<rec_password> -X POST -F 'module=@<full path to your module>' https://localhost:9443/v2/modules

section_id: invalid-module-version

code: curl -sfk -u <rec_username>:<rec_password> -X POST -H "Content-Type: application/json" -d '{"redis_version": <target redis version>}' https://localhost:9443/v1/bdbs/<BDB UID>/upgrade

section_id: invalid-database-version


title: Redis Open Source

summary: Operate Redis Open Source. Redis 8 in Redis Open Source replaces Redis Stack.

summary: How to install Redis Open Source on your target platform

title: Install Redis Open Source

summary: An administrator's guide to Redis

title: Manage Redis

title: Redis Open Source and Redis Software

summary: Redis Open Source reference documentation

title: Reference

title: Overview

text: Since 2009, the Redis open source project has inspired an enthusiastic and active community of users and contributors. We continue to be committed to fostering an open, welcoming, diverse, inclusive, and healthy community.

title: Original developer and core team

text: [Salvatore Sanfilippo](https://github.com/antirez) built, led, and maintained the Redis open source project. In 2020, Salvatore Sanfilippo named two successors to take over and lead the Redis project: Yossi Gottlieb [yossigo](https://github.com/yossigo) and Oran Agra [oranagra](https://github.com/oranagra). Salvatore [returned to Redis in 2024](https://antirez.com/news/144).

title: Code of Conduct

text: Redis has adopted the [Contributor Covenant Code of Conduct](https://github.com/redis/redis/blob/unstable/CODE_OF_CONDUCT.md).

title: Getting help

text: On the [Redis Discord server](https://discord.gg/redis), you can chat with members of the Redis community in real time. You'll meet Redis users, contributors, and developer advocates. This is a great place to stop in for quick questions or to share your latest Redis discoveries.

title: Stack Overflow

text: Have a question about Redis? Search the [Stack Overflow Redis tag](https://stackoverflow.com/questions/tagged/redis) for answers, or post a question of your own.

title: Redis news

text:
For occasional updates on the new Redis releases, you can [check out the What’s New section](https://redis.io/docs/latest/develop/whats-new/).

To keep up with the latest from Redis Inc., including news on Redis Cloud and Redis Stack, consider [following the Redis Twitter feed](https://twitter.com/redisinc).

title: Conferences and meetups

text: Redis regularly sponsors conferences, webinars, and meetups. Check out the [Redis events](https://redis.io/events/) page for details.

title: Contributing to Redis

text:
The Redis core source repository is hosted under [https://github.com/redis/redis](https://github.com/redis/redis) along with many of the client libraries. Commits to the Redis source repository will require code review, approval of at least one reviewer who is not the author of the commit, and no objections.

There are many ways to contribute to Redis, starting with documentation all the way to changes to the open source Redis server. Here are a few ways you can get involved.

title: Contributing to docs

text: The [Redis docs](https://github.com/redis/docs) are open source, and we'd love to incorporate your contributions. For small changes and typos, we recommend working in a fork and creating a [pull request](https://github.com/redis/docs/pulls). Your first PR will prompt you to sign the contributor license agreement. Approved PRs will be published with the next batch of changes to the docs site.

title: Reporting bugs

text:
To report a bug in Redis, create a [Redis Github issue](https://github.com/redis/redis/issues).

For larger changes, we ask that you first create an issue describing your proposed changes. This is a good way to get feedback in advance to increase the likelihood that your changes will be accepted.

title: Client libraries

text: The Redis [client libraries]() are nearly always open source and accepting of contributions. Consult the contribution guidelines for the library you're interested in.


title: Install Redis Community Edition or Redis Stack

summary: How to install your preferred Redis flavor on your target platform

summary: Install Redis on Linux, macOS, and Windows

title: Install Redis

summary: Install Redis Stack on Linux, macOS, and Windows

title: Install Redis Stack

title: Content

text:
You can install [Redis](https://redis.io/about/) or [Redis Stack](https://redis.io/about/about-stack/) locally on your machine. Redis and Redis Stack are available on Linux, macOS, and Windows.

Here are the installation instructions:

* [Install Redis]()
* [Install Redis Stack]()

While you can install Redis or Redis Stack locally, you might also consider using Redis Cloud by creating a [free account](https://redis.com/try-free/?utm_source=redisio&utm_medium=referral&utm_campaign=2023-09-try_free&utm_content=cu-redis_cloud_users).


title: Install Redis

summary: How to install Redis on Linux

title: Install Redis on Linux

summary: Use Homebrew to install and start Redis on macOS

title: Install Redis on macOS

summary: Use Redis on Windows through Memurai, official Redis partner for Windows compatibility

title: Install Redis on Windows

summary: Compile and install Redis from source

title: Install Redis from Source

title: Overview

text:
This is a an installation guide. You'll learn how to install, run, and experiment with the Redis server process.

While you can install Redis on any of the platforms listed below, you might also consider using Redis Cloud by creating a [free account](https://redis.com/try-free?utm_source=redisio&utm_medium=referral&utm_campaign=2023-09-try_free&utm_content=cu-redis_cloud_users). You can also download [Redis Insight](), a free developer tool that works with Redis.

title: Install Redis Open Source

role: setup

text:
How you install Redis depends on your operating system. See the guide below that best fits your needs:

* [Install Redis on Linux]()
* [Install Redis on macOS]()
* [Install Redis on Windows]()

Refer to [Redis Administration]() for detailed setup tips.

title: Test if you can connect using the CLI

text:
After you have Redis up and running, you can connect using `redis-cli`.

External programs talk to Redis using a TCP socket and a Redis specific protocol. This protocol is implemented in the Redis client libraries for the different programming languages. However, to make hacking with Redis simpler, Redis provides a command line utility that can be used to send commands to Redis. This program is called **redis-cli**.

The first thing to do to check if Redis is working properly is sending a **PING** command using redis-cli:

[code example]

Running **redis-cli** followed by a command name and its arguments will send this command to the Redis instance running on localhost at port 6379. You can change the host and port used by `redis-cli` - just try the `--help` option to check the usage information.

Another interesting way to run `redis-cli` is without arguments: the program will start in interactive mode. You can type different commands and see their replies.

[code example]

title: Securing Redis

text:
By default Redis binds to **all the interfaces** and has no authentication at all. If you use Redis in a very controlled environment, separated from the external internet and in general from attackers, that's fine. However, if an unhardened Redis is exposed to the internet, it is a big security concern. If you are not 100% sure your environment is secured properly, please check the following steps in order to make Redis more secure:

1. Make sure the port Redis uses to listen for connections (by default 6379 and additionally 16379 if you run Redis in cluster mode, plus 26379 for Sentinel) is firewalled, so that it is not possible to contact Redis from the outside world.
2. Use a configuration file where the `bind` directive is set in order to guarantee that Redis listens on only the network interfaces you are using. For example, only the loopback interface (127.0.0.1) if you are accessing Redis locally from the same computer.
3. Use the `requirepass` option to add an additional layer of security so that clients will be required to authenticate using the [`AUTH`](/commands/auth) command.
4. Use [spiped](http://www.tarsnap.com/spiped.html) or another SSL tunneling software to encrypt traffic between Redis servers and Redis clients if your environment requires encryption.

Note that a Redis instance exposed to the internet without any security [is very simple to exploit](http://antirez.com/news/96), so make sure you understand the above and apply **at least** a firewall layer. After the firewall is in place, try to connect with `redis-cli` from an external host to confirm that the instance is not reachable.

title: Use Redis from your application

text:
Of course using Redis just from the command line interface is not enough as the goal is to use it from your application. To do so, you need to download and install a Redis client library for your programming language.

You'll find a [full list of supported clients for different languages in this page]().

title: Redis persistence

text:
You can learn [how Redis persistence works on this page](). It is important to understand that, if you start Redis with the default configuration, Redis will spontaneously save the dataset only from time to time. For example, after at least five minutes if you have at least 100 changes in your data. If you want your database to persist and be reloaded after a restart make sure to call the **SAVE** command manually every time you want to force a data set snapshot. Alternatively, you can save the data on disk before quitting by using the **SHUTDOWN** command:

[code example]

This way, Redis will save the data on disk before quitting. Reading the [persistence page]() is strongly suggested to better understand how Redis persistence works.

title: Install Redis properly

text:
Running Redis from the command line is fine just to hack a bit or for development. However, at some point you'll have some actual application to run on a real server. For this kind of usage you have two different choices:

* Run Redis using screen.
* Install Redis in your Linux box in a proper way using an init script, so that after a restart everything will start again properly.

A proper install using an init script is strongly recommended.

The available packages for supported Linux distributions already include the capability of starting the Redis server from `/etc/init`.

The remainder of this section assumes you've [installed Redis from its source code]().

The following instructions can be used to perform a proper installation using the init script shipped with the Redis source code, `/path/to/redis-stable/utils/redis_init_script`.

If you have not yet run `make install` after building the Redis source, you will need to do so before continuing. By default, `make install` will copy the `redis-server` and `redis-cli` binaries to `/usr/local/bin`.

* Create a directory in which to store your Redis config files and your data:

    [code example]

* Copy the init script that you'll find in the Redis distribution under the **utils** directory into `/etc/init.d`. We suggest calling it with the name of the port where you are running this instance of Redis. Make sure the resulting file has `0755` permissions.

    [code example]

* Edit the init script.

    [code example]

Make sure to set the **REDISPORT** variable to the port you are using.
Both the pid file path and the configuration file name depend on the port number.

* Copy the template configuration file you'll find in the root directory of the Redis distribution into `/etc/redis/` using the port number as the name, for instance:

    [code example]

* Create a directory inside `/var/redis` that will work as both data and working directory for this Redis instance:

    [code example]

* Edit the configuration file, making sure to perform the following changes:
    * Set **daemonize** to yes (by default it is set to no).
    * Set the **pidfile** to `/var/run/redis_6379.pid`, modifying the port as necessary.
    * Change the **port** accordingly. In our example it is not needed as the default port is already `6379`.
    * Set your preferred **loglevel**.
    * Set the **logfile** to `/var/log/redis_6379.log`.
    * Set the **dir** to `/var/redis/6379` (very important step!).
* Finally, add the new Redis init script to all the default runlevels using the following command:

    [code example]

You are done! Now you can try running your instance with:

[code example]

Make sure that everything is working as expected:

1. Try pinging your instance within a `redis-cli` session using the [`PING`](/commands/ping) command.
2. Do a test save with `redis-cli save` and check that a dump file is correctly saved to `/var/redis/6379/dump.rdb`.
3. Check that your Redis instance is logging to the `/var/log/redis_6379.log` file.
4. If it's a new machine where you can try it without problems, make sure that after a reboot everything is still working.

The above instructions don't include all of the Redis configuration parameters that you could change. For example, to use AOF persistence instead of RDB persistence, or to set up replication, and so forth. Further details can be found in the [configuration article on this site]().

<hr>

code:
$ redis-cli ping
PONG

section_id: test-if-you-can-connect-using-the-cli

code:
$ redis-cli
redis 127.0.0.1:6379> ping
PONG

code: $ redis-cli shutdown

section_id: redis-persistence

code:
sudo mkdir /etc/redis
    sudo mkdir /var/redis

section_id: install-redis-properly

code: sudo cp utils/redis_init_script /etc/init.d/redis_6379

code: sudo vi /etc/init.d/redis_6379

code: sudo cp redis.conf /etc/redis/6379.conf

code: sudo mkdir /var/redis/6379

code: sudo update-rc.d redis_6379 defaults

code: sudo /etc/init.d/redis_6379 start


title: Install Redis from Source

summary: Compile and install Redis from source

title: Overview

text: You can compile and install Redis from source on variety of platforms and operating systems including Linux and macOS. Redis has no dependencies other than a C  compiler and `libc`.

title: Downloading the source files

text:
The Redis source files are available from the [Download](https://redis.io/downloads) page. You can verify the integrity of these downloads by checking them against the digests in the [redis-hashes git repository](https://github.com/redis/redis-hashes).

To obtain the source files for the latest stable version of Redis from the Redis downloads site, run:

wget https://download.redis.io/redis-stable.tar.gz

title: Compiling Redis

text:
To compile Redis, first extract the tarball, change to the root directory, and then run `make`:

tar -xzvf redis-stable.tar.gz
cd redis-stable
make

To build with TLS support, you'll need to install OpenSSL development libraries (e.g., libssl-dev on Debian/Ubuntu) and then run:

make BUILD_TLS=yes

If the compile succeeds, you'll find several Redis binaries in the `src` directory, including:

* **redis-server**: the Redis Server itself
* **redis-cli** is the command line interface utility to talk with Redis.

To install these binaries in `/usr/local/bin`, run:

sudo make install

title: Starting and stopping Redis in the foreground

text:
Once installed, you can start Redis by running

redis-server

If successful, you'll see the startup logs for Redis, and Redis will be running in the foreground.

To stop Redis, enter `Ctrl-C`.

For a more complete installation, continue with [these instructions]().


title: Install Redis on Linux

summary: How to install Redis on Linux

title: Overview

text: Most major Linux distributions provide packages for Redis.

title: Install on Ubuntu/Debian

text:
Add the repository to the APT index, update it, and install Redis:

sudo apt-get install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
sudo chmod 644 /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

Redis will start automatically, and it should restart at boot time. If Redis doesn't start across reboots, you may need to manually enable it:

sudo systemctl enable redis-server
sudo systemctl start redis-server

title: Install on Red Hat/Rocky

text:
sudo yum install redis
sudo systemctl enable redis
sudo systemctl start redis

Redis will restart at boot time.

title: Install on Ubuntu using Snap

text:
To install via Snap, run:

sudo apt update
sudo apt install redis-tools # for redis-cli
sudo snap install redis

Redis will start automatically, but it won't restart at boot time. To do this, run:

sudo snap set redis service.start=true

You can use these additional snap-related commands to start, stop, restart, and check the status of Redis:

* `sudo snap start redis`
* `sudo snap stop redis`
* `sudo snap restart redis`
* `sudo snap services redis`

If your Linux distribution does not currently have Snap installed, you can install it using the instructions described  [here](https://snapcraft.io/docs/installing-snapd). Then, consult the [Snapcraft store](https://snapcraft.io/redis) for instructions on installing Redis using Snap for your distribution.

title: Starting and stopping Redis in the background

text:
You can start the Redis server as a background process using the `systemctl` command. This only applies to Ubuntu/Debian when installed using `apt`, and Red Hat/Rocky when installed using `yum`.

sudo systemctl start <redis-service-name> # redis or redis-server depending on platform

To stop the server, use:

sudo systemctl stop <redis-service-name> # redis or redis-server depending on platform

title: Connect to Redis

text:
Once Redis is running, you can test it by running `redis-cli`:

redis-cli

Test the connection with the `ping` command:

127.0.0.1:6379> ping
PONG

You can also test that your Redis server is running using
[Redis Insight]().

title: Next steps

text:
Once you have a running Redis instance, you may want to:

* Try the [Redis CLI tutorial]()
* Connect using one of the [Redis clients]()
* [Install Redis "properly"]()
  for production use.


title: Install Redis on macOS

title: Overview

text:
This guide shows you how to install Redis on macOS using Homebrew. Homebrew is the easiest way to install Redis on macOS. If you'd prefer to build Redis from the source files on macOS, see [Installing Redis from Source]().

The Homebrew distribution of Redis Open Source is only supported on macOS.

title: Prerequisites

text:
First, make sure you have Homebrew installed. From the terminal, run:

brew --version

If this command fails, you'll need to [follow the Homebrew installation instructions](https://brew.sh/).

title: Installation

text:
From the terminal, run:

brew install redis

This will install Redis on your system.

text:
To test your Redis installation, you can run the `redis-server` executable from the command line:

redis-server

If successful, you'll see the startup logs for Redis, and Redis will be running in the foreground.

To stop Redis, enter `Ctrl-C`.

title: Starting and stopping Redis using launchd

text:
As an alternative to running Redis in the foreground, you can also use `launchd` to start the process in the background:

brew services start redis

This launches Redis and restarts it at login. You can check the status of a `launchd` managed Redis by running the following:

brew services info redis

If the service is running, you'll see output like the following:

redis (homebrew.mxcl.redis)
Running: ✔
Loaded: ✔
User: miranda
PID: 67975

To stop the service, run:

brew services stop redis

title: Connect to Redis

title: Next steps


title: Install Redis on Windows

title: Run Redis on Windows using Memurai

text: Redis is now natively supported on Windows through [Memurai](https://www.memurai.com/), the official Redis partner for Windows compatibility.

title: Run Redis on Windows using WSL (Windows Subsystem for Linux)

text: To install Redis on Windows using WSL, you'll first need to enable [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install) (Windows Subsystem for Linux). WSL2 lets you run Linux binaries natively on Windows. For this method to work, you'll need to be running Windows 10 version 2004 and higher or Windows 11.

title: Install or enable WSL2

text: Microsoft provides [detailed instructions for installing WSL](https://docs.microsoft.com/en-us/windows/wsl/install). Follow these instructions, and take note of the default Linux distribution it installs. This guide assumes Ubuntu.

title: Install Redis

text:
Once you're running Ubuntu on Windows, you can follow the steps detailed at [Install on Ubuntu/Debian]() to install recent stable versions of Redis from the official `packages.redis.io` APT repository.
Add the repository to the apt index, update it, and then install:

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

Lastly, start the Redis server like so:

redis-server --daemonize yes

title: Connect to Redis

title: Next steps


title: Install Redis Stack from binaries

summary: How to install Redis Stack using tarballs

title: Start Redis Stack Server

text:
Install the openssl libraries for your platform. For example, on a Debian or Ubuntu instance run:

sudo apt install libssl-dev

After untarring or unzipping your redis-stack-server download, you can start Redis Stack Server as follows:

/path/to/redis-stack-server/bin/redis-stack-server

title: Add the binaries to your PATH

text:
You can add the redis-stack-server binaries to your `$PATH` as follows:

Open the file `~/.bashrc` or `~/zshrc` (depending on your shell), and add the following lines.

export PATH=/path/to/redis-stack-server/bin:$PATH

If you have an existing Redis installation on your system, then you can choose override those override those PATH variables as before, or you can choose to only add redis-stack-server binary as follows:

export PATH=/path/to/redis-stack-server/bin/redis-stack-server:$PATH

If you're running redis-stack-server on a mac, please ensure you have openssl installed, via [homebrew](https://brew.sh/).

Now you can start Redis Stack Server as follows:

redis-stack-server


title: Run Redis Stack on Docker

summary: How to install Redis Stack using Docker

title: Overview

text:
To get started with Redis Stack using Docker, you first need to select a Docker image:

* `redis/redis-stack` contains both Redis Stack server and Redis Insight. This container is best for local development because you can use the embedded Redis Insight to visualize your data.

* `redis/redis-stack-server` provides Redis Stack server only. This container is best for production deployment.

title: Getting started

title: redis/redis-stack-server

text:
To start Redis Stack server using the `redis-stack-server` image, run the following command in your terminal:

docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest

title: redis/redis-stack

text:
To start a Redis Stack container using the `redis-stack` image, run the following command in your terminal:

docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest

The `docker run` command above also exposes Redis Insight on port 8001. You can use Redis Insight by pointing your browser to `localhost:8001`.

title: Connect with redis-cli

text:
You can then connect to the server using `redis-cli`, just as you connect to any Redis instance.

If you don’t have `redis-cli` installed locally, you can run it from the Docker container:

$ docker exec -it redis-stack redis-cli

title: Configuration

role: configuration

title: Persistence in Docker

text:
To mount directories or files to your Docker container, specify `-v` to configure a local volume. This command stores all data in the local directory `local-data`:

$ docker run -v /local-data/:/data redis/redis-stack:latest

title: Ports

text:
If you want to expose Redis Stack server or Redis Insight on a different port, update the left hand of portion of the `-p` argument. This command exposes Redis Stack server on port `10001` and Redis Insight on port `13333`:

$ docker run -p 10001:6379 -p 13333:8001 redis/redis-stack:latest

title: Config files

text:
By default, the Redis Stack Docker containers use internal configuration files for Redis. To start Redis with local configuration file, you can use the `-v` volume options:

$ docker run -v `pwd`/local-redis-stack.conf:/redis-stack.conf -p 6379:6379 -p 8001:8001 redis/redis-stack:latest

title: Environment variables

text:
To pass in arbitrary configuration changes, you can set any of these environment variables:

* `REDIS_ARGS`: extra arguments for Redis

* `REDISEARCH_ARGS`: arguments for the search and query features (RediSearch)

* `REDISJSON_ARGS`: arguments for JSON (RedisJSON)

* `REDISTIMESERIES_ARGS`: arguments for time series (RedisTimeSeries)

* `REDISBLOOM_ARGS`: arguments for  the probabilistic data structures (RedisBloom)

For example, here's how to use the `REDIS_ARGS` environment variable to pass the `requirepass` directive to Redis:

docker run -e REDIS_ARGS="--requirepass redis-stack" redis/redis-stack:latest

An example of setting [Redis persistence]():

docker run -e REDIS_ARGS="--save 60 1000 --appendonly yes" redis/redis-stack:latest

Here's how to set a retention policy for time series:

docker run -e REDISTIMESERIES_ARGS="RETENTION_POLICY=20" redis/redis-stack:latest


title: Install Redis Stack

summary: How to install Redis Stack on Linux

title: Install Redis Stack on Linux

summary: How to install Redis Stack on macOS

title: Install Redis Stack on macOS

summary: How to install Redis Stack on Windows

title: Install Redis Stack on Windows

summary: How to install Redis Stack using Docker

title: Run Redis Stack on Docker

title: Install Redis Stack from binaries

title: Content

text:
While you can install Redis Stack on any of the platforms listed below, you might also consider using Redis Cloud by creating a [free account](https://redis.com/try-free/?utm_source=redisio&utm_medium=referral&utm_campaign=2023-09-try_free&utm_content=cu-redis_cloud_users).

<hr/>


title: Install Redis Stack on Linux

summary: How to install Redis Stack on Linux

title: Overview

text: Learn how to install Redis Stack on Linux from the official APT repository or RPM feed, or with Snap or AppImage.

title: From the official Ubuntu/Debian APT Repository

text:
See [this page](https://redis.io/downloads/#redis-stack-downloads) for a complete list of supported Ubuntu/Debian platforms.
Add the repository to the APT index, update it, and install Redis Stack:

sudo apt-get install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
sudo chmod 644 /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

Redis will not start automatically, nor will it start at boot time. To do this, run the following commands.

sudo systemctl enable redis-stack-server
sudo systemctl start redis-stack-server

title: From the official Red Hat/Rocky RPM Feeds

text:
See [this page](https://redis.io/downloads/#redis-stack-downloads) for a complete list of supported Red Hat/Rocky platforms.
Follow these steps to install Redis Stack.

1. Create the file `/etc/yum.repos.d/redis.repo` with the following contents.

    [Redis]
    name=Redis
    baseurl=http://packages.redis.io/rpm/rhel9 # replace rhel9 with the appropriate value for your platform
    enabled=1
    gpgcheck=1

1. Run the following commands:

    curl -fsSL https://packages.redis.io/gpg > /tmp/redis.key
    sudo rpm --import /tmp/redis.key
    sudo yum install epel-release
    sudo yum install redis-stack-server

Redis will not start automatically, nor will it start at boot time. To do this, run the following commands.

sudo systemctl enable redis-stack-server
sudo systemctl start redis-stack-server

title: On Ubuntu with Snap

text:
First, download the latest Redis Stack snap package from [this page](https://redis.io/downloads/).

To install, run:

sudo apt update
sudo apt install redis-tools
sudo snap install --dangerous --classic <snapname.snap>

Redis will not start automatically, nor will it start at boot time. To start `redis-stack-server` in the foreground, run the command:

sudo snap run redis-stack-server

To stop Redis, enter `Ctrl-C`.

Follow these steps to integrate Redis Stack with `systemd` so you can start/stop in/from the background:

1. Edit the `/etc/systemd/system/redis-stack-server.service` file and enter the following information:

    [Unit]
    Description=Redis Stack Server
    After=network.target

    [Service]
    ExecStart=/usr/bin/snap run redis-stack-server
    Restart=always
    User=root
    Group=root

    [Install]
    WantedBy=multi-user.target

1. Run the following commands.

    sudo systemctl daemon-reload
    sudo systemctl start redis-stack-server
    sudo systemctl enable redis-stack-server

If your Linux distribution does not currently have Snap installed, you can install it using the instructions described  [here](https://snapcraft.io/docs/installing-snapd). Then, download the appropriate from the [downloads page](https://redis.io/downloads/).

title: On Ubuntu with AppImage

text:
Fuse needs to be installed before proceeding. Install it as follows.

sudo apt update
sudo apt install fuse

Next, download the latest Redis Stack AppImage package from [this page](https://redis.io/downloads/).

To run the image, execute these commands:

sudo apt update
sudo apt install redis-tools
chmod a+x <AppImageFile> # replace AppImageFile with the name of your downloaded file
./<AppImageFile>

This will start Redis in the foreground. To stop Redis, enter `Ctrl-C`.

Follow these steps to integrate Redis Stack with `systemd` so you can start/stop in/from the background:

1. Edit the `/etc/systemd/system/redis-appimage.service` file and enter the following information:

    [Unit]
    Description=Redis Server (AppImage)
    After=network.target

    [Service]
    ExecStart=/path/to/your/<AppImageFile> --daemonize no
    Restart=always
    User=redis-user   # replace with an existing user or create a new one
    Group=redis-group # replace with an existing group or create a new one

    [Install]
    WantedBy=multi-user.target

1. Run the following commands.

    sudo systemctl daemon-reload
    sudo systemctl start redis-appimage
    sudo systemctl enable redis-appimage

title: Starting and stopping Redis Stack in the background

text:
You can start the Redis server as a background process using the `systemctl` command. This only applies to Ubuntu/Debian when installed using `apt`, and Red Hat/Rocky when installed using `yum`.

sudo systemctl start redis-stack-server

To stop the service, use:

sudo systemctl stop redis-stack-server

title: Connect to Redis

text:
Once Redis is running, you can test it by running `redis-cli`:

redis-cli

Test the connection with the `ping` command:

127.0.0.1:6379> ping
PONG

You can also test that your Redis server is running using
[Redis Insight]().

title: Next steps

text:
Once you have a running Redis instance, you may want to:

* Try the [Redis CLI tutorial]()
* Connect using one of the [Redis clients]()
* [Install Redis properly]()
  for production use.


title: Install Redis Stack on macOS

summary: How to install Redis Stack on macOS

title: Overview

text:
To install Redis Stack on macOS, use [Homebrew](https://brew.sh/). Make sure that you have [Homebrew installed](https://docs.brew.sh/Installation) before starting on the installation instructions below.

There are three brew casks available.

* `redis-stack` contains both `redis-stack-server` and `redis-stack-redisinsight` casks.
* `redis-stack-server` provides Redis Stack server only.
* `redis-stack-redisinsight` contains Redis Insight.

title: Install using Homebrew

text:
First, tap the Redis Stack Homebrew tap:

brew tap redis-stack/redis-stack

Next, run `brew install`:

brew install redis-stack

The `redis-stack-server` cask will install all Redis and Redis Stack binaries. How you run these binaries depends on whether you already have Redis installed on your system.

title: First-time Redis installation

text:
If this is the first time you've installed Redis on your system, you need to be sure that your `PATH` variable includes the Redis Stack installation location. This location is either `/opt/homebrew/bin` for Apple silicon Macs or `/usr/local/bin` for Intel-based Macs.

To check this, run:

echo $PATH

Then, confirm that the output contains `/opt/homebrew/bin` (Apple silicon Macs) or `/usr/local/bin` (Intel Mac). If these directories are not in the output, see the "Existing Redis installation" instructions below.

Because Redis Stack is installed using a brew cask via the `brew tap` command, it will not be integrated with the `brew services` command.

title: Existing Redis installation

text:
If you have an existing Redis installation on your system, then might want to modify your `$PATH` to ensure that you're using the latest Redis Stack binaries.

Open the file `~/.bashrc` or `~/zshrc` (depending on your shell), and add the following lines.

For Intel-based Macs:

export PATH=/usr/local/Caskroom/redis-stack-server/<VERSION>/bin:$PATH

For Apple silicon Macs:

export PATH=/opt/homebrew/Caskroom/redis-stack-server/<VERSION>/bin:$PATH

In both cases, replace `<VERSION>` with your version of Redis Stack. For example, with version 6.2.0, path is as follows:

export PATH=/opt/homebrew/Caskroom/redis-stack-server/6.2.0/bin:$PATH

title: Start Redis Stack Server

text:
You can now start Redis Stack Server as follows:

redis-stack-server

title: Installing Redis after installing Redis Stack

text:
If you've already installed Redis Stack with Homebrew and then try to install Redis with `brew install redis`, you may encounter errors like the following:

Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/redis-benchmark
Target /usr/local/bin/redis-benchmark
already exists. You may want to remove it:
rm '/usr/local/bin/redis-benchmark'

To force the link and overwrite all conflicting files:
brew link --overwrite redis

To list all files that would be deleted:
brew link --overwrite --dry-run redis

In this case, you can overwrite the Redis binaries installed by Redis Stack by running:

brew link --overwrite redis

However, Redis Stack Server will still be installed. To uninstall Redis Stack Server, see below.

title: Uninstall Redis Stack

text:
To uninstall Redis Stack, run:

brew uninstall redis-stack-redisinsight redis-stack-server redis-stack
brew untap redis-stack/redis-stack

title: Connect to Redis

title: Next steps

text:
Once you have a running Redis instance, you may want to:

* Try the [Redis CLI tutorial]()
* Connect using one of the [Redis clients]()
* [Install Redis "properly"]()
  for production use.


title: Install Redis Stack on Windows

summary: How to install Redis Stack on Windows

title: Run Redis on Windows using Memurai

text: Redis is now natively supported on Windows through [Memurai](https://www.memurai.com/), the official Redis partner for Windows compatibility.

title: Run Redis on Windows using Docker

text:
To install Redis Stack on Windows, you will need to have Docker installed. When Docker is up and running, open Windows PowerShell and follow the instructions described in [Run Redis Stack on Docker](). Then, use Docker to connect with `redis-cli` as explained in that topic.

If you attempt to use Windows Subsystem for Linux (WSL) or Ubuntu for Windows to follow [Linux instructions](), you will get a `systemd` error telling you `System has not been booted with systemd as init system (PID 1). Can't operate.` Do not fret. Just use Docker.

_`systemd` is a suite of basic building blocks for a Linux system._ For more information about its function, see [System and Service Manager](https://systemd.io/). This becomes an issue due to the lack of support for Linux workflows on WSL. But, you can test the instructions listed in [Systemd support is now available in WSL!](https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/). Let us know how that worked for you.


title: Build and run Redis Open Source on AlmaLinux/Rocky Linux 8.10

title: Overview

text:
Follow the steps below to build and run Redis Open Source from its source code on a system running AlmaLinux and Rocky Linux 8.10.

Docker images used to produce these build notes:
- AlmaLinux:
    - almalinux:8.10
    - almalinux:8.10-minimal
- Rocky Linux:
    - rockylinux/rockylinux:8.10
    - rockylinux/rockylinux:8.10-minimal

title: 1. Prepare the system

text:
For 8.10-minimal, you'll need to install `sudo` and `dnf` as follows:

[code example]

For 8.10 (regular), you'll need to install `sudo` as follows:

[code example]

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

[code example]

title: 2. Install required packages

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

[code example]

Create a Python virtual environment:

[code example]

Enable the GCC toolset:

[code example]

title: 3. Install CMake

text:
Install CMake 3.25.1 manually:

[code example]

title: 4. Download and extract the Redis source

text:
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).

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

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

[code example]

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

Extract the source:

[code example]

title: 5. Build Redis

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

[code example]

title: 6. (Optional) Verify the installation

text:
Check the installed Redis server and CLI versions:

[code example]

title: 7. Start Redis

text:
To start Redis, use the following command:

[code example]

To validate that the available modules have been installed, run the [`INFO`] command and look for lines similar to the following:

[code example]

title: 8. (Optional) Install Redis to its default location

text: [code example]

code: microdnf install dnf sudo -y

code: dnf install sudo -y

code:
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

code:
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

code: python3.11 -m venv /opt/venv

code:
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

code:
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

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

code:
cd /usr/src
tar xvf redis-<version>.tar.gz
rm redis-<version>.tar.gz

code:
source /etc/profile.d/gcc-toolset-13.sh
cd /usr/src/redis-<version>

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

make -j "$(nproc)" all

code:
./src/redis-server --version
./src/redis-cli --version

code: ./src/redis-server redis-full.conf

code:
cd /usr/src/redis-<version>
sudo make install


title: Build and run Redis Open Source on AlmaLinux/Rocky Linux 9.5

title: Overview

text:
Follow the steps below to build and run Redis Open Source from its source code on a system running AlmaLinux and Rocky Linux 9.5.

Docker images used to produce these build notes:
- AlmaLinux:
    - almalinux:9.5
    - almalinux:9.5-minimal
- Rocky Linux:
    - rockylinux/rockylinux:9.5
    - rockylinux/rockylinux:9.5-minimal

title: 1. Prepare the system

text:
For 9.5-minimal, you'll need to install `sudo` and `dnf` as follows:

[code example]

For 9.5 (regular), you'll need to install `sudo` as follows:

[code example]

Enable the GoReleaser repository and install required packages:

[code example]

title: 2. Install required packages

text:
Install build dependencies, GCC toolset, Python, and utilities:

[code example]

Create a Python virtual environment:

[code example]

Enable the GCC toolset:

[code example]

title: 3. Install CMake

text:
Install CMake version 3.25.1 manually:

[code example]

title: 5. Build Redis

text:
Enable the GCC toolset and compile Redis with TLS and module support:

[code example]

title: 6. (Optional) Verify the installation

text:
Check that Redis was installed successfully:

[code example]

title: 7. Start Redis

text: [code example]

code:
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 clean all
sudo dnf makecache
sudo dnf update -y

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

code: python3 -m venv /opt/venv


title: Build and run Redis Open Source on Debian 12 (Bookworm)

title: Overview

text:
Follow the steps below to build and run Redis Open Source from its source code on a system running Debian 12 (Bookworm).

Docker images used to produce these build notes:
- debian:bookworm
- debian:bookworm-slim

title: 1. Install required dependencies

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

[code example]

title: 2. Download and extract the Redis source

title: 3. Build Redis

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

[code example]

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

title: 4. (Optional) Verify the installation

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

[code example]

title: 5. Start Redis

title: 6. (Optional) Install Redis to its default location

text: [code example]

code:
apt-get update
apt-get install -y sudo
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

code:
cd /usr/src/redis-<version>
export BUILD_TLS=yes
export BUILD_WITH_MODULES=yes
export INSTALL_RUST_TOOLCHAIN=yes
export DISABLE_WERRORS=yes

make -j "$(nproc)" all

code:
cd /usr/src/redis-version
sudo make install


title: Build and run Redis Open Source on Debian 11 (Bullseye)

title: Overview

text:
Follow the steps below to build and run Redis Open Source from its source code on a system running Debian 11 (Bullseye).

Docker images used to produce these build notes:
- debian:bullseye
- debian:bullseye-slim

title: 1. Install required dependencies

title: 3. Build Redis

title: 4. (Optional) Verify the installation

title: 5. Start Redis

text: [code example]


title: Build and run Redis Open Source

summary: Build and run Redis 8 in Redis Open Source on Linux and macOS

title: Build and run Redis Open Source on Ubuntu 20.04 (Focal)

title: Build and run Redis Open Source on Ubuntu 22.04 (Jammy)

title: Build and run Redis Open Source on Ubuntu 24.04 (Noble)

title: Build and run Redis Open Source on macOS 13 (Ventura) and macOS 14 (Sonoma)

title: Content

text: Build instructions are provided for the following platforms:


title: Overview

text: Follow the steps below to build and run Redis Open Source from its source code on a system running macOS 13 (Ventura) and macOS 14 (Sonoma).

title: 1. Install homebrew

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

title: 2. Install required packages

text: [code example]

title: 3. Install Rust

text:
Rust is required to build the JSON package.

[code example]

text:
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`.

[code example]

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

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

[code example]

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

Extract the source:

[code example]

title: 5. Build Redis

text: [code example]

title: 6. (Optional) Verify the installation

title: 7. Start Redis

code:
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

code:
RUST_INSTALLER=rust-1.80.1-$(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)

code: mkdir ~/src

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

code:
tar xvf redis-<version>.tar.gz
rm redis-<version>.tar.gz

code:
cd ~/src/redis-<version>
export HOMEBREW_PREFIX="$(brew --prefix)"
export BUILD_WITH_MODULES=yes
export BUILD_TLS=yes
export DISABLE_WERRORS=yes
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

code:
build_dir/bin/redis-server --version
build_dir/bin/redis-cli --version

code:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
build_dir/bin/redis-server redis-full.conf


title: Overview

text:
Follow the steps below to build and run Redis Open Source from its source code on a system running Ubuntu 20.04 (Focal).

Docker images used to produce these build notes:
- ubuntu:20.04

title: 1. Install required dependencies

text:
Update your package lists and install the necessary development tools and libraries:

[code example]

title: 2. Use GCC 10 as the default compiler

text:
Update the system's default compiler to GCC 10:

[code example]

title: 3. Install CMake

text:
Install CMake using `pip3` and link it for system-wide access.

CMake version 3.31.6 is the latest supported version. Newer versions cannot be used.

[code example]

text:
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).

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

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

[code example]

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

Extract the source:

[code example]

title: 5. Build Redis

text:
Set the necessary environment variables and compile Redis:

[code example]

title: 6. (Optional) Verify the installation

text:
Confirm the Redis installation:

[code example]

title: 7. Start Redis

text:
To start Redis, use the following command:

[code example]

To validate that the available modules have been installed, run the [`INFO`] command and look for lines similar to the following:

[code example]

text: [code example]

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

code: sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10

code:
pip3 install cmake==3.31.6
sudo ln -sf /usr/local/bin/cmake /usr/bin/cmake
cmake --version

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

code:
cd /usr/src
tar xvf redis-<version>.tar.gz
rm redis-<version>.tar.gz

code:
./src/redis-server --version
./src/redis-cli --version


title: Overview

text:
Follow the steps below to build and run Redis Open Source from its source code on a system running Ubuntu 22.04 (Jammy).

Docker images used to produce these build notes:
- ubuntu:22.04

title: 1. Install required dependencies

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

[code example]

title: 2. Install CMake

title: 3. Download and extract the Redis source

title: 4. Build Redis

title: 5. (Optional) Verify the installation

title: 6. Start Redis

title: 7. (Optional) Install Redis to its default location

text: [code example]

code:
apt-get update
apt-get install -y sudo
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

code: ./src/redis-server redis-full.conf

code:
cd /usr/src/redis-<version>
sudo make install


title: Overview

text:
Follow the steps below to build and run Redis Open Source from its source code on a system running Ubuntu 24.04 (Noble).

Docker images used to produce these build notes:
- ubuntu:24.04

title: 1. Install required dependencies

title: 3. Build Redis

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

[code example]

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

title: 4. (Optional) Verify the installation

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

[code example]

title: 5. Start Redis

text: [code example]

code:
cd /usr/src/redis-<version>
export BUILD_TLS=yes
export BUILD_WITH_MODULES=yes
export INSTALL_RUST_TOOLCHAIN=yes
export DISABLE_WERRORS=yes

make -j "$(nproc)" all


title: Install Redis Open Source

summary: Install Redis Open Source on Docker, Linux, macOS, and Windows (using Docker only)

title: Install Redis Open Source

summary: Upgrade Redis Open Source

title: Upgrade Redis Open Source

title: Build and run Redis Open Source

summary: Describes Redis Open Source supported database versions.

title: Redis Open Source version management

title: Install Redis Community Edition or Redis Stack

title: Content

text:
You can install [Redis Open Source]() locally on your machine. Redis Open Source is available on Docker, Linux, macOS, and Windows (using Docker only).

You can also download [Redis Insight](), a free developer companion tool with an intuitive GUI and advanced CLI, which you can use alongside Redis Open Source.

Here are the installation and upgrade instructions:

* [Install Redis Open Source]()
* [Upgrade Redis Open Source]()

While you can install Redis Open Source locally, you might also consider using Redis Cloud by creating a [free account](https://redis.com/try-free/?utm_source=redisio&utm_medium=referral&utm_campaign=2023-09-try_free&utm_content=cu-redis_cloud_users).


title: Install Redis Open Source on Linux

summary: How to install Redis Open Source using APT

title: Install Redis Open Source on Ubuntu or Debian Linux using APT

text:
Add the repository to the APT index, update it, and install Redis Open Source:

sudo apt-get install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
sudo chmod 644 /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

The most recent version of Redis Open Source will be installed, along with the redis-tools package (redis-cli, etc.).
If you need to install an earlier version, run the following command to list the available versions:

apt policy redis

redis:
  Installed: (none)
  Candidate: 6:8.6.1-1rl1~noble1
  Version table:
     6:8.6.1-1rl1~noble1 500
        500 https://packages.redis.io/deb noble/main amd64 Packages
        500 https://packages.redis.io/deb noble/main all Packages
     6:8.6.0-1rl1~noble1 500
        500 https://packages.redis.io/deb noble/main amd64 Packages
        500 https://packages.redis.io/deb noble/main all Packages
     ...
     6:8.0.0-1rl1~noble1 500
        500 https://packages.redis.io/deb noble/main amd64 Packages
        500 https://packages.redis.io/deb noble/main all Packages
     6:7.4.8-1rl1~noble1 500
        500 https://packages.redis.io/deb noble/main amd64 Packages
        500 https://packages.redis.io/deb noble/main all Packages

For example, to install Redis Open Source v7.4.8 on Ubuntu LTS 24.04 (Noble Numbat), run the following command:

sudo apt-get install \
redis=6:7.4.8-1rl1~noble1 \
redis-server=6:7.4.8-1rl1~noble1 \
redis-sentinel=6:7.4.8-1rl1~noble1 \
redis-tools=6:7.4.8-1rl1~noble1

Alternatively, you can also set up a preferences file to pin a particular release:

Package: redis redis-server redis-sentinel redis-tools
Pin: version 6:7.4.*
Pin-Priority: 1001

See [this document](https://manpages.debian.org/buster/apt/apt_preferences.5.en.html#How_APT_Interprets_Priorities) for more information on `Pin-Priority`.

With the example preferences file give above, `6:7.4.8-1rl1~noble1` is the latest version that matches the pinned version and it will be installed when you run this command:

sudo apt-get install redis-server redis-sentinel redis-tools

Redis should start automatically after the initial installation and also at boot time.
Should that not be the case on your system, run the following commands:

sudo systemctl enable redis-server
sudo systemctl start redis-server


title: Run Redis Open Source on Docker

summary: How to run Redis Open Source using Docker

title: Install Docker

text:
Follow the Docker installation instructions for your operating system:

- [Linux](https://docs.docker.com/desktop/setup/install/linux/)
- [macOS](https://docs.docker.com/docker-for-mac/install/)
- [Windows](https://store.docker.com/editions/community/docker-ce-desktop-windows)

On Windows, make sure Docker is configured to run Linux-based containers.

title: Run Redis Open Source on Docker

text:
To start the Redis Open Source server using the `redis:<version>` image, run the following command in your terminal:

docker run -d --name redis -p 6379:6379 redis:<version>

title: Connect with redis-cli

text:
You can then connect to the server using `redis-cli`, just as you connect to any Redis instance.

If you don’t have `redis-cli` installed locally, you can run it from the Docker container:

$ docker exec -it redis redis-cli

If you do have `redis-cli` installed locally, you can run it from your terminal:

$ redis-cli -h 127.0.0.1 -p 6379

title: Use a local configuration file

text:
By default, the Redis Docker containers use internal configuration files for Redis. To start Redis with local configuration file, you can do one of the following:

You can create your own Dockerfile that adds a `redis.conf` from the context into `/data/`, like so.

[code example]
Alternatively, you can specify something along the same lines with docker run options.

$ docker run -v /myredis/conf:/usr/local/etc/redis --name myredis redis redis-server /usr/local/etc/redis/redis.conf

where `/myredis/conf/` is a local directory containing your `redis.conf` file. Using this method means that there is no need for you to have a Dockerfile for your redis container.

The mapped directory should be writable, as depending on the configuration and mode of operation, Redis may need to create additional configuration files or rewrite existing ones.

title: Use local storage for data persistence

text:
To mount directories or files to your Docker container, specify -v to configure a local volume. This command stores all data in the local directory local-data:

$ docker run -v /local-data/:/data --name redis -p 6379:6379 redis:<version>

See the [official Redis page on Docker Hub](https://hub.docker.com/_/redis) for more options.

code:
FROM redis
COPY redis.conf /usr/local/etc/redis/redis.conf
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]

section_id: use-a-local-configuration-file


title: Install Redis Open Source on macOS

summary: How to install Redis Open Source on macOS using Homebrew

title: Install Redis Open Source on macOS using Homebrew

text:
Installation using Homebrew is only supported on macOS.

To install Redis Open Source on macOS, use [Homebrew](https://brew.sh/).
Make sure that you have [Homebrew installed](https://docs.brew.sh/Installation) before starting on the installation instructions below.

title: Remove any existing Redis installation files

text:
If you had previously installed Redis on your system using the default Homebrew formula called "redis", you need to remove it before installing Redis Open Source 8.x.

Follow these steps to remove any existing Redis installation files:

1. Uninstall Redis:
    [code example]
1. Next check if the `redis.conf` file is still installed:
    [code example]

    If you get output similar to the following, then it’s still there:

    [code example]

    Run this command to remove the file:

    [code example]

Next, follow the instructions in the [next section](#install-using-homebrew) to install Redis Open Source 8.x using the Redis Homebrew cask.

title: Install using Homebrew {#install-using-homebrew}

text:
First, tap the Redis Homebrew cask:

brew tap redis/redis

Next, run `brew install`:

brew install --cask redis

title: Run Redis

text:
If this is the first time you've installed Redis on your system, you need to be sure that your `PATH` variable includes the Redis installation location. This location is either `/opt/homebrew/bin` for Apple silicon Macs or `/usr/local/bin` for Intel-based Macs.

To check this, run:

echo $PATH

Next, confirm that the output contains `/opt/homebrew/bin` (Apple silicon Macs) or `/usr/local/bin` (Intel Mac). If neither `/opt/homebrew/bin` nor `/usr/local/bin` are in the output, add them.

Open the file `~/.bashrc` or `~/.zshrc` (depending on your shell), and add the following line.

export PATH=$(brew --prefix)/bin:$PATH

You can now start the Redis server as follows:

redis-server $(brew --prefix)/etc/redis.conf

The server will run in the background.

Because Redis is installed using a Homebrew cask with the `brew tap` command, it will not be integrated with the `brew services` command.

title: Connect to Redis

text:
Once Redis is running, you can test it by running `redis-cli`:

redis-cli

Test the connection with the `ping` command:

127.0.0.1:6379> PING
PONG

title: Verify that all modules are loaded correctly

text:
If you had previously installed earlier versions of Redis using Homebrew, for example 7.2.x or 7.4.x, you should test to see if all the modules are loaded correctly by running the following command. Your output should look similar to the following:

$ redis-cli MODULE LIST
1) 1) "name"
   2) "bf"
   3) "ver"
   4) (integer) 80200
   5) "path"
   6) "/usr/local/lib/redis/modules//redisbloom.so"
   7) "args"
   8) (empty array)
2) 1) "name"
   2) "timeseries"
   3) "ver"
   4) (integer) 80200
   5) "path"
   6) "/usr/local/lib/redis/modules//redistimeseries.so"
   7) "args"
   8) (empty array)
3) 1) "name"
   2) "search"
   3) "ver"
   4) (integer) 80201
   5) "path"
   6) "/usr/local/lib/redis/modules//redisearch.so"
   7) "args"
   8) (empty array)
4) 1) "name"
   2) "vectorset"
   3) "ver"
   4) (integer) 1
   5) "path"
   6) ""
   7) "args"
   8) (empty array)
5) 1) "name"
   2) "ReJSON"
   3) "ver"
   4) (integer) 80200
   5) "path"
   6) "/usr/local/lib/redis/modules//rejson.so"
   7) "args"
   8) (empty array)

title: Stop Redis

text:
Run the following command:

redis-cli SHUTDOWN

title: Uninstall Redis Open Source

text:
To uninstall Redis, run:

brew uninstall redis
brew untap redis/redis

title: Next steps

text:
Once you have a running Redis instance, you may want to:

* Try the [Redis CLI tutorial]()
* Connect using one of the [Redis clients]()
* Connect using [Redis Insight]()

code: brew uninstall redis

code: ls -l $(brew --prefix)/etc/redis.conf

code: -rw-r--r--@ 1 user  admin  122821  2 Oct 16:07 /opt/homebrew/etc/redis.conf

code: rm -iv $(brew --prefix)/etc/redis.conf


title: Install Redis Open Source

title: Run Redis Open Source on Docker

title: Install Redis Open Source on Linux

summary: How to install Redis Open Source using RPM

title: Install Redis Open Source on Linux

summary: How to install Redis Open Source using Snap

title: Install Redis Open Source on Linux

title: Install Redis Open Source on macOS

summary: How to run Redis Open Source on Windows

title: Run Redis Open Source on Windows using Docker

title: Content

text:
The latest version of Redis Open Source has been tested on the following platforms:

- Ubuntu 22.04 (Jammy Jellyfish) and 24.04 (Noble Numbat).
- Rocky Linux 8.10, 9.5.
- AlmaLinux 8.10, 9.5, and 10.1.
- Debian 12 (Bookworm) and 13 (Trixie).
- macOS 14 (Sonoma), and 15 (Sequoia).

Follow the links below for installation instructions for your OS and distribution.

While you can install Redis Open Source on any of the platforms listed below, you might also consider using Redis Cloud by creating a [free account](https://redis.com/try-free/?utm_source=redisio&utm_medium=referral&utm_campaign=2023-09-try_free&utm_content=cu-redis_cloud_users).

You can also download [Redis Insight](), a free developer companion tool with an intuitive GUI and advanced CLI, which you can use alongside Redis Open Source.

<hr/>


title: Install Redis Open Source on Linux

title: Install Redis Open Source on Rocky Linux 8 and 9, or AlmaLinux 8 and 9 using RPM

text:
Follow these steps to install Redis Open Source.

1. Create the file `/etc/yum.repos.d/redis.repo` with the following contents.

    - For Rocky Linux 9 and AlmaLinux 9

    [Redis]
    name=Redis
    baseurl=http://packages.redis.io/rpm/rockylinux9
    enabled=1
    gpgcheck=1

    - For Rocky Linux 8 and AlmaLinux 8

    [Redis]
    name=Redis
    baseurl=http://packages.redis.io/rpm/rockylinux8
    enabled=1
    gpgcheck=1

2. Run the following commands:

    curl -fsSL https://packages.redis.io/gpg > /tmp/redis.key
    sudo rpm --import /tmp/redis.key
    sudo yum install redis

Redis will not start automatically, nor will it start at boot time. To do this, run the following commands.

sudo systemctl enable redis
sudo systemctl start redis


title: Install Redis Open Source on Linux

title: Install Redis Open Source on Ubuntu Linux using Snap

text:
To install Redis via snap, run the following commands:

sudo apt update
sudo apt install redis-tools # this will install `redis-cli`
sudo snap install redis

Redis will start automatically after installation and also at boot time.

title: Connect to Redis


summary: How to run Redis Open Source on Windows

text: To install Redis Open Source on Windows, you will need to have Docker installed. When Docker is up and running, open Windows PowerShell and follow the instructions described in [Run Redis Open Source on Docker](). Then, use Docker to connect with `redis-cli` as explained in that topic.


title: Upgrade a Redis cluster to Redis 8

summary: Upgrade a Redis Open Source cluster to Redis 8

title: Overview

text:
The supported upgrade paths are:
- Redis Open Source 7.x (with or without modules) to Redis 8 in Redis Open Source
- Redis Stack 7.2 or 7.4 to Redis 8 in Redis Open Source

</br>

It's essential to practice upgrading Redis in a controlled environment before upgrading it in a production environment.
Docker is an excellent tool to use for this purpose.

Follow these instructions to upgrade a Redis cluster. This guide assumes you have installed Redis using one of the supported methods listed [here]().

title: Save your current data

text:
Before upgrading, create a snapshot of your current dataset on each node (identified by its port) using the following command:

[code example]

Repeat for every node in your cluster, both masters and replicas.

This creates or updates an `RDB` file, for example `dump.rdb`, in the node's Redis data directory. If you use AOF persistence, the files will be named `appendonly.aof.*` and they will be written in the `appendonlydir` directory inside the data directory. The AOF-related directory and file names are the defaults. Use the names defined in your `redis.conf` file if different from the defaults.

Use the following command on each node to identify where your data directories are located:

[code example]

Make a copy of the files contained in each of those directories before proceeding.

title: Upgrade Redis nodes

text:
Upgrade each node one at a time, starting with the replicas, using these steps:

1. Stop the current version of Redis Open Source or Redis Stack server.
1. Follow the installation steps that correspond to your [Redis distribution]() to install Redis 8.
1. Start Redis 8 if it didn't start automatically.

title: Restore from saved files (if necessary)

text:
If necessary, restore the saved files to their original locations on each node. Then restart Redis on each node.

Redis Search won't be fully operational until all master shards have completed their upgrades.
Any queries sent during the upgrade process will either return errors or a message such as "Waiting for all nodes to connect".

title: Verify the upgrade

text:
[code example]

You should also verify that your data is accessible and that your clients can connect successfully.

code: redis-cli -p <port> SAVE

section_id: save-your-current-data

code: redis-cli -p <port> CONFIG GET dir

code:
redis-cli -p <port> INFO server | grep redis_version
redis-cli -p <port> cluster info
redis-cli --cluster check <IP address>:<port>

section_id: verify-the-upgrade


title: Upgrade Redis Open Source

summary: Upgrade Redis Open Source

summary: Upgrade a standalone instance of Redis Open Source or Redis Stack to Redis 8

title: Upgrade a standalone Redis instance to Redis 8

title: Upgrade a Redis cluster to Redis 8

title: Content

text:
Upgrade Redis Open Source to version 8 from version 7.x with or without modules or from Redis Stack 7.2 and 7.4.

<hr/>


title: Overview

text:
The supported upgrade paths are:
- Redis Open Source 7.x (with or without modules) to Redis 8 in Redis Open Source
- Redis Stack 7.2 or 7.4 to Redis 8 in Redis Open Source

It's essential to practice upgrading Redis in a controlled environment before upgrading it in a production environment.
Docker is an excellent tool to use for this purpose.

Follow these instructions to upgrade a single-node Redis server. This guide assumes you have installed Redis using one of the supported methods listed [here]().

title: Save your current data

text:
Before upgrading, create a snapshot of your current dataset using the following command:

[code example]

This creates or updates an `RDB` file, for example `dump.rdb`, in your Redis data directory. If you use AOF persistence, the files will be named `appendonly.aof.*` and they will be written in the `appendonlydir` directory inside the data directory. The AOF-related directory and file names are the defaults. Use the names defined in your `redis.conf` file if different from the defaults.

Use the following command to identify where your data directory is located:

[code example]

Make a copy of these files before proceeding:

[code example]

title: Upgrade Redis

text:
Follow these steps to upgrade Redis.

1. Stop the current version of Redis Open Source or Redis Stack server.
1. Follow the installation steps that correspond to your [Redis distribution]() to install Redis 8.
1. Start Redis 8 if it didn't start automatically.

title: Restore from saved files (if necessary)

text:
If Redis fails to start properly or if data is missing after the upgrade, restore from your backup.

1. Stop the Redis server.
2. Copy the backup file back into the the Redis data directory:
   [code example]
3. Start Redis again and verify data is restored:
   [code example]

title: Verify the upgrade

text:
Use the following command to confirm you're running Redis 8:

[code example]

You should also verify that your data is accessible and that your clients can connect successfully.

code: redis-cli SAVE

code: redis-cli CONFIG GET dir

code: cp -r /path/to/redis-data-dir/ /path/to/backup/

code: cp -r /path/to/backup/ /path/to/redis-data-dir/

section_id: restore-from-saved-files-if-necessary

code: redis-cli INFO persistence

code: redis-cli INFO server | grep redis_version


title: Redis Open Source version management

title: Overview

text: Redis Open Source provides comprehensive version management that prioritizes customer control over major changes.

title: Redis version structure

text:
Redis uses a **MAJOR.MINOR.PATCH** versioning scheme:

- **Major versions**: Significant changes that may include breaking changes (e.g., Redis 7 → Redis 8)
- **Minor versions**: New features and improvements within a major version (e.g., 8.2 → 8.4 → 8.6)
- **Patch versions**: Bug fixes and security updates (e.g., 8.2.1 → 8.2.2)

title: Supported versions

role: compatibility

text:
**We strongly recommend using the latest available version** to benefit from the newest features, performance improvements, and security updates.

| Version | Status | EOL Date |
|---------|--------|----------|
| **Redis 8.4** | GA | TBD |
| **Redis 8.2** | GA | TBD |
| **Redis 8.0** | GA | TBD |
| **Redis 7.4** | GA | December 1, 2029 |
| **Redis 7.2** | GA | December 1, 2029 |
| **Redis 6.2** | GA | April 1, 2027 |


title: Redis administration

summary: Advice for configuring and managing Redis in production

title: Redis setup tips

title: Linux

text:
* Deploy Redis using the Linux operating system. Redis is also tested on OS X, and from time to time on FreeBSD and OpenBSD systems. However, Linux is where most of the stress testing is performed, and where most production deployments are run.

* Set the Linux kernel overcommit memory setting to 1. Add `vm.overcommit_memory = 1` to `/etc/sysctl.conf`. Then, reboot or run the command `sysctl vm.overcommit_memory=1` to activate the setting. See [FAQ: Background saving fails with a fork() error on Linux?]() for details.

* To ensure the Linux kernel feature Transparent Huge Pages does not impact Redis memory usage and latency, run the command: `echo never > /sys/kernel/mm/transparent_hugepage/enabled` to disable it. See [Latency Diagnosis - Latency induced by transparent huge pages]() for additional context.

title: Memory

text:
* Ensured that swap is enabled and that your swap file size is equal to amount of memory on your system. If Linux does not have swap set up, and your Redis instance accidentally consumes too much memory, Redis can crash when it is out of memory, or the Linux kernel OOM killer can kill the Redis process. When swapping is enabled, you can detect latency spikes and act on them.

* Set an explicit `maxmemory` option limit in your instance to make sure that it will report errors instead of failing when the system memory limit is near to be reached. Note that `maxmemory` should be set by calculating the overhead for Redis, other than data, and the fragmentation overhead. So if you think you have 10 GB of free memory, set it to 8 or 9.

* If you are using Redis in a write-heavy application, while saving an RDB file on disk or rewriting the AOF log, Redis can use up to 2 times the memory normally used. The additional memory used is proportional to the number of memory pages modified by writes during the saving process, so it is often proportional to the number of keys (or aggregate types items) touched during this time. Make sure to size your memory accordingly.

* See the [`LATENCY DOCTOR`](/commands/latency-doctor) and [`MEMORY DOCTOR`](/commands/memory-doctor) commands to assist in troubleshooting.

title: Imaging

text: * When running under daemontools, use `daemonize no`.

title: Replication

text:
* Set up a non-trivial replication backlog in proportion to the amount of memory Redis is using. The backlog allows replicas to sync with the primary (master) instance much more easily.

* If you use replication, Redis performs RDB saves even if persistence is disabled. (This does not apply to diskless replication.) If you don't have disk usage on the master, enable diskless replication.

* If you are using replication, ensure that either your master has persistence enabled, or that it does not automatically restart on crashes. Replicas will try to maintain an exact copy of the master, so if a master restarts with an empty data set, replicas will be wiped as well.

title: Security

role: security

text: * By default, Redis does not require any authentication and listens to all the network interfaces. This is a big security issue if you leave Redis exposed on the internet or other places where attackers can reach it. See for example [this attack](http://antirez.com/news/96) to see how dangerous it can be. Please check our [security page]() for information about how to secure Redis.

title: Running Redis on EC2

text:
* Use HVM based instances, not PV based instances.
* Do not use old instance families. For example, use m3.medium with HVM instead of m1.medium with PV.
* The use of Redis persistence with EC2 EBS volumes needs to be handled with care because sometimes EBS volumes have high latency characteristics.
* You may want to try the new diskless replication if you have issues when replicas are synchronizing with the master.

title: Upgrading or restarting a Redis instance without downtime

text:
Redis is designed to be a long-running process in your server. You can modify many configuration options without a restart using the [`CONFIG SET`](/commands/config-set) command. You can also switch from AOF to RDB snapshots persistence, or the other way around, without restarting Redis. Check the output of the `CONFIG GET *` command for more information.

From time to time, a restart is required, for example, to upgrade the Redis process to a newer version, or when you need to modify a configuration parameter that is currently not supported by the [`CONFIG`](/commands/config) command.

Follow these steps to avoid downtime.

* Set up your new Redis instance as a replica for your current Redis instance. In order to do so, you need a different server, or a server that has enough RAM to keep two instances of Redis running at the same time.

* If you use a single server, ensure that the replica is started on a different port than the master instance, otherwise the replica cannot start.

* Wait for the replication initial synchronization to complete. Check the replica's log file.

* Using [`INFO`](/commands/info), ensure the master and replica have the same number of keys. Use `redis-cli` to check that the replica is working as expected and is replying to your commands.

* Allow writes to the replica using `CONFIG SET slave-read-only no`.

* Configure all your clients to use the new instance (the replica). Note that you may want to use the [`CLIENT PAUSE`](/commands/client-pause) command to ensure that no client can write to the old master during the switch.

* Once you confirm that the master is no longer receiving any queries (you can check this using the [`MONITOR`](/commands/monitor) command), elect the replica to master using the `REPLICAOF NO ONE` command, and then shut down your master.

If you are using [Redis Sentinel]() or [Redis Cluster](), the simplest way to upgrade to newer versions is to upgrade one replica after the other. Then you can perform a manual failover to promote one of the upgraded replicas to master, and finally promote the last replica.

---
**NOTE**

Redis Cluster 4.0 is not compatible with Redis Cluster 3.2 at cluster bus protocol level, so a mass restart is needed in this case. However, Redis 5 cluster bus is backward compatible with Redis 4.

---