Skip to content

Instantly share code, notes, and snippets.

@devthue
Last active August 10, 2016 06:52
Show Gist options
  • Save devthue/a82ac5bfd818e885e565d440bbd52a35 to your computer and use it in GitHub Desktop.
Save devthue/a82ac5bfd818e885e565d440bbd52a35 to your computer and use it in GitHub Desktop.
How To Install Redis

How To Install Redis

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-redis

Download the latest stable release tarball from Redis.io.

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

Untar it and switch into that directory:

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

Proceed to with the make command:

make

Run the recommended make test:

make test

Finish up by running make install, which installs the program system-wide.

sudo make install

Once the program has been installed, Redis comes with a built in script that sets up Redis to run as a background daemon.

To access the script move into the utils directory:

cd utils

From there, run the Ubuntu/Debian install script:

sudo ./install_server.sh

As the script runs, you can choose the default options by pressing enter. Once the script completes, the redis-server will be running in the background.

You can start and stop redis with these commands (the number depends on the port you set during the installation. 6379 is the default port setting):

sudo service redis_6379 start
sudo service redis_6379 stop

You can then access the redis database by typing the following command:

redis-cli

You now have Redis installed and running. The prompt will look like this:

redis 127.0.0.1:6379> 

To set Redis to automatically start at boot, run:

sudo update-rc.d redis_6379 defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment