How to resolve (error) ERR unknown command 'service' error in Redis in windows machine?

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company

How to Resolve ERR unknown command 'service' Error in Redis on Windows

As developers working with distributed systems, understanding the nuances of communication between clients and servers is paramount. When setting up services like Redis on a Windows machine, we often encounter confusion between operating system commands and the specific commands recognized by the application itself. The error you are encountering—ERR unknown command 'service'—is a classic example of this mismatch.

This post will walk you through why this error occurs and provide the correct methods for managing your Redis instance on Windows, ensuring your service starts correctly without throwing cryptic errors in the redis-cli.

Understanding the Error: Client vs. Server Commands

The core issue lies in what the redis-cli (the command-line interface) is attempting to execute. The redis-cli communicates directly with the Redis server process running on port 6379. It expects commands that are defined within the Redis protocol (like GET, SET, PING, or configuration commands).

When you run <code class="language-bash">service redis_6379 status</code>, you are not sending a Redis command; you are attempting to execute a Windows operating system service command. The Redis server receives this string, recognizes it as completely invalid within the Redis protocol, and responds with ERR unknown command 'service'.

In essence, your client is trying to use an OS management tool inside a database command interpreter. This highlights a fundamental principle in backend architecture: separating infrastructure management from application logic.

The Correct Way to Manage Redis on Windows

Since you are running Redis as a Windows Service (as indicated by the configuration file path C:\Program Files\Redis\redis.windows-service.conf), managing its lifecycle should be done through the Windows Service Manager or standard command-line utilities, not via the Redis client.

Here is the proper sequence to start and check the status of your Redis service:

Method 1: Using the Windows Services Manager (Recommended)

The most robust way to manage a service installed on Windows is through the built-in system tools.

  1. Press <code class="language-bash">Win + R</code> to open the Run dialog, type <code class="language-bash">services.msc</code>, and press Enter.
  2. Locate your Redis service (it might be named something similar to Redis or based on the installation package).
  3. Right-click the service and select Start to initiate the server, or Stop if necessary.

Method 2: Using Command Prompt/PowerShell

If you prefer command-line management, use standard Windows commands to interact with the service manager:

# To start the Redis service
net start redis_6379

# To check the status of the Redis service
net status redis_6379

These commands communicate directly with the underlying Windows operating system layer, which is exactly what service management requires. This keeps the Redis server itself clean and focused on data operations, allowing your application logic (like those built using frameworks such as Laravel) to focus on business rules rather than infrastructure plumbing.

Conclusion

The error ERR unknown command 'service' is not a bug in your Redis installation but rather a misunderstanding of the scope of commands—the difference between OS-level management and protocol-level database commands. By separating system administration (using net start/services.msc) from data interaction (using redis-cli), you ensure that both your infrastructure and your application layers operate cleanly. Always treat operating system services as external dependencies, separate from the internal command set of your core services. For further insights into robust backend design principles, feel free to explore resources like those found at https://laravelcompany.com.