How to Secure Memcached server From UDP Attacks

by Sandeep B.

In this tutorial we’ll secure Memcached server from UDP attacks which are common now a days, if you’re not using firewall and the memcached port is closed for the world you’re safe from this attacks.

If your Memcached server is only used by your local server then add the below line which will disable UDP  and only listen to localhost IP, which will prevent your server from being exposed on the internet by disabling the UDP protocol. UDP Protocol is now old technology which is not required anymore. TCP is more secure and today all are using it with Memcached.

Edit memcached config file :

nano /etc/sysconfig/memcached

Add this line -l -U 0 under OPTIONS=”” quotes like :

OPTIONS="-l -U 0"

** at the end it will look like this :

OPTIONS="-l -U 0"

If your Memcached server is binding with ip, add the following OPTIONS line, which will only disable the UDP protocol:


After that you need to restart the memcached server  and done.

service memcached restart

If this post helps you in any way please consider a donation

Donate with PayPal :


You may also like

1 comment

Surjo April 25, 2021 - 4:59 pm

How to Install it on Ubuntu Hestiacp? please help


Leave a Comment