• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Install Memcached on Ubuntu 16.04

{{postValue.id}}

To Install Memcached on Ubuntu 16.04

Memcached is a system daemon that allows you to cache information on RAM memory, this allows you to avoid bad performance on your dedicated or VPS server. It is very useful for optimizing dynamic websites and enabled speed by caching objects in memory. It is so simple to install Memcached on Ubuntu and this article covers the method to install Memcached on Ubuntu 16.04.


Installing Memcached

In order to install Memcached, it is very essential to have Apache installed in your machine, so make sure you run the following to install it in your system.

root@linuxhelp:~# apt-get install apache2 -y 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gnome-software-common libgtkspell3-3-0
Use ' sudo apt autoremove'  to remove them.
The following additional packages will be installed:
  apache2-bin apache2-data apache2-utils libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom
.
.
.
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for ufw (0.35-0ubuntu2) ...


Once Apache is installed, you shall proceed with the installation of memcached in the following manner.

root@linuxhelp:~# apt-get install memcached
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gnome-software-common libgtkspell3-3-0
Use ' sudo apt autoremove'  to remove them.
Suggested packages:
  libcache-memcached-perl libmemcached libanyevent-perl libyaml-perl
  libterm-readkey-perl
The following NEW packages will be installed:
  memcached
0 upgraded, 1 newly installed, 0 to remove and 598 not upgraded.
Need to get 89.0 kB of archives.
After this operation, 246 kB of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 memcached amd64 1.4.25-2ubuntu1.2 [89.0 kB]
Fetched 89.0 kB in 1s (87.3 kB/s)
ySelecting previously unselected package memcached.
(Reading database ... 177856 files and directories currently installed.)
Preparing to unpack .../memcached_1.4.25-2ubuntu1.2_amd64.deb ...
Unpacking memcached (1.4.25-2ubuntu1.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up memcached (1.4.25-2ubuntu1.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...

And then, you should also install the essential PHP modules by making use of the following command.

root@linuxhelp:~#  apt-get install -y php libapache2-mod-php php-memcached php-cli 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gnome-software-common libgtkspell3-3-0
Use ' sudo apt autoremove'  to remove them.
The following additional packages will be installed:
  libapache2-mod-php7.0 libmemcached11 php-common php7.0 php7.0-cli
  php7.0-common php7.0-json php7.0-opcache php7.0-readline
Suggested packages:
  php-pear
The following NEW packages will be installed:
.
.
.
Setting up php-cli (1:7.0+35ubuntu6) ...
Setting up php-memcached (2.2.0-51-ge573a6e+2.2.0-2build2) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...

After that, you need to start the Apache service as follows.

root@linuxhelp:~# systemctl start apache2

And then start memcached by running the following command.

root@linuxhelp:~# systemctl start memcached

You should later create a PHP file in Apache document root location to get php info.

root@linuxhelp:~# nano /var/www/html/info.php
< ?php
phpinfo() 
?> 

Later you need to restart the Apache service.

root@linuxhelp:~# systemctl restart apache2

Once it is done, you shall open the browser and enter http://localhost/info.php as URL. The PHP modules that are installed in server as displayed.

php module

You shall scroll down and see whether the memcached is installed.

memcached
With this, the installation of Memcahed gets completed.

Tags:
jackson
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

what I need to put there in Iptables ? should I need to insert there my vps’ ip address or local ipaddress ?

A

provide your own server IP address

Q

What are the Hardware requirement to install Memcache?

A

system which has minimum 1GB RAM

Q

What is the Repository before installing memcached?

A

wget http://mirrors.kernel.org/fedora-epel/6/x86_64/epel-release-6-7.noarch.rpm
rpm -Uvh epel-release-6-7.noarch.rpm

Q

Where are my resources stored in Linux?

A

The resources are stored in

Linux

$HOME/.local/share/krita/

Q

What is the Essential purpose of it is?

A

Memcached is memory object caching program. It is an open source program which helps to speed up the performance

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Owen ?
How to add SSH key to my Gitlab account

I need to add the SSH key in my gitlab account. How to do so ????

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.