DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
11 Monitoring and Observability Tools for 2023
Learn more
  1. DZone
  2. Software Design and Architecture
  3. Microservices
  4. Running Redis on Windows 10

Running Redis on Windows 10

Let's take a look at how to run Redis on Windows 10 and how to set up WSL and install and test Redis.

Dave Nielsen user avatar by
Dave Nielsen
·
Aug. 07, 18 · Tutorial
Like (2)
Save
Tweet
Share
46.86K Views

Join the DZone community and get the full member experience.

Join For Free

Ever since Jessica Deen explained how WSL works at my SVDevOps Meetup, I've recommended Windows 10 users run Redis on their own dev machines. Yes, you heard right. Starting with Windows 10 (v1709 - 2017-09, Fall Creators Update ), you can run at least a half-dozen flavors of Linux on the Windows Subsystem for Linux (WSL), and you can run on top of them. No VM required. No Docker. No joke!

How Do I Know If I Have Windows 10 With WSL?

To answer the question, "Which version of Windows is my PC is running?", press your Windows logo key + R, type "winver," then select OK. Starting with version 10, you've got a command called " wslconfig." It lists distros you have and controls which one starts by typing "bash." Try it out!

How to Set Up WSL 

  1. To enable Windows Subsystem for Linux, follow the instructions on Microsoft Docs. The short version is: In Windows 10, Microsoft replaces Command Prompt with PowerShell as the default shell. Open PowerShell as Administrator and run this command to enable Windows Subsystem for Linux (WSL):
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  2. Reboot Windows after making the change-note that you only need to do this one time.
  3. Download and install one of the supported Linux distros from the Microsoft Store.

Install and Test Redis

  1. Launch the installed distro from your Windows Store and then install redis-server. The following example works with Ubuntu (you'll need to wait for initialization and create a login upon first use):
    > sudo apt-get update
    > sudo apt-get upgrade
    > sudo apt-get install redis-server
    > redis-cli -v
  2. Restart the Redis server to make sure it is running:
    > sudo service redis-server restart
  3. Execute a simple Redis command to verify your Redis server is running and available:
    $ redis-cli 
    127.0.0.1:6379> set user:1 "Jane"
    127.0.0.1:6379> get user:1
    "Jane"
  4. To stop your Redis server:
    > sudo service redis-server stop

Further Information

  • How does Linux run within Windows 10? Instead of calling the Linux Kernel, the system calls (syscalls) that these unmodified Linux libraries use are redirected to Windows, which handles the call instead of Linux. For more information about WSL, visit the Windows Subsystem for Linux Documentation on MSDN.
  • How do I access files stored in the Linux environment? If you want to edit Windows files in Windows AND in Linux, then keep your files in /mnt/c/ so you can edit them with either OS. Don't use Windows to "reach into the Linux file system." As Scott Hanselman says on his WSL blog post, "There be dragons!" For further information about the WSL storage, visit Jack Hammon's blog post on MSDN titled " WSL File System Support."
Redis (company) Linux (operating system) File system

Published at DZone with permission of Dave Nielsen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Fargate vs. Lambda: The Battle of the Future
  • What’s New in Flutter 3.7?
  • What Is Continuous Testing?
  • What’s New in the Latest Version of Angular V15?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: