Skip to content

Instantly share code, notes, and snippets.

@arnaudcourtecuisse
Last active June 11, 2018 09:05
Show Gist options
  • Save arnaudcourtecuisse/7d2d9273cbd210d240de3ff1bef4074d to your computer and use it in GitHub Desktop.
Save arnaudcourtecuisse/7d2d9273cbd210d240de3ff1bef4074d to your computer and use it in GitHub Desktop.
Redis install
[Unit]
Description=Redis In-Memory Data Store
After=network.target
[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always
[Install]
WantedBy=multi-user.target
# Pre-requisites
sudo apt-get install build-essential
# Install
cd /tmp
wget http://download.redis.io/releases/redis-stable.tar.gz
tar -xzf redis-stable.tar.gz
cd redis-stable
make
sudo make install
# Configuration
sudo adduser --system --group --no-create-home redis
sudo mkdir /etc/redis /var/lib/redis
sudo chown redis:redis /var/lib/redis
sudo chmod 770 /var/lib/redis
sed 's:^supervised .*:supervised systemd: ; s:^dir .*:dir /var/lib/redis:' redis.conf | sudo tee /etc/redis/redis.conf
sudo systemctl enable redis.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment