systemd fails to start redis-server.service with status=1
Failed to start Advanced key-value store.Short answer
Status 1 only says Redis exited at startup. Read the service log for the reason. The two causes the Redis docs confirm are another process already holding port 6379, and a bind line that lists an address the server cannot open, such as ::1 on a host without IPv6.
Fix it fast
1Find out which cause you have
Read the last log lines of the unit. The Redis line just before the exit names the cause.
sudo systemctl status redis-server --no-pager sudo journalctl -u redis-server -n 40 --no-pager2Match what you see, then jump to its fix
What does the error look like?
Failed to start Advanced key-value store.redis-server.service: Control process exited, code=exited status=1
Cause 1 of 2
Another Redis already holds port 6379
1Check
A second instance may run from a Snap package, a manual redis-server, or a leftover process. Redis defaults to port 6379.
sudo ss -ltnp | grep 63792Fix
Stop the other instance, or give this one a different port in redis.conf. Redis does not start when an address is already in use.
# stop the other one (snap example)
sudo snap stop redis
# or change the port in /etc/redis/redis.conf
# port 6380
sudo systemctl restart redis-server3Verify
The service is active and answers.
sudo systemctl is-active redis-server
redis-cli pingConfirmed by raw.githubusercontent.com
Cause 2 of 2
The bind line lists an address this server cannot open
1Check
The sample redis.conf uses bind 127.0.0.1 -::1. A dash before an address means Redis still starts if that address is unavailable. Without the dash, a missing ::1 stops startup.
grep -n '^bind' /etc/redis/redis.conf2Fix
Add the dash in front of the IPv6 address, or remove it from the bind line.
# /etc/redis/redis.conf
bind 127.0.0.1 -::13Verify
Restart the service and confirm it stays up.
sudo systemctl restart redis-server
sudo systemctl is-active redis-serverConfirmed by raw.githubusercontent.com
How do I stop it coming back?
- Run only one Redis per port: choose apt or Snap, not both.
- Keep bind 127.0.0.1 -::1 as the base line when you edit redis.conf.
- After every redis.conf edit, restart the unit and read the journal once.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
Redis warns that vm.overcommit_memory must be enabled
Background saving fails with a fork() error
This is a Linux kernel setting, vm.overcommit_memory, and a container shares the host's kernel.
3 causes, each with a fixServers
systemctl will not start Redis because the unit is masked
Unit redis-server.service is masked
A masked unit is linked to /dev/null, so systemd refuses to start it by any route.
2 causes, each with a fixServers
systemctl fails in WSL: system has not been booted with systemd
System has not been booted with systemd as init system (PID 1). Can't operate.
WSL starts a distribution without systemd unless you turn it on, so systemctl has no init system to talk to.
3 causes, each with a fixServers
dnf cannot install MySQL on Amazon Linux 2023
dnf cannot find a mysql-server package on Amazon Linux 2023
Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.
3 causes, each with a fixServers
Ansible hangs, then times out waiting for the sudo prompt
a playbook using become seems to hang
Ansible ran sudo on the target and never saw the answer it expected.
3 causes, each with a fixServers
Apache on Ubuntu returns 404 Not Found for my site
The requested URL was not found on this server.
On Ubuntu a 404 from Apache usually means the request maps to a path that has no file.
3 causes, each with a fix