Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install Redis from source (Ubuntu)
if [ "$(whoami)" != "root" ]; then
echo "ERROR : Run script as Root (sudo !!) please"
exit 1
read -e -p "Redis version to be installed (change if needed) : " -i "2.8.2" VERSION
echo 'Installing redis v.'$VERSION' ... '
# installing build essentials if it is missing
apt-get install build-essential
tar xzf redis-$VERSION.tar.gz
cd redis-$VERSION
make install prefix=/usr/local/bin/
cp redis.conf /etc/redis.conf
cd ..
rm redis-$VERSION -R
rm redis-$VERSION.tar.gz
# create user and autostart
useradd -r -s /bin/false redis
wget -O /etc/init.d/redis-server
touch /var/run/
chown redis:redis /var/run/
chmod 755 /etc/init.d/redis-server
# UNCOMMENT IF NEEDED to do autostart
# update-rc.d redis-server defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.