{
  "schema_version": 2,
  "id": "operate/oss_and_stack/management/config",
  "title": "Redis configuration",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/management/config/",
  "summary": "Overview of redis.conf, the Redis configuration file",
  "aliases": [
    "/operate/oss_and_stack/management/config-file",
    "/management/config/"
  ],
  "tags": [
    "docs",
    "operate",
    "stack",
    "oss"
  ],
  "last_updated": "2026-09-21T15:59:03+01:00",
  "page_type": "content",
  "content_hash": "2b98959a554a1f08ab30727305d4080f2c1549525c476cb818ccfa88666b8a5f",
  "sections": [
    {
      "id": "content",
      "title": "Content",
      "role": "content",
      "text": "Redis is able to start without a configuration file using a built-in default\nconfiguration, however this setup is only recommended for testing and\ndevelopment purposes.\n\nThe proper way to configure Redis is by providing a Redis configuration file,\nusually called `redis.conf`. For Redis releases 8.0 - 8.8.x in Redis Open Source, there are two configuration files:\n* `redis.conf` - contains the configuration settings for Redis server only.\n* `redis-full.conf` - contains configuration settings for Redis server and all available components: Redis Search, Redis time series, and Redis probabilistic data structures. This file has as its first line `include redis.conf`, which pulls in the Redis server configuration settings at startup. Use `redis-full.conf` when you want to enable all available components. The file contains four `loadmodule` directives, one for each component, and also loads Redis JSON (though JSON has no configuration parameters).\n\nRedis 8.10 and later use only one configuration file: `redis.conf`.\n\nIf you are building Redis from source and choose to build Redis server without the available components, you can use `redis.conf` as your configuration file.\n\nEach configuration file contains a number of directives that have a very simple format:\n\n    keyword argument1 argument2 ... argumentN\n\nThis is an example of a configuration directive:\n\n    replicaof 127.0.0.1 6380\n\nIt is possible to provide strings containing spaces as arguments using\n(double or single) quotes, as in the following example:\n\n    requirepass \"hello world\"\n\nSingle-quoted string can contain characters escaped by backslashes, and\ndouble-quoted strings can additionally include any ASCII symbols encoded using\nbackslashed hexadecimal notation \"\\\\xff\".\n\nThe list of configuration directives, along with comments describing their meaning and intended usage, is available in the self-documented sample files `redis.conf` and, for Redis releases 8.0 - 8.8.x, `redis-full.conf` files shipped with the Redis distributions.\n\n* Configuration files for Redis 8.10: [redis.conf](https://raw.githubusercontent.com/redis/redis/8.10/redis.conf).\n* Configuration files for Redis 8.8: [redis-full.conf](https://raw.githubusercontent.com/redis/redis/8.8/redis-full.conf) and [redis.conf](https://raw.githubusercontent.com/redis/redis/8.8/redis.conf).\n* Configuration files for Redis 8.6: [redis-full.conf](https://raw.githubusercontent.com/redis/redis/8.6/redis-full.conf) and [redis.conf](https://raw.githubusercontent.com/redis/redis/8.6/redis.conf).\n* Configuration files for Redis 8.4: [redis-full.conf](https://raw.githubusercontent.com/redis/redis/8.4/redis-full.conf) and [redis.conf](https://raw.githubusercontent.com/redis/redis/8.4/redis.conf).\n* Configuration files for Redis 8.2: [redis-full.conf](https://raw.githubusercontent.com/redis/redis/8.2/redis-full.conf) and [redis.conf](https://raw.githubusercontent.com/redis/redis/8.2/redis.conf).\n* Configuration files for Redis 8.0: [redis-full.conf](https://raw.githubusercontent.com/redis/redis/8.0/redis-full.conf) and [redis.conf](https://raw.githubusercontent.com/redis/redis/8.0/redis.conf).\n* Configuration file for Redis 7.4: [redis.conf](https://raw.githubusercontent.com/redis/redis/7.4/redis.conf).\n* Configuration file for Redis 7.2: [redis.conf](https://raw.githubusercontent.com/redis/redis/7.2/redis.conf).\n* Configuration file for Redis 7.0: [redis.conf](https://raw.githubusercontent.com/redis/redis/7.0/redis.conf).\n* Configuration file for Redis 6.2: [redis.conf](https://raw.githubusercontent.com/redis/redis/6.2/redis.conf).\n\nPassing arguments using the command line\n---\n\nYou can also pass Redis configuration parameters\nusing the command line directly. This is very useful for testing purposes.\nThe following is an example that starts a new Redis instance using port 6380\nas a replica of the instance running at 127.0.0.1 port 6379.\n\n    ./redis-server --port 6380 --replicaof 127.0.0.1 6379\n\nThe format of the arguments passed using the command line is exactly the same\nas the one used in the redis.conf file, with the exception that the keyword\nis prefixed with `--`.\n\nNote that internally this generates an in-memory temporary config file\n(possibly concatenating the config file passed by the user, if any) where\narguments are translated into the format of redis.conf.\n\nChanging Redis configuration while the server is running\n---\n\nIt is possible to reconfigure Redis on the fly without stopping and restarting\nthe service, or querying the current configuration programmatically using the\nspecial commands [`CONFIG SET`](https://redis.io/docs/latest/commands/config-set) and [`CONFIG GET`](https://redis.io/docs/latest/commands/config-get).\n\nNot all of the configuration directives are supported in this way, but most\nare supported as expected.\nPlease refer to the [`CONFIG SET`](https://redis.io/docs/latest/commands/config-set) and [`CONFIG GET`](https://redis.io/docs/latest/commands/config-get) pages for more information.\n\nNote that modifying the configuration on the fly does not affect the\n`redis.conf` and `redis-full.conf` files, so at the next restart of Redis, the old configuration will\nbe used instead.\n\nMake sure to also modify the configuration files accordingly to the configuration\nyou set using [`CONFIG SET`](https://redis.io/docs/latest/commands/config-set).\nYou can do it manually, or you can use [`CONFIG REWRITE`](https://redis.io/docs/latest/commands/config-rewrite), which will automatically scan your configuration files and update the fields that don't match the current configuration value.\nFields set to the default value are not added.\nComments inside your configuration file are retained.\n\nConfiguring Redis as a cache\n---\n\nIf you plan to use Redis as a cache where every key will have an\nexpire set, you may consider using the following configuration instead\n(assuming a max memory limit of 2 megabytes as an example):\n\n    maxmemory 2mb\n    maxmemory-policy allkeys-lru\n\nIn this configuration there is no need for the application to set a\ntime to live for keys using the [`EXPIRE`](https://redis.io/docs/latest/commands/expire) command (or equivalent) since\nall the keys will be evicted using an approximated LRU algorithm as long\nas we hit the 2 megabyte memory limit.\n\nBasically, in this configuration Redis acts in a similar way to memcached.\nWe have more extensive documentation about using Redis as an LRU cache [here](https://redis.io/docs/latest/develop/reference/eviction)."
    }
  ],
  "examples": []
}
