Skip to content
Runbook

Install Memcached on macOS

High-performance, distributed in-memory cache for key-value data.

Cachecachein-memorykey-valuedistributed

Installation

Memcached (Homebrew) · Homebrew
brew install memcached

Installs the memcached server.

Verify the installation

Verify
memcached -V

Service

Start
brew services start memcached
Stop
brew services stop memcached
Status
brew services info memcached
Restart
brew services restart memcached

Default ports

11211

Command-line tools

  • memcachedThe cache server; options like -m (memory) and -l (listen address) are passed as flags.

Uninstall

Uninstall
brew services stop memcached
brew uninstall memcached

Good to know

  • Homebrew's Memcached binds to 127.0.0.1:11211 by default; never expose it on a public interface (it has no authentication).
  • Tune the cache size with the -m flag (megabytes); edit the brew service plist or run memcached manually for custom flags.
  • Test connectivity with: printf 'stats\r\nquit\r\n' | nc localhost 11211.

Installation with Homebrew

brew install memcached installs the server. Start it as a background service with brew services start memcached, which listens on 127.0.0.1:11211. Verify the binary with memcached -V.

Configuration

Homebrew runs Memcached with default flags. To change the memory limit or listen address, run it manually — for example memcached -m 256 -l 127.0.0.1 — or edit the service plist. Memcached has no configuration file; everything is set via command-line flags.

Security

Memcached has no authentication and must never be reachable from untrusted networks (it has historically been abused for UDP amplification attacks). Keep it bound to 127.0.0.1, and disable UDP with -U 0 if you only need TCP.