Question: How to install Memcached in CentOS 7?
Answer
Memcached is a high-performance, distributed memory object caching server that stores data in memory to reduce the number of times an external database or an API must be accessed. Here's how you can install Memcached on CentOS 7:
- Update your system:
CODE_BLOCK_PLACEHOLDER_0 - Install Memcached and its dependencies:
CODE_BLOCK_PLACEHOLDER_1 - Start Memcached and configure it to start at boot time:
CODE_BLOCK_PLACEHOLDER_2 - Verify that Memcached is running:
CODE_BLOCK_PLACEHOLDER_3 - By default, Memcached listens only on the loopback interface (localhost). If you want to allow incoming connections from other hosts, edit the configuration file /etc/sysconfig/memcached and change the OPTIONS line as follows:
CODE_BLOCK_PLACEHOLDER_4
This will cause Memcached to listen on all available network interfaces. - Restart Memcached for the changes to take effect:
CODE_BLOCK_PLACEHOLDER_5
That's it! You have successfully installed and configured Memcached on CentOS 7.
Was this content helpful?
Help us improve by giving us your feedback.
Other Common Memcached Questions (and Answers)
- Does Memcached expire?
- Does Memcached write to disk?
- What is the location of Memcached error log?
- How does Memcached consistent hashing work?
- Does restarting Memcached clear cache?
- Does Memcached support encryption?
- How to pronounce Memcached?
- How to check Memcached version in Linux?
- How is Memcached implemented?
- How to clear Memcached data?
- How does Memcached work in PHP?
- How to install Memcached on Windows?
White Paper
Free System Design on AWS E-Book
Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.

Switch & save up to 80%
Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement. Instantly experience up to a 25X boost in performance and 80% reduction in cost