Skip to content

Instantly share code, notes, and snippets.

@nightfox
Last active March 10, 2019 01:12
Show Gist options
  • Save nightfox/8153411 to your computer and use it in GitHub Desktop.
Save nightfox/8153411 to your computer and use it in GitHub Desktop.
Installing Redis Server as a service
sudo vim /etc/redis/redis.conf
Change the following lines
daemonize yes
bind 127.0.0.1
dir /var/lib/redis
wget https://gist.github.com/nightfox/8153193/raw/553c375424866e8d0d0bd5b48d23578c93031bce/redis-server
sudo mv redis-server /etc/init.d/redis-server
sudo chmod +x /etc/init.d/redis-server
Create New User
sudo useradd -r -s /bin/false redis
sudo mkdir -p /var/lib/redis
sudo mkdir -p /var/log/redis
sudo chown redis.redis /var/lib/redis
sudo update-rc.d redis-server defaults
Now you can start and stop redis:
sudo service redis-server start
sudo service redis-server stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment