{
  "schema_version": 2,
  "id": "operate/oss_and_stack/install/archive/install-redis/install-redis-on-linux",
  "title": "Install Redis on Linux",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/install/archive/install-redis/install-redis-on-linux/",
  "summary": "How to install Redis on Linux",
  "aliases": [
    "/operate/oss_and_stack/install/install-redis/install-redis-on-linux",
    "/getting-started/installation/install-redis-on-linux/"
  ],
  "tags": [
    "docs",
    "operate",
    "stack",
    "oss"
  ],
  "last_updated": "2026-09-30T13:16:11-07:00",
  "page_type": "content",
  "content_hash": "4f69449c92f6bfc81e6e965c85ea5a44f2d74830dfcbc416a2e2a343ef5a4e26",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Most major Linux distributions provide packages for Redis."
    },
    {
      "id": "install-on-ubuntudebian",
      "title": "Install on Ubuntu/Debian",
      "role": "setup",
      "text": "Add the repository to the APT index, update it, and install Redis:\n\n\nsudo apt-get install lsb-release curl gpg\ncurl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg\nsudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg\necho \"deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main\" | sudo tee /etc/apt/sources.list.d/redis.list\nsudo apt-get update\nsudo apt-get install redis\n\n\nRedis will start automatically, and it should restart at boot time. If Redis doesn't start across reboots, you may need to manually enable it:\n\n\nsudo systemctl enable redis-server\nsudo systemctl start redis-server"
    },
    {
      "id": "install-on-red-hatrocky",
      "title": "Install on Red Hat/Rocky",
      "role": "setup",
      "text": "sudo yum install redis\nsudo systemctl enable redis\nsudo systemctl start redis\n\n\nRedis will restart at boot time."
    },
    {
      "id": "install-on-ubuntu-using-snap",
      "title": "Install on Ubuntu using Snap",
      "role": "setup",
      "text": "To install via Snap, run:\n\n\nsudo apt update\nsudo apt install redis-tools # for redis-cli\nsudo snap install redis\n\n\nRedis will start automatically, but it won't restart at boot time. To do this, run:\n\n\nsudo snap set redis service.start=true\n\n\nYou can use these additional snap-related commands to start, stop, restart, and check the status of Redis:\n\n* `sudo snap start redis`\n* `sudo snap stop redis`\n* `sudo snap restart redis`\n* `sudo snap services redis`\n\nIf your Linux distribution does not currently have Snap installed, you can install it using the instructions described  [here](https://snapcraft.io/docs/installing-snapd). Then, consult the [Snapcraft store](https://snapcraft.io/redis) for instructions on installing Redis using Snap for your distribution."
    },
    {
      "id": "starting-and-stopping-redis-in-the-background",
      "title": "Starting and stopping Redis in the background",
      "role": "content",
      "text": "You can start the Redis server as a background process using the `systemctl` command. This only applies to Ubuntu/Debian when installed using `apt`, and Red Hat/Rocky when installed using `yum`.\n\n\nsudo systemctl start <redis-service-name> # redis or redis-server depending on platform\n\n\nTo stop the server, use:\n\n\nsudo systemctl stop <redis-service-name> # redis or redis-server depending on platform"
    },
    {
      "id": "connect-to-redis",
      "title": "Connect to Redis",
      "role": "content",
      "text": "Once Redis is running, you can test it by running `redis-cli`:\n\n\nredis-cli\n\n\nTest the connection with the `ping` command:\n\n\n127.0.0.1:6379> ping\nPONG\n\n\nYou can also test that your Redis server is running using\n[Redis Insight](https://redis.io/docs/latest/develop/tools/insight)."
    },
    {
      "id": "next-steps",
      "title": "Next steps",
      "role": "content",
      "text": "Once you have a running Redis instance, you may want to:\n\n* Try the [Redis CLI tutorial](https://redis.io/docs/latest/develop/tools/cli)\n* Connect using one of the [Redis clients](https://redis.io/docs/latest/develop/clients)\n* [Install Redis \"properly\"](https://redis.io/docs/latest/operate/oss_and_stack/install/archive/install-redis#install-redis-properly)\n  for production use."
    }
  ],
  "examples": []
}
