You need a Redis instance to test against right now, not the packaged service: redis-server will start one from the command line in seconds. This guide starts a temporary instance on an explicit loopback port, checks it with redis-cli, and stops it cleanly. The examples use Redis server 7.0.15 from Ubuntu package redis-server 5:7.0.15-1ubuntu0.24.04.4. Allow about fifteen minutes if Redis is already installed. You need a shell, redis-server, and redis-cli.
This guide is for a local test or a deliberate manual launch, not a replacement for the distribution's service configuration. The installed manual page says Debian systems typically start redis-server through /etc/init.d/redis-server, using /etc/redis/redis.conf by default: treat that packaged service path as a separate operational concern.
Start by confirming the binary and version. These are ordinary read-only commands and do not need elevated privileges:
$ command -v redis-server
/usr/bin/redis-server
$ redis-server --version
Redis server v=7.0.15 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=e53ff17674aa6190
The local manpage is dated March 2009 and documents the portable core contract: redis-server accepts a configuration file as its positional argument. The installed binary also offers command-line configuration for testing, including --port, --bind, --daemonize and --pidfile. Check the binary on the host you are actually operating rather than assuming another Redis release has identical options.
Do not begin by binding a test server to every interface. Use loopback and a port you have chosen explicitly instead:
$ TEST_PORT=6399
$ redis-cli -h 127.0.0.1 -p "$TEST_PORT" ping
Could not connect to Redis at 127.0.0.1:6399: Connection refused
Checkpoint: connection refused means nothing is listening on that test port yet. If you get PONG instead, stop and identify the existing process before reusing the port; do not issue write or administrative commands against an unknown Redis instance.
The default port is commonly 6379, but an explicit port stops this test from accidentally targeting a package-managed instance. The loopback bind also keeps the test endpoint off the network, though that is a boundary for the example, not a substitute for Redis authentication and access controls.
Launch the server in the background with a test-only port, loopback binding and no persistence:
$ redis-server --port 6399 --bind 127.0.0.1 \
--save '' --appendonly no \
--daemonize yes --pidfile /tmp/redis-server-guide.pid \
--logfile /tmp/redis-server-guide.log
2487851:C 26 Sep 2026 19:08:36.250 # Redis is starting
2487851:M 26 Sep 2026 19:08:36.251 * Running mode=standalone, port=6399.
2487851:M 26 Sep 2026 19:08:36.251 * Ready to accept connections
The PID and timestamps vary. What matters is that the process reports the requested port and reaches Ready to accept connections. The empty save value and appendonly no make this test disposable, so do not copy those persistence settings into a production configuration unless losing all data on shutdown is genuinely intended.
Warning: starting a Redis server can expose data to clients and can overwrite or load persistence files when configured to do so. Keep this test on loopback, use a dedicated port, and do not point it at a directory containing valuable Redis data. Starting a production instance, changing its bind address, or disabling its persistence requires an approved maintenance procedure and elevated privileges where the service account or configuration requires them.
Ask the matching endpoint for a health response:
$ redis-cli -h 127.0.0.1 -p 6399 ping
PONG
$ redis-cli -h 127.0.0.1 -p 6399 set guide:check ok
OK
$ redis-cli -h 127.0.0.1 -p 6399 get guide:check
"ok"
PONG proves the client reached a Redis server at the address and port you supplied. The SET and GET pair proves a small request and response round trip, but it also changes server state, so use a clearly temporary key and do not run this against a shared or production endpoint. The quoted value is the normal human-readable output from an interactive terminal.
For a quieter script check, use the command's exit status:
$ redis-cli -h 127.0.0.1 -p 6399 ping >/dev/null
$ printf 'redis-cli status: %s\n' "$?"
redis-cli status: 0
Keep the host and port together in scripts: a successful check against 127.0.0.1:6399 says nothing about a different Redis service on 127.0.0.1:6379.
For a real deployment, put the server settings in a configuration file and pass that file as the positional argument:
$ redis-server /path/to/redis.conf
Redis configuration directives are one keyword followed by its arguments. The equivalent command-line form prefixes the keyword with --, convenient for testing but harder to review once the settings grow. Keep the configuration file owned and readable according to the package's service account and local security policy. If it contains a password or ACL secret, do not paste it into a shell command: command arguments can be exposed to other users through process inspection.
When you inherit a configuration, inspect the endpoint and storage choices before starting it. Check the bind address, port, persistence paths, append-only setting, replica settings and authentication policy in particular. A configuration file can make redis-server load existing data or contact another Redis instance, so reading it is not enough on its own to establish that it is safe to run.
Stop the instance through its matching endpoint:
$ redis-cli -h 127.0.0.1 -p 6399 shutdown nosave
OK
The process should exit and the test port should stop accepting connections:
$ redis-cli -h 127.0.0.1 -p 6399 ping
Could not connect to Redis at 127.0.0.1:6399: Connection refused
SHUTDOWN NOSAVE is appropriate for this deliberately non-persistent test. Do not use it against a valuable instance unless you have checked the shutdown and persistence procedure for that service first. If the start command failed, read the log path you supplied:
$ sed -n '1,80p' /tmp/redis-server-guide.log
sudo; elevated privileges do not repair a mismatched endpoint.redis-cli shutdown, or a service manager's stop operation for a package-managed service.redis-cli ping returned PONG from that exact endpoint.