← Back to all services
Caching

Memcached Default Port & Configuration

memcached systemctl: memcached

High-performance distributed memory caching system. Simple key-value store, no persistence.

🔌 Default Ports

11211
tcp
Memcached protocol
11211
udp
Memcached UDP (disabled by default)

📦 Installation Command

apt install memcached libmemcached-tools

⚙️ Configuration Files

  • /etc/memcached.conf

📂 Default Directories

  • config: /etc/memcached.conf
  • data: N/A (memory only)
  • logs: /var/log/memcached.log
  • socket: /var/run/memcached/memcached.sock (if configured)

🔐 Default Credentials

Username:N/A (no auth by default)
Password:N/A (no auth by default)
💡 No built-in authentication! Use SASL: apt install libmemcached-tools sasl2-bin, then configure SASL

📌 Dependencies

libevent-2.1-7

⚠️ Conflicts

N/A Port: N/A (unique port)

✅ Works With

php-memcachedphp-memcachenginxpythonnodejs

🛡️ Security Notes

Bind to localhost ONLY (never expose to internet), disable UDP, use SASL auth if remote access needed, firewall the port

❓ Frequently Asked Questions

What port does Memcached use?
Memcached uses port 11211 by default.
Memcached vs Redis?
Redis offers more features (persistence, data types). Memcached is simpler and faster for basic caching.
How to secure Memcached?
Bind to localhost (-l 127.0.0.1) and use firewall. Memcached has no built-in authentication.