<\/span><\/h2>\n\n\n\nFirst, log in to your Ubuntu 20.04 server via SSH as the root user:<\/p>\n\n\n\n
ssh root@IP_Address -p Port_number<\/pre>\n\n\n\nYou will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.<\/p>\n\n\n\n
Before starting, you have to make sure that all Ubuntu OS packages installed on the server are up to date. You can do this by running the following commands:<\/p>\n\n\n\n
apt-get update -y\napt-get upgrade -y<\/pre>\n\n\n\n<\/span>Step 2: Install Memcached<\/span><\/h2>\n\n\n\nThe Memcached package is available in the Ubuntu 20.04 default OS repository. You can install it by running the following command:<\/p>\n\n\n\n
apt-get install memcached libmemcached-tools -y<\/pre>\n\n\n\nBy default, the Memcached service will start automatically after installing it in your system. You can verify it with the following command:<\/p>\n\n\n\n
systemctl status memcached<\/pre>\n\n\n\nYou should get the following output:<\/p>\n\n\n\n
\u25cf memcached.service - memcached daemon\n Loaded: loaded (\/lib\/systemd\/system\/memcached.service; enabled; vendor preset>\n Active: active (running) since Fri 2021-01-08 08:25:36 UTC; 12s ago\n Docs: man:memcached(1)\n Main PID: 32022 (memcached)\n Tasks: 10 (limit: 2353)\n Memory: 1.5M\n CGroup: \/system.slice\/memcached.service\n \u2514\u250032022 \/usr\/bin\/memcached -m 64 -p 11211 -u memcache -l 127.0.0.1 -P>\n\nJan 08 08:25:36 ubuntu2004 systemd[1]: Started memcached daemon.\n<\/pre>\n\n\n\nYou can also start and stop the Memcached service using the following command:<\/p>\n\n\n\n
systemctl start memcached\nsystemctl stop memcached<\/pre>\n\n\n\nMemcached listens on port 11211, you can also verify it using the following command:<\/p>\n\n\n\n
ss -antpl | grep 11211<\/pre>\n\n\n\nYou should get the following output:<\/p>\n\n\n\n
LISTEN 0 1024 127.0.0.1:11211 0.0.0.0:* users:((\"memcached\",pid=32022,fd=26)) \n<\/pre>\n\n\n\n