Redis Install and Configure

Some notes on how to install and configure Redis for your Glitch project.

Download and build

$ wget http://download.redis.io/redis-stable.tar.gz
$ tar -xvzf redis-stable.tar.gz
$ cd redis-stable
$ make

Installation and clean up

You can install it to the .local/bin sub directory under your project.

# from your project directory
$ cp src/redis-cli .local/bin
$ cp src/redis-server .local/bin
$ rm -rf redis-stable*

Also, add the following to your .gitignore

.rediscli_history

Configuration

We'll configure how and where data is stored.

Create a .redis to hold Redis server configurations

$ cat > /app/.redis <<- EOM
> dir /app/.data
> appendonly yes
> daemonize yes
> EOM

Create .data directory if it doesn't already exists

$ mkdir -p /app/.data

Starting

You can start Redis manually like so

$ redis-server /app/.redis

...or start if you're using Node

{ // package.json
  ...
  "scripts": {
    "start-redis": "/app/.local/bin/redis-server /app/.redis"
    "start": "npm run start-redis && ...."
  }
}