DEV Community

Cover image for Installing Memcached on Windows 2020

Installing Memcached on Windows 2020

Jorge Castro
You are free to believe in whatever you want to, me too. So, stop preaching your religion, politics, or belief. Do you have facts? Then I will listen. Do you have a personal belief? Sorry but no.
Originally published at ・2 min read

Memcached is a neat program that allows us to keep information on memory.

What we need?

Memcached (It has the version 1.66)

NSSM - the Non-Sucking Service Manager (it is to install it as a service)


Uncompress the Memcached file in any folder.

Copy nssm.exe in the same folder.

And runs the next command line:

@echo off
echo removing the service (if it is already installed)
nssm remove memcached166 
echo and installing the service
nssm install memcached166 memcached.exe
Enter fullscreen mode Exit fullscreen mode

It will install the service with the name "memcached166" (you can change the name).

You could also edit the service as

nssm edit memcached166
Enter fullscreen mode Exit fullscreen mode

Alt Text

For example, you can change the service account, if it is initiated as a startup service and such.

If the service is not installed, then you can start it as

net start memcached166
Enter fullscreen mode Exit fullscreen mode


By default, memcached uses the port 11211

More configuration

It is the configuration of Memcached.

I tried to install it as a service using -d but it failed. However, it is possible to runs as service without -d

By default, it uses 64mb of ram. It could sound a little but it could help a lot. Memcached it is not mean to load "tons" of information, especially because the memory is volatile. But you can change it. If you already installed it as a service, then remember that you can edit the service (using nssm)

-p, --port=<num>          TCP port to listen on (default: 11211)
-U, --udp-port=<num>      UDP port to listen on (default: 0, off)
-s, --unix-socket=<file>  UNIX socket to listen on (disables network support)
-a, --unix-mask=<mask>    access mask for UNIX socket, in octal (default: 700)
-A, --enable-shutdown     enable ascii "shutdown" command
-l, --listen=<addr>       interface to listen on (default: INADDR_ANY)
                          if TLS/SSL is enabled, 'notls' prefix can be used to
                          disable for specific listeners (-l notls:<ip>:<port>)
-d, --daemon              run as a daemon
-m, --memory-limit=<num>  item memory in megabytes (default: 64)
-M, --disable-evictions   return error on memory exhausted instead of evicting
-c, --conn-limit=<num>    max simultaneous connections (default: 1024)
Enter fullscreen mode Exit fullscreen mode

Discussion (0)

Forem Open with the Forem app