Installing Memcached on Debian 11

The following guide describes how to install Memcached on a Debian system 11.
Memcached is a data and object caching system, which can significantly reduce the time needed to obtain data from the database by caching them.

The following guide is a perfect complement to our server LAMP in order to accelerate it.

We start the terminal

we are installing the memcached package


apt-get install memcached libmemcached-tools -y

apt-get install python3-pymemcache libcache-memcached-libmemcached-perl -y

We run it in the system:
systemctl start memcached

systemctl enable memcached

We check the status of the service:

systemctl status memcached

Now we will do the configuration.

Basic Memcached configuration

The Memcached configuration file is /etc/memcached.conf.
Basic configuration parameters:

-m - the maximum amount of memory dedicated to Memcached. (by default: 64 MB)
-p - The port on which Memcached is listening. (by default: 11211)
-l - IP address on which the Memcached service is listening by default localhost ( To listen on all interfaces use

we configure as follows:

nano /etc/memcached.conf

-U 0
-p 11211
-u memcache
-m 2000

After making the changes, we restart the service:

systemctl restart memcached

We install the memcached extension for PHP in the system.

apt-get install php-memcached

Memcached should now be available on and should work fine on the server.

We are also reloading the Apache server.

service apache2 restart

the server for this guide was provided by

Below is the video:

How useful this post was?

How useful this post was, How useful this post was!

How useful this post was 5 / 5. How useful this post was: 5

How useful this post was! How useful this post was.