For Ubuntu, use the command: sudo apt-get install redis-server. For macOS, use: brew install redis. These commands will install Redis on your system, allowing you to start using it.