Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know there are other questions on this but I can't find a resolution.

I've installed Memcached on a server running Ubuntu and I'm trying to use it.

I've attempted to start it using:

$ memcached -d -p 11211

I cannot access it using the PHP client from scripts or from Telnet o server 11211

Port 11211 is forwarded from the router.

What do I need to do to get it to work?

Edit: I've since enabled ufw and added the ports to be allowed with no difference made to the result.

share|improve this question
up vote 1 down vote accepted

Check memcached process:

$ ps aux | grep -E "[m]emcached"
hiemye     921  0.0  0.3  44040   868 ?        Ssl  12:31   0:00 memcached -d -p 11211

Check listen address:

$ lsof -np `pgrep memcached`
memcached 921 hiemye   26u  IPv4       4449      0t0    TCP *:11211 (LISTEN)
memcached 921 hiemye   27u  IPv6       4450      0t0    TCP *:11211 (LISTEN)
memcached 921 hiemye   28u  IPv4       4453      0t0    UDP *:11211 
memcached 921 hiemye   29u  IPv6       4454      0t0    UDP *:11211

Add allow ufw rules:

ufw allow in proto tcp from to port 11211 - client ip - server ip
share|improve this answer
It doesn't appear to be on properly. Is it not working because I'm trying to access it over a network rather than from php sat on the same server? – user34542 Dec 8 '10 at 15:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.