Skip to content

Commit 970bbb1

Browse files
committed
Update snap installation instructions
1 parent 2c02677 commit 970bbb1

File tree

1 file changed

+14
-36
lines changed
  • content/operate/oss_and_stack/install/install-stack

1 file changed

+14
-36
lines changed

content/operate/oss_and_stack/install/install-stack/snap.md

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,27 @@ weight: 4
1212

1313
## Install Redis Community Edition (CE) on Ubuntu Linux using Snap
1414

15-
First, download the latest Redis CE Snap package from [this page](https://redis.io/downloads/).
16-
17-
To install, run:
15+
To install Redis via snap, run the following commands:
1816

1917
{{< highlight bash >}}
2018
sudo apt update
21-
sudo apt install redis-tools
22-
sudo snap install --dangerous --classic <snapname.snap>
19+
sudo apt install redis-tools # this will install `redis-cli`
20+
sudo snap install redis
2321
{{< / highlight >}}
2422

25-
Redis will not start automatically, nor will it start at boot time. To start `redis-server` in the foreground, run the command:
26-
27-
{{< highlight bash >}}
28-
sudo snap run redis-server
29-
{{< /highlight >}}
30-
31-
To stop Redis, enter `Ctrl-C`.
23+
Redis will start automatically after installation and also at boot time.
3224

33-
Follow these steps to integrate Redis CE with `systemd` so you can start/stop in/from the background:
25+
## Connect to Redis CE
3426

35-
1. Edit the `/etc/systemd/system/redis-server.service` file and enter the following information:
27+
Once Redis is running, you can test it by running `redis-cli`:
3628

37-
{{< highlight text >}}
38-
[Unit]
39-
Description=Redis CE Server
40-
After=network.target
41-
42-
[Service]
43-
ExecStart=/usr/bin/snap run redis-server
44-
Restart=always
45-
User=root
46-
Group=root
47-
48-
[Install]
49-
WantedBy=multi-user.target
50-
{{< /highlight >}}
51-
52-
1. Run the following commands.
29+
{{< highlight bash >}}
30+
redis-cli
31+
{{< / highlight >}}
5332

54-
{{< highlight bash >}}
55-
sudo systemctl daemon-reload
56-
sudo systemctl start redis-server
57-
sudo systemctl enable redis-server
58-
{{< /highlight >}}
33+
Test the connection with the `ping` command:
5934

60-
If your Linux distribution does not currently have Snap installed, you can install it using the instructions described [here](https://snapcraft.io/docs/installing-snapd). Then, download the appropriate from the [downloads page](https://redis.io/downloads/).
35+
{{< highlight bash >}}
36+
127.0.0.1:6379> PING
37+
PONG
38+
{{< / highlight >}}

0 commit comments

Comments
 (0)