Install Memcached on AlmaLinux 9 / RHEL 9 / Ubuntu 22.04+

Evans

Last Update 2 bulan yang lalu

Memcached is a high-performance, in-memory caching system used to speed up dynamic websites and applications by reducing database load.

It is supported on most modern Linux distributions and integrates easily with CMS platforms and programming languages such as PHP, Python, and Node.js.

Step 1: Install Memcached
🐧 For AlmaLinux 9 / RHEL 9:
🐧 For Ubuntu 22.04+:
Step 2: Configure Memcached

Memcached defaults:


  • Port: 11211

  • User: memcached

  • Max Connections: 1024

  • Cache Size: 64MB

📄 Configuration File:
  • AlmaLinux / RHEL: /etc/sysconfig/memcached

  • Ubuntu: /etc/memcached.conf

Example (AlmaLinux/RHEL - Edit file with vim or nano):

Update the values as needed:

Example (Ubuntu - Edit /etc/memcached.conf):

Update or add the following:

Step 3: Start and Enable Memcached
✅ Commands for all systems:

 To check the status:

🛑 To stop Memcached:

✅ Recap

OSConfig File
AlmaLinux 9 / RHELdnf/etc/sysconfig/memcached
Ubuntu 22.04+apt/etc/memcached.conf

Memcached is now installed, configured, and enabled to start at boot on your updated Linux system.

Was this article helpful?

1 out of 1 liked this article

Still need help? Message Us