How to Install Redis and Run the Redis CLI on Windows
Redis is an in-memory data structure store, primarily used as a database, cache, and message broker. Here's a detailed guide for Windows users to install and manage Redis:
Guide Tasks
  • Read Tutorial

Step 1: Download Redis for Windows

  1. Visit the Redis for Windows GitHub repository: https://github.com/microsoftarchive/redis
  2. Click on the "releases" tab and choose the latest release (or the version you wish to install).
  3. Download the zip file containing the binaries (for example, Redis-x64-<version>.zip).

Step 2: Extract the Redis binaries

  1. Once the download is complete, extract the contents of the zip file to a folder of your choice. For example, you can extract it to C:\Redis.

Step 3: Install Redis as a Windows service

  1. Open a command prompt (cmd) with administrative privileges.
  2. Navigate to the Redis folder you extracted earlier, for example: cd C:\Redis.
  3. To install Redis as a service, run the following command: redis-server --service-install redis.windows-service.conf. This will use the configuration file provided with the binaries.
  4. You should receive a message indicating that Redis has been successfully installed as a service.

Step 4: Start Redis service

  1. To start the Redis service, run the following command: redis-server --service-start.
  2. You should receive a message indicating that the Redis service has been started.

Step 5: Verify Redis installation

  1. In the command prompt, run the Redis CLI by typing redis-cli and pressing Enter.
  2. To check if Redis is running, type ping and press Enter. If Redis is running, it will return "PONG".
  3. You can also run other Redis commands to interact with the server, such as SET key value and GET key.

Managing Redis on Windows

  1. To stop the Redis service, run the following command: redis-server --service-stop.
  2. To uninstall the Redis service, run the following command: redis-server --service-uninstall.
  3. To configure Redis, edit the redis.windows-service.conf file in the Redis folder. You can modify settings like memory limits, logging, and security options. After making changes, restart the Redis service to apply the new configuration.

For more information and advanced configuration options, consult the official Redis documentation: https://redis.io/documentation