How do you install Redis on a typical Linux server, and how do you verify it is running correctly?
Short answer
You can install Redis using your operating system's package manager, or by downloading and compiling the source code directly, and once installed, you start the Redis server process and use the redis-cli tool with a simple PING command, which should respond with PONG if the…
Advertisement
AModel answer
You can install Redis using your operating system's package manager, or by downloading and compiling the source code directly, and once installed, you start the Redis server process and use the redis-cli tool with a simple PING command, which should respond with PONG if the server is running and reachable correctly.
sudo apt-get install redis-server
redis-cli ping
-- Expected response: PONGReal-world example
A developer setting up a new development environment installs Redis using their Linux distribution's package manager, then confirms it is working correctly with a quick PING command before starting application development.
Likely follow-ups
- What is the difference between installing Redis through a package manager versus building it from source?
- What default port does Redis listen on?
Related topics