Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Install Redis on your Production Ubuntu

Install deps

sudo apt-get update
sudo apt-get install -y build-essential tcl8.5

Get code

wget http://download.redis.io/releases/redis-stable.tar.gz

unrar

tar xzf redis-stable.tar.gz
cd redis-stable

Build from source

make

make test

sudo make install

Setup deamon

cd utils
sudo ./install_server.sh # Choose 6392 port
sudo nano /etc/redis/6392.conf 
  # use Apple+W to search in nano
  dir /var/redis/6392 (very important step!)
  # logfile /var/log/redis_6392.log
  maxclients 10000
  maxmemory 500mb
  maxmemory-policy noeviction

Make sure log is accesable

sudo chmod 777 /var/log/redis_6392.log

Make sure the data folder exists and is available

sudo mkdir -p /var/redis/6392
sudo chmod 777 -R /var/redis/6392/

Restart service

sudo service redis_6392 stop
sudo service redis_6392 start

Test

redis-cli -p 6392
> ping

Make sure there is a

/var/redis/6392/dump.rdb

App setup

Since this redis is local, access it via
redis://localhost:6392/
Or just set in redis.yml

staging:
  redis: redis://localhost:6392/
production:
  redis: redis://localhost:6392/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment