This guide provides steps to set up and run Redis Stack using Docker and a Node.js application.
Before proceeding, ensure you have the following installed on your system:
-
Docker:
- Install Docker from Docker's official website.
- Verify the installation by running:
docker --version
-
Node.js:
- Install Node.js and npm from Node.js official website.
- Verify the installation by running:
node --version npm --version
-
Redis CLI (Optional for monitoring commands):
- For installation instructions, visit Redis official website.
- Verify the installation by running:
redis-cli --version
Run the following command to start Redis Stack in detached mode using Docker:
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latestRun the following to verify the redis-stack container is running:
docker psOnce the Redis Stack container is running, connect to it using Redis CLI:
redis-cliIn Redis CLI, run the following command to monitor all commands processed by the Redis server:
monitorIn Redis CLI, you can list all keys stored in the database using:
keys *
LRANGE whiteboard_events 0 -1 Navigate to your Node.js project directory and run the following commands:
npm install && clear && npm start