Redis /etc/systemd/redis-server.service

Original 📋 Ubuntu 24.04 LTS (Noble Numbat) 64 lines

Works On

Viewing:
Ubuntu 24.04 LTS (Noble Numbat)
Same on:
Debian 12 (Bookworm) Debian 13 (Trixie)
Other versions:

Details

Size
64 lines
MD5
8e6f8f143d72c57efdfa64f8886dbc5a
SHA256
638211a92bf860f096003559005d7f54d51b16ebd1036d76c408c6ac3e081e8a
/etc/systemd/redis-server.service
[Unit]
Description=Advanced key-value store
After=network.target
Documentation=http://redis.io/documentation, man:redis-server(1)

[Service]
Type=notify
ExecStart=/usr/bin/redis-server /etc/redis/redis.conf --supervised systemd --daemonize no
PIDFile=/run/redis/redis-server.pid
TimeoutStopSec=0
Restart=always
User=redis
Group=redis
RuntimeDirectory=redis
RuntimeDirectoryMode=2755

UMask=007
PrivateTmp=true
LimitNOFILE=65535
PrivateDevices=true
ProtectHome=true
ProtectSystem=strict
ReadWritePaths=-/var/lib/redis
ReadWritePaths=-/var/log/redis
ReadWritePaths=-/var/run/redis

CapabilityBoundingSet=
LockPersonality=true
MemoryDenyWriteExecute=true
NoNewPrivileges=true
PrivateUsers=true
ProtectClock=true
ProtectControlGroups=true
ProtectHostname=true
ProtectKernelLogs=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectProc=invisible
RemoveIPC=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~ @privileged @resources

# redis-server can write to its own config file when in cluster mode so we
# permit writing there by default. If you are not using this feature, it is
# recommended that you remove this line.
ReadWriteDirectories=-/etc/redis

# This restricts this service from executing binaries other than redis-server
# itself. This is really effective at e.g. making it impossible to an
# attacker to spawn a shell on the system, but might be more restrictive
# than desired. If you need to, you can permit the execution of extra
# binaries by adding an extra ExecPaths= directive with the command
# systemctl edit redis-server.service
NoExecPaths=/
ExecPaths=/usr/bin/redis-server /usr/lib /lib

[Install]
WantedBy=multi-user.target
Alias=redis.service

Copy & Paste

curl:
curl https://exampleconfig.com/api/v1/config/original/8e6f8f143d72c57efdfa64f8886dbc5a?hint=redis-server.service
wget:
wget -O redis-server.service https://exampleconfig.com/api/v1/config/original/8e6f8f143d72c57efdfa64f8886dbc5a?hint=redis-server.service

For AI Agents

<prompt><role>DevOps agent</role><source url='https://exampleconfig.com/api/v1/config/original/8e6f8f143d72c57efdfa64f8886dbc5a?hint=redis-server.service' /><config><app>Redis</app><os>Ubuntu 24.04 LTS (Noble Numbat)</os><location>/etc/systemd/redis-server.service</location><lines>64</lines><md5>8e6f8f143d72c57efdfa64f8886dbc5a</md5><sha256>638211a92bf860f096003559005d7f54d51b16ebd1036d76c408c6ac3e081e8a</sha256></config></prompt>

Paste into Claude, ChatGPT, or any AI assistant.

Install Redis

Alpine Linux

sudo apk add redis

Debian

sudo apt update && sudo apt install redis-server

Ubuntu

sudo apt update && sudo apt install redis-server

File Location

File Path
/etc/systemd/redis-server.service
Directory
/etc/systemd/
Significance
System-wide configuration directory
Description
Files in /etc/ contain system-wide configuration settings that affect all users.

FAQ

When should I use this redis-server.service?

Use it to restore a missing default, confirm what shipped, or diff against your current Redis config.

How do I restore Redis defaults?

Download the file, back up the current one in /etc/systemd/redis-server.service, replace it, then reload or restart Redis.

Is redis-server.service safe for production?

It is the vendor default for Ubuntu 24.04 LTS (Noble Numbat). Treat it as a baseline and review security and performance settings before production use.

How does this differ from other OS versions?

Defaults vary by distro and version. This copy matches Ubuntu 24.04 LTS (Noble Numbat).

Can I use this for Redis troubleshooting?

Yes. Diff it against yours to find drift, then restore only the sections you need.