Skip to content

Instantly share code, notes, and snippets.

@hackedunit
Last active July 14, 2025 13:57
Show Gist options
  • Save hackedunit/a53f0b5376b3772d278078f686b04d38 to your computer and use it in GitHub Desktop.
Save hackedunit/a53f0b5376b3772d278078f686b04d38 to your computer and use it in GitHub Desktop.

Revisions

  1. hackedunit revised this gist Mar 7, 2017. 1 changed file with 29 additions and 17 deletions.
    46 changes: 29 additions & 17 deletions install-redis.md
    Original file line number Diff line number Diff line change
    @@ -4,19 +4,23 @@

    2. Install Redis

    `cd /tmp`
    `curl -O http://download.redis.io/redis-stable.tar.gz`
    `tar xzvf redis-stable.tar.gz`
    `cd redis-stable`
    `make`
    `make test`
    `sudo make install`
    ```
    cd /tmp
    curl -O http://download.redis.io/redis-stable.tar.gz
    tar xzvf redis-stable.tar.gz
    cd redis-stable
    make
    make test
    sudo make install
    ```

    3. Configure Redis

    `sudo mkdir /etc/redis`
    `sudo cp /tmp/redis-stable/redis.conf /etc/redis`
    `sudo nano /etc/redis/redis.conf`
    ```
    sudo mkdir /etc/redis
    sudo cp /tmp/redis-stable/redis.conf /etc/redis
    sudo nano /etc/redis/redis.conf
    ```

    In the file, change the `supervised` directive's value to `systemd`.

    @@ -28,7 +32,11 @@

    Next, specify the working directory for Redis. This is the directory that Redis will use to dump persistent data. We can use `/var/lib/redis`

    `dir /var/lib/redis`
    ```
    ...
    dir /var/lib/redis
    ...
    ```

    Save and close the file.

    @@ -40,13 +48,17 @@

    5. Create Redis user, group and directories

    `sudo adduser --system --group --no-create-home redis`
    `sudo mkdir /var/lib/redis`
    `sudo chown redis:redis /var/lib/redis`
    `sudo chmod 770 /var/lib/redis`
    ```
    sudo adduser --system --group --no-create-home redis
    sudo mkdir /var/lib/redis
    sudo chown redis:redis /var/lib/redis
    sudo chmod 770 /var/lib/redis
    ```

    6. Start the Redis service and set Redis to start on boot

    `sudo systemctl start redis`
    `sudo systemctl enable redis`
    ```
    sudo systemctl start redis
    sudo systemctl enable redis
    ```

  2. hackedunit created this gist Mar 7, 2017.
    52 changes: 52 additions & 0 deletions install-redis.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,52 @@
    1. Install pre-requisities

    `sudo apt-get install build-essential tcl`

    2. Install Redis

    `cd /tmp`
    `curl -O http://download.redis.io/redis-stable.tar.gz`
    `tar xzvf redis-stable.tar.gz`
    `cd redis-stable`
    `make`
    `make test`
    `sudo make install`

    3. Configure Redis

    `sudo mkdir /etc/redis`
    `sudo cp /tmp/redis-stable/redis.conf /etc/redis`
    `sudo nano /etc/redis/redis.conf`

    In the file, change the `supervised` directive's value to `systemd`.

    ```
    ...
    supervised systemd
    ...
    ```

    Next, specify the working directory for Redis. This is the directory that Redis will use to dump persistent data. We can use `/var/lib/redis`

    `dir /var/lib/redis`

    Save and close the file.

    4. Configure systemd to start Redis on boot

    `sudo nano /etc/systemd/system/redis.service`

    Copy the contents of [this gist](https://gist.github.com/hackedunit/14690b6174708d3e83593ce1cdfb4ed8) to the file, save and close.

    5. Create Redis user, group and directories

    `sudo adduser --system --group --no-create-home redis`
    `sudo mkdir /var/lib/redis`
    `sudo chown redis:redis /var/lib/redis`
    `sudo chmod 770 /var/lib/redis`

    6. Start the Redis service and set Redis to start on boot

    `sudo systemctl start redis`
    `sudo systemctl enable redis`