As I’m sure you’re aware, you’d first have to install and properly configure the Redis or Memcached server software. How you do that — bare metal or Docker — is really outside the scope and speciality of the WordPress support forums (which explains why your post went unanswered for over a week).
When you have the server software installed, there are several WordPress plugins (Redis?/?Memcached) that can help with managing the cache on the WordPress end.
Thank you for explanation.