This article covers installing, and customizing an Amazon EC2 instance with Gemini CLI and the ADK agent platform tools to simplify working with a Cross Cloud environment.
What is Gemini CLI?
The Gemini CLI is an open-source, terminal-based AI agent from Google that allows developers to interact directly with Gemini models, such as Gemini 2.5 Pro, for coding, content creation, and workflow automation. It supports file operations, shell commands, and connects to external tools via the Model Context Protocol (MCP).
The full details on Gemini CLI are available here:
Amazon EC2
Amazon Elastic Compute Cloud (Amazon EC2) is a core Amazon Web Services (AWS) offering that provides secure, resizable compute capacity (virtual servers) in the cloud. It enables developers to easily obtain and configure virtual machines, known as instances , on demand, without the need for up-front hardware investment.
The full background information on Amazon EC2 is here:
Why would I want Gemini CLI and the ADK on AWS? Isn’t that a Google Thing?
Yes- Gemini CLI and the ADK leverages the Google Cloud console and Gemini models but it is also open source and platform agnostic. Many applications are already cross-cloud so this enables familiar tools to be run natively on Amazon AWS.
Activating Amazon EC2
To validate the approach- a basic Amazon Linux EC2 instance is spun up:
Then create a basic Amazon Linux 2023 EC2 instance with the t3-small profile:
Instance Customization
Once the image spins up- connect via SSH or the console and pull the git repo with the customization scripts:
git clone https://github.com/xbill9/gemini-cli-aws
cd gemini-cli-aws
Then run the update scripts:
[ec2-user@ip-172-31-66-238 gemini-cli-aws]$ source linux-update
Detected Amazon Linux. Running aws-update...
Last metadata expiration check: 0:53:51 ago on Mon Mar 9 16:00:36 2026.
Last metadata expiration check: 0:53:51 ago on Mon Mar 9 16:00:36 2026.
Dependencies resolved.
Nothing to do.
Complete!
Last metadata expiration check: 0:53:52 ago on Mon Mar 9 16:00:36 2026.
Package libatomic-14.2.1-7.amzn2023.0.2.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
npm warn deprecated prebuild-install@7.1.3: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
npm warn deprecated glob@10.5.0: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
Verifying Node.js in Amazon Linux Instance
The version of Node.js is verified that it is recent enough to support Gemini CLI:
[ec2-user@ip-172-31-66-238 gemini-cli-aws]$ npm --version
11.11.0
[ec2-user@ip-172-31-66-238 gemini-cli-aws]$ node --version
v25.8.0
Gemini CLI Installation
The linux-update script automatically updates Gemini CLI.
To manually update the version:
[ec2-user@ip-172-31-66-238 gemini-cli-aws]$ source gemini-update
You also download the Gemini CLI directly:
npm install -g @google/gemini-cli
Testing the Gemini CLI Environment
Once you have all the tools and the correct Node.js version in place- you can test the startup of Gemini CLI. You will need to authenticate with a Key or your Google Account:
gemini
Then you will get full access to the CLI:
Authentication
Several authentication options are available. To use an existing Code Assist licence — authenticate with a Google Account:
Then set the GOOGLE_CLOUD_PROJECT to a valid project setup on the Google Cloud console:
~ $ export GOOGLE_CLOUD_PROJECT=comglitn
~ $
Other options include Google Cloud API Key that can be generated directly from the Google Cloud Console.
Google Cloud Tools
The Google Cloud utility tools can be installed on Amazon Linux 2023 following these directions:
Quickstart: Install the Google Cloud CLI | Google Cloud SDK | Google Cloud Documentation
The direct URL is here:
https://docs.cloud.google.com/sdk/docs/install-sdk
First add the Google Cloud source repository:
[ec2-user@ip-172-31-66-238 gemini-cli-aws]$ sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
[google-cloud-cli]
name=Google Cloud CLI
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el10-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key-v10.gpg
EOM
[google-cloud-cli]
name=Google Cloud CLI
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el10-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key-v10.gpg
Then, install the tools:
[ec2-user@ip-172-31-66-238 gemini-cli-aws]$ sudo dnf install google-cloud-cli
Google Cloud CLI 8.9 MB/s | 10 MB 00:01
Last metadata expiration check: 0:00:03 ago on Mon Mar 9 17:09:31 2026.
Dependencies resolved.
==============================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================
Installing:
google-cloud-cli x86_64 559.0.0-1.el10 google-cloud-cli 110 M
Installing dependencies:
google-cloud-cli-anthoscli x86_64 559.0.0-1.el10 google-cloud-cli 26 M
Is this ok [y/N]: y
Linking the Google Cloud Project
Once the gcloud tools are active- authenticate to the underlying Google Cloud Project:
[ec2-user@ip-172-31-66-238 gemini-cli-aws]$ gcloud auth list
No credentialed accounts.
To login, run:
$ gcloud auth login `ACCOUNT`
[ec2-user@ip-172-31-66-238 gemini-cli-aws]$ gcloud auth login
You will be prompted for an Oauth authentication flow.
Then — set your main Google Cloud project:
Your current project is [None]. You can change this setting by running:
$ gcloud config set project PROJECT_ID
[ec2-user@ip-172-31-66-238 gemini-cli-aws]$ gcloud config set project comglitn
Updated property [core/project].
[ec2-user@ip-172-31-66-238 gemini-cli-aws]$
Using the ADK on AWS
Now that the base environment has been enabled- a sample ADK project is cloned and initial setup is done:
git clone https://github.com/adk-hello-world
source set_env.sh
gcloud auth application-default login
Once the environment is set- call the Agent1_cli.sh script:
/home/ec2-user/adk-hello-world/src/agents/Agent1
adk run .
Log setup complete: /tmp/agents_log/agent.20260310_192953.log
To access latest log: tail -F /tmp/agents_log/agent.latest.log
/home/ec2-user/.pyenv/versions/3.13.12/lib/python3.13/site-packages/google/adk/cli/utils/agent_loader.py:248: UserWarning: [EXPERIMENTAL] _load_from_yaml_config: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
if root_agent := self._load_from_yaml_config(actual_agent_name, agents_dir):
/home/ec2-user/.pyenv/versions/3.13.12/lib/python3.13/site-packages/google/adk/features/_feature_decorator.py:81: UserWarning: [EXPERIMENTAL] feature FeatureName.AGENT_CONFIG is enabled.
check_feature_enabled()
/home/ec2-user/.pyenv/versions/3.13.12/lib/python3.13/site-packages/google/adk/cli/cli.py:204: UserWarning: [EXPERIMENTAL] InMemoryCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
credential_service = InMemoryCredentialService()
/home/ec2-user/.pyenv/versions/3.13.12/lib/python3.13/site-packages/google/adk/auth/credential_service/in_memory_credential_service.py:33: UserWarning: [EXPERIMENTAL] BaseCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
super(). __init__ ()
Running agent Agent1, type exit to exit.
[user]: what is the weather in Hoboken NJ
[Agent1]: The weather in Hoboken, New Jersey, on Tuesday, March 10, 2026, is sunny with temperatures in the low 70s Fahrenheit.
Specifically, around 3:00 PM to 4:00 PM EDT, the temperature is approximately 72°F, feeling like 72-74°F. The forecast for today indicates sunny conditions and highs in the mid-70s. Earlier in the afternoon, around 3 PM, the temperature was 72°F with a RealFeel of 74°F, remaining pleasant into the evening with temperatures around 69°F by 6 PM. The day is expected to be mainly sunny, with some areas of dense morning fog clearing.
Running the ADK Web Interface
First- check that the Amazon EC2 instance allows web traffic on ports 8000 and 8080- these are the common Agent ports.
Once the CLI has been validated, start the ADK Web Interface with the *webvm.sh * script:
Running ADK from VM
/home/ec2-user/adk-hello-world/src/agents
adk web
2026-03-10 19:34:22,852 - INFO - service_factory.py:266 - Using in-memory memory service
2026-03-10 19:34:22,852 - INFO - local_storage.py:84 - Using per-agent session storage rooted at /home/ec2-user/adk-hello-world/src/agents
2026-03-10 19:34:22,853 - INFO - local_storage.py:110 - Using file artifact service at /home/ec2-user/adk-hello-world/src/agents/.adk/artifacts
/home/ec2-user/.pyenv/versions/3.13.12/lib/python3.13/site-packages/google/adk/cli/fast_api.py:192: UserWarning: [EXPERIMENTAL] InMemoryCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
credential_service = InMemoryCredentialService()
/home/ec2-user/.pyenv/versions/3.13.12/lib/python3.13/site-packages/google/adk/auth/credential_service/in_memory_credential_service.py:33: UserWarning: [EXPERIMENTAL] BaseCredentialService: This feature is experimental and may change or be removed in future versions without notice. It may introduce breaking changes at any time.
super(). __init__ ()
INFO: Started server process [22779]
INFO: Waiting for application startup.
+-----------------------------------------------------------------------------+
| ADK Web Server started |
| |
| For local testing, access at http://0.0.0.0:8000. |
+-----------------------------------------------------------------------------+
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
Verify the ADK Web interface
Navigate to the external IP address of the EC2 VM:
Summary
Gemini CLI was downloaded and tested from an AWS Amazon Linux 2023 EC2 instance.
This is a complete fully working version of Gemini CLI with all the standard features like extensions, agent skills, and a familiar interface.
Next, the Google Cloud tools package was installed on the same EC2 instance. Then, a Google ADK project was cloned from Github.
This project was used to test the ADK running natively in AWS.
This is a first step to enabling cross platform projects with both Google Cloud and AWS.






Top comments (0)