How to Get Google Cloud Code Running Locally

Avatar
Lisa Ernst · 28.01.2026 · Technology · 9 min

Developing cloud-native applications with Google Cloud Code can significantly streamline your workflow. As someone deeply involved in cloud-first strategies, I have observed the common challenges developers face when transitioning between local environments and cloud deployments. The drive for efficiency and seamless integration often leads us to seek tools that can bridge this gap. Google Cloud Code stands out as a powerful solution, designed to bring the cloud development experience directly into your integrated development environment (IDE).

Cloud Code is a comprehensive extension that integrates Google Cloud services like Google Kubernetes Engine (GKE) and Cloud Run directly into your IDE. This integration allows you to build, run, and debug cloud-native applications within your familiar development environment, effectively eliminating the need for constant context switching. It supports the entire development lifecycle, from initial creation to ongoing monitoring, providing continuous feedback at every stage. Cloud Code is available for VS Code, IntelliJ, and is integrated by default into the Cloud Shell Editor.

Quick Summary: What Cloud Code Offers

Cloud Code Functionality

Cloud Code provides a wide array of features designed to accelerate the development of cloud-native applications. It integrates with the Google Cloud SDK for streamlined authentication and includes executable examples and pre-configured snippets to help you jumpstart projects. While primarily optimized for Google Cloud, it is flexible enough to function with any cloud platform.

The extension simplifies the creation of Google Cloud clusters and enhances the integration of essential tools such as Cloud Source Repositories, Cloud Build, and Cloud Client Libraries. For developers working with Kubernetes, Cloud Code supports standard command-line container tools like Minikube and kubectl. It enables the creation and execution of new GKE applications and the modification of existing YAML files. Moreover, Skaffold’s module support allows for independent development and debugging of individual GKE application components.

Cloud Code also streamlines the development workflow for Cloud Run services, making it easier to create, deploy, and monitor them. A significant advantage is the ability to build and debug these services locally using the integrated Cloud Run emulator, which can save considerable deployment time. The extension further assists in migrating Linux applications to containers through integrated container-diff functionality and supports building production-ready container images directly from source code using Google Cloud Buildpacks—all without requiring a Dockerfile.

Managing sensitive data becomes straightforward with Cloud Code’s integrated Secret Manager support. Through a dedicated Secret Manager view, you can securely create, view, and update sensitive information like API keys and passwords. The extension also includes an API Library Browser for discovering and activating various Cloud APIs, alongside built-in tools for managing Compute Engine VMs and developing Apigee API proxies.

Google Cloud Secret Manager UI element. This image features an illustration of Google Cloud Secret Manager, a service for securely storing and managing sensitive data. It shows a user interface with options to create, view, and update secrets, emphasizing its role in safeguarding API keys, passwords, and other credentials.

Source: sethvargo.com

Cloud Code’s Secret Manager interface provides secure, centralized management of sensitive data like API keys and credentials, directly within your IDE.

AI-Powered Assistance

Cloud Code integrates advanced AI-powered programming capabilities through Gemini Code Assist Standard and Enterprise. These intelligent tools are designed to help you generate code and resolve issues more efficiently, significantly streamlining the development process. It is important to note that Gemini Code Assist is a separate plugin from Cloud Code and requires a connection to Google Cloud, along with the activation of specific IAM permissions, to function properly.

Gemini Code Assist generating code example. This image displays a prompt input interface for Gemini Code Assist, where a user might enter a request for code generation or problem-solving. The interface shows example code being generated based on the user’s input, highlighting the AI’s ability to assist with coding tasks.

Source: datacamp.com

Gemini Code Assist provides AI-powered code generation and problem-solving capabilities directly within your development environment, enhancing productivity.

Cloud Code in the Cloud Shell Editor

The Cloud Shell Editor, an online development and operating environment accessible directly through your browser, offers a pre-configured setting specifically optimized for Cloud Code. This environment comes with pre-installed utilities such as the gcloud command-line tool and kubectl, making it ideal for developing, building, debugging, and deploying cloud-based applications without additional setup.

Cloud Shell Terminal

Cloud Shell provides two primary tools: the Cloud Shell Terminal and the Cloud Shell Editor. The terminal offers a full-featured, cloud-based shell running on a session-specific, Debian-based Linux machine. It includes the Google Cloud SDK and essential developer tools like git, kubectl, kubectx, curl, python3, and tmux. Your $HOME directory in Cloud Shell persists across sessions, as it is stored in Cloud Storage. You can launch Cloud Shell conveniently via console.cloud.google.com, where your GCP project ID is automatically detected. Cloud Shell supports multiple tabs and windows, and its integrated tmux ensures session persistence. Additionally, automatic port forwarding is available through the Web Preview feature, simplifying access to running applications.

Cloud Shell Editor

The Cloud Shell Editor is built on the open-source Eclipse Theia project, offering a user experience similar to VS Code. You can access it via the command line (cloudshell edit), through the Cloud Shell menu, or directly by navigating to the URL ide.cloud.google.com. The editor features an integrated terminal and allows for extensive customization of its settings. For advanced use cases, you can create custom Cloud Shell container images to provision a completely session-specific instance with additional packages, defining these images using a Dockerfile. These custom images can be built locally, tested, and then pushed to a Cloud Source Repository and Container Registry. For even greater flexibility, remote SSH access to Cloud Shell is possible from your local machine, and your base directory can be locally mounted.

Developing with Cloud Code Locally

Cloud Code is designed to support various local development environments. It allows you to integrate clusters from other cloud providers into your KubeConfig and works seamlessly with Docker Desktop for local clusters. For proper functioning, your standard ~/.kube/config file must include the local cluster, which also needs to be set as the current context.

Local Application Creation and Deployment

When creating an application from a template in Cloud Code, you will select the application type (e.g., Kubernetes application) and your preferred programming language. Example applications typically follow a similar structure, with configurations stored in .vscode and Pod specifications in kubernetes-manifests. It is crucial to use a non-production cluster for development and testing purposes. Before execution, ensure the Kubernetes context is correctly set. The Cloud Code: Develop on Kubernetes execution configuration offers options for customizing your deployment.

Minikube Integration

Cloud Code provides robust integration with Minikube. You can easily start Minikube clusters, run your applications on them, and review deployment details within the development sessions. Port-forward URLs enable convenient browser access to your running application. For interactive debugging, an interactive terminal can be opened directly within a container via the Development Sessions explorer. Minikube clusters can also be paused or stopped as needed.

Debugging and Logging

Debugging is a core feature of Cloud Code, allowing you to set breakpoints in your code to control debugging sessions effectively. Real-time logging from running Pods is available, displayed either in the terminal output or through the Kubernetes Explorer, providing immediate insights into your application’s behavior. To avoid incurring unnecessary costs, remember to delete resources in the Google Cloud Console once your development or testing is complete.

Cloud Functions Development

For developing Cloud Functions, the Functions Framework can be installed and run locally. You can download the source code of a deployed function from Google Cloud and install local dependencies within the function’s local folder. The Functions Framework runs using commands like npx functions-framework --target=entryPoint for Node.js or functions-framework --target=entryPoint for Python. The entryPoint for your function can be found in the launch.json file.

Cloud Run Services Local Testing

Cloud Run services can also be tested locally using Docker or Docker with Google Cloud Access. The PORT environment variable is used to specify the port through which your application receives HTTP/HTTPS requests. When running locally with Docker, a service account with a key pair is necessary because the default service account is unavailable in this context. Google Cloud Client Libraries can be configured to authenticate with Google Cloud services within your local container. The gcloud beta code dev command-line tool provides a convenient way to emulate Cloud Run, building containers from source and automatically rebuilding them upon changes.

Frequently Asked Questions about Cloud Code Local Development

Here are some common questions and answers regarding local development with Google Cloud Code:

  1. What IDEs does Cloud Code support?

    Cloud Code is available for VS Code, IntelliJ, and is integrated by default into the Cloud Shell Editor.

  2. Can I use Cloud Code with other cloud providers?

    While optimized for Google Cloud, Cloud Code can function with any cloud platform. It supports adding clusters from other providers to your KubeConfig.

  3. Do I need Docker for local Cloud Run development?

    Yes, Cloud Run services can be tested locally with Docker or Docker with Google Cloud Access. You might need a service account with a key pair for authentication.

  4. How do I debug applications running in Kubernetes with Cloud Code?

    Cloud Code allows you to set breakpoints in your code and view real-time logs from running Pods directly in your IDE or through the Kubernetes Explorer.

  5. Is Gemini Code Assist automatically enabled with Cloud Code?

    No, Gemini Code Assist is a separate plugin that requires a connection to Google Cloud and activation of IAM permissions to function.

Conclusion

Google Cloud Code significantly streamlines the process of developing cloud-native applications within an IDE. By seamlessly integrating Google Cloud services, offering AI-powered assistance, and providing robust local development and debugging capabilities, it aims to enhance developer productivity and reduce the friction often associated with cloud deployments. Embracing Cloud Code can lead to a more efficient and enjoyable development experience, allowing you to focus more on innovation and less on environmental complexities.

Source: YouTube

Share our post!
Quellen