Stay organized with collections Save and categorize content based on your preferences.
Create a Memorystore for Redis instance by using the gcloud CLI Note: If you are looking for the Memorystore for Redis Cluster documentation, see Instance provisioning on a VPC network.Learn how to create a new Memorystore for Redis instance, connect to it, and then delete it.
To follow step-by-step guidance for this task directly in the Google Cloud console, click Guide me:
Before you beginIn the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Verify that billing is enabled for your Google Cloud project.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Verify that billing is enabled for your Google Cloud project.
When prompted, choose the project that you selected or created above.
If you already have the Google Cloud CLI installed, update it.
gcloud components update
To create a Memorystore for Redis instance:
Set the project you'd like to create your instance in as the default project in gcloud
by entering the following command:
gcloud config set core/project PROJECT_ID
Enter the following command to create a 2 GiB Basic Tier Redis instance in the us-central1
region:
gcloud redis instances create myinstance --size=2 --region=us-central1 \ --redis-version=redis_6_x
After the instance is created, enter the describe
command to get the IP address and port of the instance:
gcloud redis instances describe myinstance --region=us-central1
If successful, gcloud
returns the following:
authorizedNetwork: projects/my-project/global/networks/default createTime: '2018-04-09T21:47:56.824081Z' currentLocationId: us-central1-a host: 10.0.0.27 locationId: us-central1-a memorySizeGb: 2 name: projects/my-project/locations/us-central1/instances/myinstance networkThroughputGbps: 2 port: 6379 redisVersion: REDIS_6_X reservedIpRange: 10.0.0.24/29 state: READY tier: BASIC
You'll use the host
and port
values to connect to the instance.
You can connect to the Redis instance from any Compute Engine VM that uses the Redis instance's authorized network with a supported RFC 1918 IP address.
If you don't already have a Compute Engine VM that uses that same authorized network as your Redis instance, create one and connect to it by following Quickstart using a Linux VM.
Install telnet
using apt-get
:
sudo apt-get install telnet
From the terminal, telnet to the IP address of the Redis instance, replacing variables with appropriate values.
telnet instance-ip-address 6379
If successful, the command will return this result:
Trying instance-ip-address… Connected to instance-ip-address
In the telnet session, enter some Redis commands:
Enter:
PING
Result:
PONG
Enter
SET HELLO WORLD
Result:
+OK
Enter:
GET HELLO
Result:
$5 WORLD
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
To avoid incurring charges to your Google Cloud account for the resources used in this quickstart, delete the instance by entering the following command:
gcloud redis instances delete myinstance --region=us-central1
Enter Y
to confirm the instance to delete:
You are about to delete instance [myinstance] in [us-central1]. Any associated data will be lost. Do you want to continue (Y/n)? Y Delete request issued for: [myinstance]
If successful, gcloud
returns the following response:
Deleted instance [myinstance].
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4