{
  "schema_version": 2,
  "id": "operate/oss_and_stack/install/install-stack/apt",
  "title": "Install Redis Open Source on Linux",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack/apt/",
  "summary": "How to install Redis Open Source using APT",
  "tags": [
    "docs",
    "operate",
    "stack",
    "oss"
  ],
  "last_updated": "2026-09-21T15:59:08+01:00",
  "page_type": "content",
  "content_hash": "61d9af5eccdbf238faedc31096fd216749a88255ed50cbd641ab1b949f7a3dc5",
  "sections": [
    {
      "id": "install-redis-open-source-on-ubuntu-or-debian-linux-using-apt",
      "title": "Install Redis Open Source on Ubuntu or Debian Linux using APT",
      "role": "setup",
      "text": "> [!NOTE]\n> If you only need the Redis CLI (`redis-cli`) and not the full Redis Open Source distribution, see [Install redis-cli](https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack/install-redis-cli).\n\nAdd the repository to the APT index, update it, and install Redis Open Source:\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\nThe most recent version of Redis Open Source will be installed, along with the redis-tools package (redis-cli, etc.).\nIf you need to install an earlier version, run the following command to list the available versions:\n\n\napt policy redis\n\nredis:\n  Installed: (none)\n  Candidate: 6:8.6.1-1rl1~noble1\n  Version table:\n     6:8.6.1-1rl1~noble1 500\n        500 https://packages.redis.io/deb noble/main amd64 Packages\n        500 https://packages.redis.io/deb noble/main all Packages\n     6:8.6.0-1rl1~noble1 500\n        500 https://packages.redis.io/deb noble/main amd64 Packages\n        500 https://packages.redis.io/deb noble/main all Packages\n     ...\n     6:8.0.0-1rl1~noble1 500\n        500 https://packages.redis.io/deb noble/main amd64 Packages\n        500 https://packages.redis.io/deb noble/main all Packages\n     6:7.4.8-1rl1~noble1 500\n        500 https://packages.redis.io/deb noble/main amd64 Packages\n        500 https://packages.redis.io/deb noble/main all Packages\n\n\nFor example, to install Redis Open Source v7.4.8 on Ubuntu LTS 24.04 (Noble Numbat), run the following command:\n\n\nsudo apt-get install \\\nredis=6:7.4.8-1rl1~noble1 \\\nredis-server=6:7.4.8-1rl1~noble1 \\\nredis-sentinel=6:7.4.8-1rl1~noble1 \\\nredis-tools=6:7.4.8-1rl1~noble1\n\n\nAlternatively, you can also set up a preferences file to pin a particular release:\n\n\nPackage: redis redis-server redis-sentinel redis-tools\nPin: version 6:7.4.*\nPin-Priority: 1001\n\n\nSee [this document](https://manpages.debian.org/buster/apt/apt_preferences.5.en.html#How_APT_Interprets_Priorities) for more information on `Pin-Priority`.\n\nWith the example preferences file give above, `6:7.4.8-1rl1~noble1` is the latest version that matches the pinned version and it will be installed when you run this command:\n\n\nsudo apt-get install redis-server redis-sentinel redis-tools\n\n\nRedis should start automatically after the initial installation and also at boot time.\nShould that not be the case on your system, run the following commands:\n\n\nsudo systemctl enable redis-server\nsudo systemctl start redis-server"
    }
  ],
  "examples": []
}
