# Install Redis Stack on macOS

```json metadata
{
  "schema_version": 2,
  "title": "Install Redis Stack on macOS",
  "description": "How to install Redis Stack on macOS",
  "categories": ["docs","operate","stack","oss"],
  "tableOfContents": {"sections":[{"children":[{"id":"first-time-redis-installation","title":"First-time Redis installation"},{"id":"existing-redis-installation","title":"Existing Redis installation"},{"id":"start-redis-stack-server","title":"Start Redis Stack Server"}],"id":"install-using-homebrew","title":"Install using Homebrew"},{"id":"installing-redis-after-installing-redis-stack","title":"Installing Redis after installing Redis Stack"},{"id":"uninstall-redis-stack","title":"Uninstall Redis Stack"},{"id":"connect-to-redis","title":"Connect to Redis"},{"id":"next-steps","title":"Next steps"}]}

,
  "codeExamples": []
}
```


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.

## Install using Homebrew

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.

### First-time Redis installation

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.

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

### Existing Redis installation

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


### Start Redis Stack Server

You can now start Redis Stack Server as follows:


redis-stack-server


## Installing Redis after installing Redis Stack

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.

## Uninstall Redis Stack

To uninstall Redis Stack, run:


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


## Connect to Redis

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](https://redis.io/docs/latest/develop/tools/insight).

## Next steps

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

* Try the [Redis CLI tutorial](https://redis.io/docs/latest/develop/tools/cli)
* Connect using one of the [Redis clients](https://redis.io/docs/latest/develop/clients)
* [Install Redis "properly"](https://redis.io/docs/latest/operate/oss_and_stack/install/archive/install-redis#install-redis-properly)
  for production use.

