{"id":1799,"date":"2024-10-10T15:07:51","date_gmt":"2024-10-10T09:37:51","guid":{"rendered":"https:\/\/geekpython.in\/?p=1799"},"modified":"2024-10-10T15:28:30","modified_gmt":"2024-10-10T09:58:30","slug":"install-redis-on-windows","status":"publish","type":"post","link":"https:\/\/geekpython.in\/install-redis-on-windows","title":{"rendered":"How To Install Redis on Windows Successfully?"},"content":{"rendered":"\n<p>Redis is an in-memory database that actually makes it the fastest among all the databases.<\/p>\n\n\n\n<p>What does <strong>&#8220;in-memory&#8221;<\/strong> mean? It means that it stores the data in temporary memory or RAM, in the form of key-value pairs. This makes it perfect for serving results instantly.<\/p>\n\n\n\n<p>In this article, you\u2019ll learn how to install Redis locally on Windows without any hassle.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Installation Process Begins<\/h1>\n\n\n\n<p>You probably don\u2019t know that Redis isn\u2019t officially available for Windows yet, but there is a way that you can install <strong>Redis locally on Windows<\/strong> and get started with it.<\/p>\n\n\n\n<p>Redis is available for MacOS, Linux but for Windows, they say:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Redis is not officially supported on Windows. However, you can install Redis on Windows for development.<\/p>\n<\/blockquote>\n\n\n\n<p><strong>So, how to install it then?<\/strong> Simple, actually not simple in my opinion but I will guide you step by step installing Redis on your Windows machine.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enable WSL on Windows<\/h2>\n\n\n\n<p>To install Redis on Windows, you need to enable <strong>WSL<\/strong> (Windows Subsystem for Linux). It simply means that you need to install Linux on your Windows system.<\/p>\n\n\n\n<p><strong>To enable WSL, you must be running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11.<\/strong><\/p>\n\n\n\n<p>You can enable the <strong>WSL2<\/strong> (WSL version 2) by default with a single command.<\/p>\n\n\n\n<p>Open Powershell in administrator mode and run the following command.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:ps decode:true \" >wsl --install<\/pre><\/div>\n\n\n\n<p>This command will enable the features necessary to run WSL and install the Ubuntu distribution of Linux.<\/p>\n\n\n\n<p>You can change or install another distribution of Linux if you want to, just use the following command.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:ps decode:true \" >wsl --install -d &lt;Distribution Name&gt;<\/pre><\/div>\n\n\n\n<p>You can replace &lt;Distribution Name&gt; with the actual Linux distribution you want to install on the Windows machine. But, I would recommend keeping the default settings.<\/p>\n\n\n\n<p>After all this installation process, restart your Windows machine once to see the changes.<\/p>\n\n\n\n<p>If your Windows machine is a bit older and WSL2 is not supported then <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/wsl\/install-manual\">check out this guide<\/a> from Microsoft itself to <strong>manually enable WSL on Windows<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting Error<\/h2>\n\n\n\n<p>There will be less chance that you will get errors while setting up WSL but in case you encounter any error such as \u201c<strong>failed to register wsl distribution<\/strong>\u201d or something like that then <strong>consider changing the WSL version<\/strong>.<\/p>\n\n\n\n<p>Run the following command in Powershell in administrator mode to change the version of your WSL.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:ps decode:true \" >wsl --set-default-version 1<\/pre><\/div>\n\n\n\n<p>This command will <strong>change the default version<\/strong> which is WSL2 to WSL1. This will solve most of the problems.<\/p>\n\n\n\n<p>Now, restart your Windows machine again to see the effect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Set Up Linux<\/h2>\n\n\n\n<p>After enabling WSL and installing Linux distribution, you need to set up user info for Linux.<\/p>\n\n\n\n<p>Open Ubuntu or whichever distribution you installed and give it a few minutes to install. After that, it will ask you to enter a username for Linux and set a password.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"829\" height=\"102\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image.png\" alt=\"Creating Linux user account\" class=\"wp-image-1800\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image.png 829w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-300x37.png 300w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-768x94.png 768w\" sizes=\"auto, (max-width: 829px) 100vw, 829px\" \/><\/figure>\n\n\n\n<p>After setting up the Linux distribution, the next step is to install Redis.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Redis on Windows<\/h2>\n\n\n\n<p>Redis can be installed on Windows using the following commands<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:zsh decode:true \" >curl -fsSL https:\/\/packages.redis.io\/gpg | sudo gpg --dearmor -o \/usr\/share\/keyrings\/redis-archive-keyring.gpg\n\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\n\nsudo apt-get update\nsudo apt-get install redis<\/pre><\/div>\n\n\n\n<p>Copy the above commands all together and paste them into the Ubuntu terminal, this will start the process of installing Redis on Windows locally.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1348\" height=\"85\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-1.png\" alt=\"Collecting Redis package\" class=\"wp-image-1801\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-1.png 1348w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-1-300x19.png 300w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-1-1024x65.png 1024w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-1-768x48.png 768w\" sizes=\"auto, (max-width: 1348px) 100vw, 1348px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"712\" height=\"181\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-2.png\" alt=\"Collecting Redis package\" class=\"wp-image-1802\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-2.png 712w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-2-300x76.png 300w\" sizes=\"auto, (max-width: 712px) 100vw, 712px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"791\" height=\"547\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-3.png\" alt=\"Updating\" class=\"wp-image-1803\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-3.png 791w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-3-300x207.png 300w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-3-768x531.png 768w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"864\" height=\"565\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-4.png\" alt=\"Installing Redis\" class=\"wp-image-1804\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-4.png 864w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-4-300x196.png 300w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-4-768x502.png 768w\" sizes=\"auto, (max-width: 864px) 100vw, 864px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Start Redis<\/h2>\n\n\n\n<p>Now run the following command to start the Redis server.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:zsh decode:true \" >sudo service redis-server start<\/pre><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"714\" height=\"35\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-5.png\" alt=\"Redis server\" class=\"wp-image-1805\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-5.png 714w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-5-300x15.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><\/figure>\n\n\n\n<p>Now to check if you\u2019re connected to Redis, run the following command.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:zsh decode:true \" >redis-cli<\/pre><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"38\" src=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-6.png\" alt=\"Redis CLI\" class=\"wp-image-1806\" srcset=\"https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-6.png 731w, https:\/\/geekpython.in\/wp-content\/uploads\/2024\/10\/image-6-300x16.png 300w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/figure>\n\n\n\n<p>Redis server started on <strong>localhost<\/strong> and listening on <strong>port 6379<\/strong> which is its default port.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>That\u2019s all for now.<\/strong><\/p>\n\n\n\n<p><strong>Keep Coding\u270c\u270c<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Redis is an in-memory database that actually makes it the fastest among all the databases. What does &#8220;in-memory&#8221; mean? It means that it stores the data in temporary memory or RAM, in the form of key-value pairs. This makes it perfect for serving results instantly. In this article, you\u2019ll learn how to install Redis locally [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1807,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[37],"tags":[38],"class_list":["post-1799","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","tag-database","entry","has-media"],"_links":{"self":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/1799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/comments?post=1799"}],"version-history":[{"count":1,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/1799\/revisions"}],"predecessor-version":[{"id":1808,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/1799\/revisions\/1808"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/media\/1807"}],"wp:attachment":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/media?parent=1799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/categories?post=1799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/tags?post=1799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}