Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AWS redis-cli without redis server on AWS EC2

Setup redis-cli without the whole Redis Server on AWS EC2

This fast tutorial will teach you how to install redis-clion AWS EC2 without having to install the whole Redis Server. Firstly, SSH into your EC2 instance and run the following command:

$ sudo yum install gcc

This may return an "already installed" message, but that's OK. After that, just run:

$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli

In order to connect to your remote server, use something like:

$ redis-cli -h 192.268.34.32

References:

@onp4
Copy link

onp4 commented Aug 27, 2018

bin is src/redis-cli

@Valve
Copy link

Valve commented May 7, 2020

stopped workin on redis 6

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-amazon-linux/4.8.5/lto-wrapper
Target: x86_64-amazon-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,fortran,ada,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-amazon-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-amazon-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-amazon-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) 

@alinturlac
Copy link

If you're fine with using an older version, you can use

wget http://download.redis.io/releases/redis-5.0.8.tar.gz && tar xvzf redis-5.0.8.tar.gz && cd redis-5.0.8 && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli

instead

@Valve
Copy link

Valve commented Aug 11, 2020

@alinturlac I ended up building the redis 6 on my home laptop, uploading it to S3 and downloading the pre-built binary for Amazon linux from everywhere I want. Much faster and cleaner.

@craftypenguins-chris
Copy link

Please adjust the instructions to yum install gcc64

gcc is too old on default build

@djpritchett
Copy link

glad I found this...thanks for posting..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment