Skip to content

Instantly share code, notes, and snippets.

@irfanfadilah
Last active November 5, 2023 14:06
Show Gist options
  • Save irfanfadilah/02d4d5775e187cc3e30a72eec334f9df to your computer and use it in GitHub Desktop.
Save irfanfadilah/02d4d5775e187cc3e30a72eec334f9df to your computer and use it in GitHub Desktop.
Setup Simple Redis Cache Server
1. Install Redis
2. Start and Enable:
- sudo systemctl start redis-server
- sudo systemctl enable redis-server
3. Update Config:
- bind 0.0.0.0
- protected-mode no
- maxmemory 100mb
- maxmemory-policy allkeys-lfu
4. Set ACL and disable default user in Config:
- user username on >password +@all ~* &*
- user default off
5. Set the Linux Kernel Overcommit Memory:
- Add vm.overcommit_memory = 1 to /etc/sysctl.conf
- Run sysctl vm.overcommit_memory=1 to apply
6. Restart Redis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment