How to connect to Redis by Unix socket only

10 May 2017

To disable the ability to connect to Redis-server via TCP, it is necessary in the configuration file redis.conf to set the value:

port 0

Also, you need to set to allow connection via unix socket:

unixsocket /tmp/redis.sock
unixsocketperm 755

And restart your Redis server.