Memcached is a Linux in-memory cache application. It works as a key-value store that stores the information in-memory only to speed up applications. Many CMS systems like WordPress and Drupal support Memcached to speed up web page delivery. In this article, we will learn how to install Memcached on Debian 10.
Installing Memcached on Debian 10
For installing Memcached on Debian 10, you will need to perform the following steps:
We know that most of the operations in the Linux operating system are performed via terminal. Since we are working with Debian 10 which is also a flavor of Linux, therefore, we will need to launch the terminal for installing Memcached on it. For doing that, all we have to do is to click on the Activities tab located on our Debian 10 desktop and then type terminal in the respective search bar. Finally, click on the terminal search result to launch the terminal window as shown in the image below:
Now you need to update your Debian 10 system so that it is all set to install the Memcached memory caching system on it. For doing that, type the following command in your terminal and then press the Enter key:
sudo apt update
This command will take some time to execute as it requires updating all the relevant packages before your actual installation. It is also shown in the following image:
Once all the necessary packages have been updated, you will be able to see the output shown in the image below on your terminal:
Now for installing Memcached on Debian 10, type the following command in your terminal and then press the Enter key:
sudo apt install memcached libmemcached-tools
This command will install Memcached along with the libmemcached-tools package which provides all the relevant tools for interacting with this system. This command is shown in the following image:
During this process, you will be asked for your consent i.e. whether you want to proceed with this installation or not. Type in “Y” in your terminal and then press the Enter key for providing your consent as shown in the image below:
Memcached has been successfully installed on your system. Now you need to check if it is working. To do so, you will need to start this service. Type the following command in your terminal and then press the Enter key:
sudo systemctl start memcached
This command is also shown in the image below:
Once you run this command, the Memcached service will start running and for verifying this, type the following command in your terminal and then press the Enter key:
sudo systemctl status memcached
Running this command will reveal the status of the Memcached service.
As soon as this command is executed successfully, you will be able to see that the Memcached service is Active and Running as shown in the image below:
You can also stop this service at any time you want by typing the following command in your terminal and then pressing the Enter key:
sudo systemctl stop memcached
When you will run the status command again, you will be able to see that now the status of Memcached service is Inactive and Dead which will indicate that it has stopped running as shown in the image below:
By following the simple method explained in this article, you can easily install and enable the Memcached service on Debian 10 and hence you can improve the performance of the applications that you run on your Debian 10 system.