top of page

LBSocial

OpenClaw + VS Code SSH: Manage Your Google Cloud VM in VS Code

Managing an AI agent framework directly through a Linux command line can become cumbersome as your project scales. In this tutorial, we will show you how to set up an OpenClaw VS Code SSH connection to securely manage your Virtual Machine (VM) running on Google Cloud. This setup makes file management much easier, allowing you to visually browse memories, edit skills, check credentials, and launch your OpenClaw Mission Control dashboard directly in your local browser.


OpenClaw + VS Code SSH: Manage Your Google Cloud VM in VS Code



Building Your OpenClaw VS Code SSH Foundation


If you have been following our previous tutorials, you know how powerful OpenClaw can be. We've previously covered how to use OpenClaw + Google Cloud: Build a 24/7 Personal AI Assistant, and even how to integrate it with OpenClaw + GitHub: Building a Real AI Teammate.


However, as you add more capabilities—such as when we set up the OpenClaw + Google Workspace CLI: Build an AI Agent for Gmail, Docs, and Classroom—managing these complex configurations via the standard command line becomes tricky. By connecting VS Code to your Google Cloud VM, you can control your AI agent with a robust, visual IDE.


Diagram showing Gemini AI between VS Code and OpenClaw Dashboard on Google Cloud. Includes "SSH Connect" and "Manage & Visualize" steps.
Architecture diagram illustrating how VS Code connects via SSH to the OpenClaw VM on Google Cloud for seamless file management and dashboard visualization.

Step 1: Local Environment Setup (Google Cloud CLI)


First, you need to install the Google Cloud CLI (gcloud) on your local computer. You can find the official installation guide here: Install the Google Cloud CLI.


Note that this is different from the Google Workspace CLI. The Workspace CLI controls your Google Workspace apps like Gmail and Calendar, while the Google Cloud CLI is used to control the infrastructure and projects on your Google Cloud account.



Once installed, we need to authorize your local machine, specify which project to manage, and check our running VMs. Open your local terminal and run the following commands:


# Authorize your local gcloud CLI
gcloud auth login

# Check your authorization
gcloud auth list

# List your projects to find the one hosting your VM
gcloud projects list

# Set your active project (Replace with your actual project ID)
gcloud config set project <YOUR_PROJECT_ID>

# Set your compute zone
gcloud config set compute/zone us-central1-a

# List instances to verify your VM is running
gcloud compute instances list

Step 2: Configuring SSH and VS Code


With the gcloud CLI authenticated and pointing to our project, we can now test the connection and export the SSH configurations for VS Code to use.

Run the following in your terminal:


# Test the SSH connection via gcloud (Replace with your VM name)
gcloud compute ssh <YOUR_USER_NAME>@<YOUR_VM_NAME>

# Export the SSH configuration to your local machine
gcloud compute config-ssh

Next, set up VS Code:

  1. Install VS Code on your local computer.

  2. Go to the extensions tab, search for "SSH", and install the "Remote - SSH" extension.

  3. Open your newly generated SSH configuration file.

  4. Important: The default username might be set to your local Windows username. You must change this to your Google Cloud account username so VS Code connects correctly.


Visual Studio Code window showing an SSH config file. Includes settings for remote connection to Google Compute Engine. Text and comments visible.
Configuring the Remote - SSH extension in VS Code by editing the local SSH configuration file to point to the Google Cloud VM.

Once saved, use the Remote SSH extension to connect to your VM using the generated key. You are now able to read and change files directly in VS Code.




Step 3: Managing OpenClaw Skills and Files


Now that you are connected, managing your agent's files is a breeze. Navigate to the .openclaw folder and open the workspace directory.


Here, you can visually browse all your agents' memories, tools, and configurations. For example, if you want to modify the data analytics capabilities we built in our OpenClaw Skills: Guiding AI Agents for Data Analytics tutorial, you can just click on the skill file and edit it exactly like a local file. You can also review your agent's .md files, identity "soul", and provided tools.


Visual Studio Code showing a file named SKILL.md open with text "Autonomous Data Scientist Skill." Terminal displays "Gateway online."
The VS Code Explorer sidebar allows you to easily navigate your OpenClaw VM's file structure, including memories, skills, and credentials.

Step 4: Launching and Monitoring the Dashboard


One of the biggest advantages of this setup is VS Code's integrated terminal and built-in port forwarding. Opening the dashboard provides a powerful graphical user interface for controlling your OpenClaw setup.


  1. Open a new terminal in VS Code to run commands directly on the VM.

  2. Check for updates by running openclaw update.

  3. Launch your web interface by running the OpenClaw dashboard.


openclaw update
openclaw dashboard

This command will output a URL with a secure token. Because VS Code automatically forwards the active ports from the remote VM to your local machine, you can copy and paste that URL directly into your local Chrome browser. Remember: do not share this token URL with anyone!


Web interface displaying "OpenClaw Skills" with options to filter and manage installed skills. Tabs and toggle switches are visible.
The OpenClaw Mission Control Dashboard is securely accessed via a local browser through VS Code port forwarding.

Through this graphic interface, you can effortlessly check the status of your OpenClaw VM and review:


  • Your Telegram channel connections and active sessions.

  • Token usage and costs; for example, using Gemini 3.1 Pro, processing over 300 messages in a month costs less than $20.

  • Detailed analytics show that OpenClaw spends a large number of tokens on input because it constantly searches the conversation content.

  • Any currently scheduled jobs.


Connecting VS Code to your Google Cloud VM provides a stronger foundation for managing skills, credentials, and live sessions as your OpenClaw setup becomes more advanced.




Comments


bottom of page