27

I need to install redis in amazon cloud. I need it as a part of my npm module kue (deployment). Can anyone link me step by step tutorial or explain how to do it, considering the fact that I'm not good to bad with linux and administration.

user732456
  • 2,638
  • 2
  • 35
  • 49

4 Answers4

104

If you enable the Extra Packages for Enterprise Linux (EPEL) repository that's present on Amazon Linux, you can install with yum.

sudo yum-config-manager --enable epel
sudo yum install redis
# Start redis server
sudo redis-server /etc/redis.conf
Kostanos
  • 9,615
  • 4
  • 51
  • 65
Kip
  • 1,540
  • 2
  • 11
  • 10
17

Rather than spin up an EC2 instance and install/manage redis there, you could create an Elasticache instance running redis and let AWS manage it all for you.

If you really do want to run your own redis server then you'll want to launch an EC2 instance and then manually install redis onto it. The AWS and redis documentation that I've linked to both provide step by step instructions.

Bruce P
  • 19,995
  • 8
  • 63
  • 73
  • I tried the hard way. Will create Elasticache when I'm completely finished. For now I had an AWS AMI instance up and running. I have redis server installed. I managed to ping it on 127.0.0.1:6379. Now how can I use it from another aws instance. Again sorry for stupid questions but I've never done any administration before. I presume I have to make a rule for my aws security group for 6379 port and than I need to do a port forwarding while logged on aws instance, but I'm not sure. – user732456 Dec 30 '14 at 11:50
  • You will need to add a rule to the security group to allow port 6379 through. You don't need to set up any prot forwarding of any sort. – Bruce P Dec 30 '14 at 14:26
  • All is up and running. I chose a separate EC2 instance with manual redis installation. Now I'm returning to Elasticache approach. There is one thing I'm uncertain: As I needed redis for my npm kue module, does it share the sami interface? – user732456 Jan 06 '15 at 15:01
  • 7
    Be warned: TLDR; Elasticache requires more time and $$. I took the advice of this answer and got sucked into the blackhole that is Elasticache. I didn't get it working, wasted many hours all because AWS won't resolve it's node cluster DNS correctly. However you could pay for a $50/month contract to get basic support for them to resolve it... or you could just install on your EC2 instance. – Matt Jensen Oct 01 '15 at 22:27
  • 5
    I agree with you @MattJensen. Install Redis manually on EC2 is no biggie just follow below guide. For a Node.js app I'm making I think going with Amazon Elasticache only adds unnecessary complexity. Would much rather just have Redis running on localhost. https://gist.github.com/FUT/7db4608e4b8ee8423f31 – ChrisRich Nov 11 '15 at 00:32
  • @ChrisRch thanks, I think the real downside worth mentioning is that when you install on EC2 the best practices are 100% on you. Most of the Redis install guides I've seen out there are the "quick and dirty" approach. Take with a grain of salt. – Matt Jensen Nov 11 '15 at 19:56
10

This worked for me on my "Amazon Linux 2" OS (based on RHEL/CENTOS 7)

wget -O /tmp/epel.rpm –nv https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y /tmp/epel.rpm
sudo yum update -y
sudo yum install redis -y

After installation completes, start redis-server by typing this command

redis-server
Jossef Harush Kadouri
  • 32,361
  • 10
  • 130
  • 129
8

On an Amazon Linux you can use the Extras Library on EC2:

sudo amazon-linux-extras install redis6
Sasha Shpota
  • 9,436
  • 14
  • 75
  • 148