Install Memcached on a Linux server running Ubuntu 20.04 LTS

Share This Post

When connecting to the Memcached server, the connection is made using the PROTOCOLS TCP and IP, and data is delivered with a distinct key value and saved as strings in memory. Both permanent and temporary data can be saved. In the case of temporary storage, the data that has been cached will be automatically deleted after the specified amount of time.

Many businesses and website owners utilise Memcached, a published cache server with a BSD licence, to swiftly recover data from memory. Many users have used it to increase the speed and efficiency of their dynamic websites with database connectivity. Performance can be increased by reducing the number of times complex and frequently used database queries, particularly SELECT statements, are called or by storing important data in memory instead of accessing the disc.


  • Memcached Server is already included in the default repository for Ubuntu 20.04, therefore we don’t need to add any additional third-party repositories to install it. Therefore, we can configure this cache server on our system using the APT package manager and the accessible package names.

  • Run the given command in the terminal of your Ubuntu 20.04 LTS server to install the most recent system updates.

For service status:

Let’s examine the Memcached server version that is installed on our system right now. The command to verify the MemCached service’s status is also covered here.

The above command will tell us whether the service of our cache server is running actively or not; including which IP address can access it at what port number.

If you want to use Memcached on Ubuntu 20.04 for PHP-based applications such as WordPress, Magento, and others, then we have to install an extension called php-memcached. It can easily be installed using the APT package manager. Here is the command:

Note: The above command must run on the Ubuntu or Debian server where you are hosting your PHP application.  And we are also assuming that you already have PHP installed. If you don’t have PHP then run this command: sudo apt install apache2 php libapache2-mod-php php-memcached php-cli

To confirm our installation Memcached on Ubuntu 20.04 and its extension is working for the PHP application, we can create info.php file on the server where Apache and PHP are installed. Paste this code:

Save the file using Ctrl+O, hit the Enter key, and then exit the text editor using Ctrl+X. After that open your browser and point to the created file: http://server-ip-address/info.php

Copy-Paste the following in the files Save the file using Ctrl+O, hit the Enter key, and then exit the text editor using Ctrl+X.

Now, let’s confirm further whether this caching server is really storing our data temporarily in the memory to speed up the performance of our PHP applications or not. For that create a Test.php file. Scroll down and you will find a section showing details related to Memcached. This means the extension is enabled and working for PHP.

Read More:

Partnership Between Mitsubishi Electric and Nozomi Networks Strengthens Operational Technology Security Business

Mitsubishi Electric and Nozomi Networks Partnership Mitsubishi Electric and Nozomi...

Solidion Technology Inc. Completes $3.85 Million Private Placement Transaction

**Summary:** 1. Solidion TechnologyInc. has announced a private placement deal...

Analyzing the Effects of the EU’s AI Act on Tech Companies in the UK

Breaking Down the Impact of the EU’s AI Act...

Tech in Agriculture: Roundtable Discusses Innovations on the Ranch

Summary of Tech on the Ranch Roundtable Discussion: ...

Are SMEs Prioritizing Tech Investments Over Security Measures?

SMEs Dive Into Tech Investments, But Are...

Spotify Introduces Music Videos for Premium Members in Chosen Markets

3 Summaries of Spotify Unveils Music Videos for Premium...

Shearwater to Monitor Production at Equinor’s Two Oil Platforms

Shearwater GeoServices secures 4D monitoring projects from Equinor for...

Regaining Europe’s Competitive Edge in Innovation: Addressing the Innovation Lag

Europe’s Innovation Lag: How Can We Regain Our Competitive...

Related Posts

Government Warns of AI-Generated Content: Learn More about the Issue

Government issued an advisory on AI-generated content. All AI-generated content...

Africa Faces Internet Crisis: Extensive Outage Expected to Last for Months, Hardest-Hit Nations Identified

Africa’s Internet Crisis: Massive Outage Could Last Months, These...

FTC Investigates Reddit for AI Content Licensing Practices

FTC is investigating Reddit's plans...

Journalists Criticize AI Hype in Media

Summary Journalists are contributing to the hype and...