> Source: https://meetrix.io/blogs/ninerouter-gcp-developer-guide/
> Markdown copy of that page. Cite the URL above, not this file.

Development

# 9Router on GCP - Developer Guide

[By Binuka Ranatunga](https://meetrix.io/blogs/authors/binuka-ranatunga/) • September 9, 2026 • 8 min read

Welcome to the Meetrix 9Router developer guide for Google Cloud Platform! [9Router](https://github.com/decolua/9router) is a self-hosted AI routing proxy that connects Claude Code, Codex, Cursor, Cline, Copilot, and other CLI tools to 40+ LLM providers behind a single OpenAI-compatible endpoint. It translates request formats between OpenAI, Claude, and Gemini, tracks quota, auto-refreshes tokens, and falls back from subscription to cheap to free providers so you never stop coding. The built-in RTK token saver compresses tool output to cut input tokens by roughly 20-40%.

With the Meetrix pre-configured GCP image, you can deploy a production-ready 9Router instance on your own Google Cloud project in minutes. This guide walks you through finding the product on GCP Marketplace, configuring the deployment, pointing DNS and issuing SSL, connecting your first provider, and wiring a CLI tool to your new endpoint. If you run your infrastructure on AWS instead, the [9Router on AWS developer guide](https://meetrix.io/blogs/9router-developer-guide/) covers the same product as a CloudFormation stack.

Prerequisites

Before you begin, make sure you have the following:

-   Basic Google Cloud Platform knowledge.
-   An active Google account with a GCP project and billing enabled.
-   Sufficient Compute Engine CPU quota in your target region for the machine type you plan to use.
-   A domain name you can manage DNS records for, if you want automatic SSL.

## What You Get

The image ships a fully wired 9Router stack so you do not have to assemble it yourself:

-   9Router v0.5.65 running as a Docker container (`decolua/9router:0.5.65`) on Ubuntu 26.04 LTS.
-   Docker and Docker Compose, with the image pre-pulled for a fast first boot.
-   An nginx reverse proxy for HTTP and HTTPS, tuned for Server-Sent Events streaming (no buffering, long timeouts) so token streaming to your CLI tools is not broken.
-   Automatic SSL via Let's Encrypt for the domain you set during deployment.
-   SQLite data in a Docker volume on the persistent boot disk, so provider connections and settings survive a VM stop and restart.
-   A pre-hardened base image with ufw, unattended-upgrades, and the standard GCP guest environment.

## Launch the Product

### Step 1: Find the Product

1.  Log in to your Google account.
2.  Go directly to the product page: [9Router LLM Gateway: Multi-Provider AI Model Router on GCP Marketplace](https://console.cloud.google.com/marketplace/product/meetrix-public/ninerouter-llm-gateway).
3.  You can also browse all Meetrix products at the [Meetrix Solutions Page](https://console.cloud.google.com/marketplace/browse?filter=partner:Meetrix%20Pte%20Ltd&ref=meetrix.io).

![9Router LLM Gateway Multi-Provider AI Model Router product details page on GCP Marketplace by Meetrix Pte Ltd, showing the Launch button and the Overview tab with a description of routing AI coding tools to 40+ model providers](https://meetrix.io/blog-images/paas-dev-guides/9router-gcp/9router-gcp-1.png)

### Step 2: Launch the Product

1.  Select your GCP project from the project selector at the top.
2.  Click the **Launch** button.
3.  Review the terms and agreements, tick the acknowledgement checkbox, and click **AGREE**.

![GCP Marketplace Agreements page for the 9Router deployment with the meetrix-public project selected and the terms and agreements checkbox ticked above the Agree button](https://meetrix.io/blog-images/paas-dev-guides/9router-gcp/9router-gcp-2.png)

### Free Trial

This product includes a **5-day free trial** with up to USD 50.00 in licence fee credits. To activate it, tick **I accept the solution trial Terms and Conditions** before proceeding.

![Free trial terms and conditions checkbox ticked on the 9Router GCP Marketplace deployment form](https://meetrix.io/blog-images/paas-dev-guides/9router-gcp/9router-gcp-3.png)

Trial note

Infrastructure charges (VM, disk) still apply during the trial. Only the Meetrix licence fee is credited. You can cancel the trial at any time by deleting the deployment.

### Step 3: Configure the Deployment

You will see the deployment configuration form. Fill in the fields across the following sections.

![9Router GCP deployment configuration form showing the deployment name ninerouter-1, deployment service account, zone us-central1-a, and General purpose E2 e2-small machine type, with an estimated monthly cost panel on the right](https://meetrix.io/blog-images/paas-dev-guides/9router-gcp/9router-gcp-4.png)

#### General

-   **Deployment name** - A unique name for this deployment (a default is pre-filled).
-   **Deployment Service Account** - Select an existing service account that has the `roles/config.agent`, `roles/compute.admin`, and `roles/iam.serviceAccountUser` roles, or let GCP create a new one for you.
-   **Zone** - Select the GCP zone closest to your users (for example `us-central1-a`).

#### Machine Type

-   **Series** - The `General purpose` tab with the `E2` series is preselected.
-   **Machine type** - Default `e2-small` (2 vCPU, 2 GB RAM) is enough for a single user or a small team. Choose a larger type if you expect heavy concurrent traffic through the proxy.

GCP shows an estimated monthly cost, made up of the Meetrix licence fee and the underlying infrastructure fee, based on your selected machine type and disk size before you deploy.

### Step 4: Configure Networking

-   **Network** and **Subnetwork** - Leave as `default` unless you have a custom VPC.
-   **External IP** - Leave as `Ephemeral`. Select `None` only if you do not need public internet access, which is not useful for a proxy your tools call from anywhere.
-   **Allow SSH (TCP port 22) from the Internet** - Enabled by default. Restrict the source IP range if you want to limit SSH access to specific IPs.

![9Router GCP networking configuration with the Edit network interface panel showing Network default, Subnetwork default, and External IP set to Ephemeral, above the Allow SSH firewall rule](https://meetrix.io/blog-images/paas-dev-guides/9router-gcp/9router-gcp-6.png)

### Step 5: Application Settings

Scroll down to the Application Settings section and provide:

-   **Domain name** - The public domain for your 9Router dashboard and API (for example `9router.yourdomain.com`). Point your DNS A record to the instance IP before or shortly after deploying.
-   **Admin email** - The email address used when requesting the Let's Encrypt SSL certificate.
-   **Dashboard initial password** - The password for your first dashboard login. This field is required and has no default. Change it from the dashboard after logging in.

Tick **I accept the solution trial Terms and Conditions**, then click **Deploy** and wait a few minutes for the deployment to complete.

![9Router GCP Application Settings form showing the Domain name field set to 9router.example.com, the Admin email field, and the required Dashboard initial password field above the Deploy button](https://meetrix.io/blog-images/paas-dev-guides/9router-gcp/9router-gcp-5.png)

## Point DNS to Your 9Router Server

Skip this section if you plan to access the instance by its external IP address instead of a real domain.

### Step 1: Get the External IP

1.  Once deployment is complete, open the VM instance from the deployment details.
2.  Copy the **External IP** from the Network interfaces section.

![GCP VM instance details page showing the Network interfaces table with the primary internal IP 10.128.0.33 and the ephemeral external IP address selected for copying](https://meetrix.io/blog-images/paas-dev-guides/9router-gcp/9router-gcp-7.png)

### Step 2: Create a DNS A Record

1.  Go to your DNS provider.
2.  Add an **A record** pointing your 9Router domain (for example `9router.yourdomain.com`) to the copied external IP.
3.  Wait for DNS propagation before proceeding (typically a few minutes to 1 hour).

DNS must propagate first

The image issues SSL via [Let's Encrypt](https://letsencrypt.org/), which verifies domain ownership over HTTP. Make sure your DNS A record points to the server IP and has propagated before the certificate request runs.

## Access 9Router

Once DNS has propagated and SSL has issued, open your domain in a browser. Log in with the **Dashboard initial password** you set in the Application Settings section during deployment. The username field is not used.

![9Router dashboard login page on a dark background with a single password field, a Login button, and a note that the dashboard asks you to set a password when logging in remotely](https://meetrix.io/blog-images/paas-dev-guides/9router-gcp/9router-gcp-9.png)

502 Bad Gateway Error?

If you receive a "502 Bad Gateway" error, wait about **5 minutes** and refresh the page. The container may still be initializing on first boot.

Once you are in, change the password from the dashboard and keep it somewhere safe.

## Connect a Provider

9Router does nothing until it has at least one provider to route to.

1.  Go to **Providers** in the dashboard.
2.  Connect at least one provider. You can start with a free tier such as Kiro AI or DeepSeek Free, connect a paid subscription like Claude Code or Cursor, or use **Add OpenAI Compatible** / **Add Anthropic Compatible** to paste in your own API key for a provider like Anthropic, OpenAI, or Google.
3.  Add more providers if you want fallback. 9Router routes subscription first, then cheap, then free, so requests keep succeeding when one provider is rate-limited or out of quota.

![9Router Proxy dashboard Providers page showing Custom Providers with Add Anthropic Compatible and Add OpenAI Compatible buttons, OAuth Providers such as Claude Code, OpenAI Codex, GitHub Copilot, Cursor IDE, and Cline, and Free Tier Providers including DeepSeek Free, Gemini CLI, Kiro AI, and OpenRouter, all with no connections yet](https://meetrix.io/blog-images/paas-dev-guides/9router-gcp/9router-gcp-10.png)

If you want to route to a model you host yourself, stand it up behind an OpenAI-compatible API and add it as a custom provider. Our [vLLM developer guide](https://meetrix.io/blogs/vllm-developer-guide/) covers serving an open-weight model that way, and the [best open source LLMs for self-hosting](https://meetrix.io/blogs/best-open-source-llms-self-hosted-2026/) rundown is a reasonable place to pick one.

## Point Your CLI Tool at 9Router

1.  In the dashboard, open **Endpoint & Key** and copy your API key.
2.  Configure your CLI tool with these values:

```bash
Endpoint: https://<your-domain>/v1
API Key:  <key from the dashboard>
Model:    <provider>/<model>, for example kr/claude-sonnet-4.5
```

This works with any OpenAI-compatible client, including Claude Code, Codex, Cursor, Cline, and Copilot. Requests are translated to the target provider's format automatically, so you can keep the same tool while switching the model behind it. The **CLI Tools** section of the dashboard has copy-paste snippets for the common ones.

## Generate an SSL Certificate Manually

9Router tries to issue SSL automatically on first boot for the domain you passed as **Domain name**. If that fails, for example because DNS had not propagated yet, you can generate it manually.

### Step 1: SSH into the Server

1.  Go to the VM instance page in the GCP console.
2.  Click **SSH** to open a browser-based terminal and authorize access.

![GCP VM instance details page with the SSH button and the Logs section for viewing serial console output](https://meetrix.io/blog-images/paas-dev-guides/9router-gcp/9router-gcp-8.png)

### Step 2: Re-issue the Certificate

The image includes a pre-configured certificate script. Run it with:

```bash
sudo bash /root/certificate_generate_standalone.sh
```

This runs certbot using the domain name and admin email you provided during deployment. Once it completes, reload nginx:

```bash
sudo systemctl reload nginx
```

## Check Server Logs

Open an SSH session to the instance from the GCP console, then check the container and follow its logs. The application runs from `/opt/9router`:

```bash
sudo docker ps
sudo docker logs -f 9router
```

Configuration lives in `/opt/9router/.env` and `/opt/9router/docker-compose.yml`. The SQLite database is in the Docker volume `9router-data`, mounted at `/app/data`, with the file at `db/data.sqlite`.

## Back Up the Database

The SQLite database lives in the `9router-data` Docker volume on the persistent boot disk, so it remains available after VM stops and restarts. The image ships a backup helper at `/opt/scripts/dbbackup.sh` that writes a timestamped, gzipped copy of the database. Run it from an SSH session before deleting or upgrading the deployment:

```bash
sudo bash /opt/scripts/dbbackup.sh
```

Then use the **Download file** option in the SSH-in-browser window to save the snapshot to your machine.

## Manage the Deployment

### Stop the VM

To stop the VM without deleting it, go to **Compute Engine → VM Instances** in the GCP console, select your instance, and click **Stop**. You can [restart it later](https://cloud.google.com/compute/docs/instances/stop-start-instance) with your data intact. If the external IP is ephemeral it may change on restart, so update your DNS A record afterward, or reserve a static IP if you stop and start the VM often.

### Delete the Deployment

To fully remove the deployment and stop all billing:

1.  Go to [Solution deployments](https://console.cloud.google.com/products/solutions/deployments) in the GCP console.
2.  Find your 9Router deployment.
3.  Click **Delete** to remove all associated resources.

Back up the SQLite database first if you want to keep your provider connections and settings.

## Upgrades

When a new image version is available in the GCP Marketplace, back up your data, delete the previous deployment, and relaunch with the new version.

## Troubleshoot

### Quota or Capacity Errors

GCP enforces regional CPU quotas. If you hit a quota error when deploying, request a [Compute Engine CPU quota increase](https://cloud.google.com/compute/resource-usage) for that region, or choose a different region or zone with available capacity.

### 502 Bad Gateway

If the dashboard is temporarily inaccessible, wait 5-10 minutes and retry. The container is likely still starting up.

### SSL Did Not Issue

Confirm your DNS record points at the external IP and has propagated, then re-run the certificate script from the "Generate an SSL Certificate Manually" section.

### Disk Space

If 9Router becomes unresponsive, check whether the boot disk is full:

```bash
df -h
```

If the root volume is between 90-100% full, [resize the persistent disk](https://cloud.google.com/compute/docs/disks/resize-persistent-disk) in the GCP console, then reboot the instance and restart the service.

## Conclusion

The Meetrix 9Router Deployment Guide gets a self-hosted AI routing proxy running on your own GCP project in minutes. Once it is up, you point every AI coding tool at one endpoint, connect as many providers as you like, and let 9Router handle format translation, quota tracking, fallback, and token savings behind the scenes. For a self-hosted agent that pairs well with a vendor-neutral model router, see the [Hermes Agent on GCP developer guide](https://meetrix.io/blogs/hermes-agent-gcp-developer-guide/).

## Deploying on AWS Instead?

The same product is available as a CloudFormation stack on AWS Marketplace, with the same providers, endpoint, and token saver.

[

### 9Router on AWS - Developer Guide

Deploy 9Router, the self-hosted AI routing proxy, on AWS with our step-by-step CloudFormation guide. Learn how to launch, secure with SSL, connect LLM providers, and point Claude Code, Codex, Cursor, and other CLI tools at a single endpoint.

By Binuka Ranatunga • Meetrix.io

](https://meetrix.io/blogs/9router-developer-guide/)

## Technical Support

If you run into any issues, our support team is here to help. Reach out to us at [support@meetrix.io](mailto:support@meetrix.io) and we will respond within 12 hours.

## Frequently Asked Questions

What is 9Router?

9Router is an open-source smart router that sits between your AI coding tools and dozens of model providers. It exposes a single OpenAI-compatible endpoint, translates request formats between OpenAI, Claude, and Gemini, tracks quota, auto-refreshes tokens, and falls back from subscription to cheap to free providers so your CLI tools keep working. A built-in RTK token saver compresses tool output to cut input tokens.

What are the prerequisites for deploying 9Router on GCP?

You need basic knowledge of Google Cloud Platform, an active Google account with a GCP project and billing enabled, sufficient Compute Engine CPU quota in your target region for the machine type you plan to use, and a domain name you can manage DNS records for if you want automatic SSL.

Which machine type should I choose?

The default General purpose e2-small (2 vCPU, 2 GB RAM) is enough for a single user or a small team. Choose a larger machine type if you expect heavy concurrent traffic through the proxy.

How do I log in for the first time?

Open your domain once DNS has propagated and SSL has issued, then log in with the Dashboard initial password you set in the Application Settings section during deployment. The username field is not used. Change the password from the dashboard after your first login.

Which providers can I connect?

9Router supports 40+ LLM providers. You can start with a free tier such as Kiro AI or DeepSeek Free, connect a paid subscription like Claude Code or Cursor, or paste in your own API key for providers like Anthropic, OpenAI, or Google. 9Router then routes requests across whatever you have connected, with automatic fallback.

How do I point my CLI tool at 9Router?

In the dashboard, open Endpoint & Key and copy your API key. Then set your tool's base URL to https:///v1, use that API key, and pick a model in the form provider/model, for example kr/claude-sonnet-4.5. This works with Claude Code, Codex, Cursor, Cline, Copilot, and other OpenAI-compatible tools.

Where is my data stored, and can I back it up?

9Router keeps its state in a SQLite database in the Docker volume 9router-data at /app/data/db/data.sqlite, on the instance's persistent boot disk, and it survives VM stops and restarts. To take a manual backup, run the bundled helper script sudo bash /opt/scripts/dbbackup.sh over SSH before deleting or upgrading the deployment.

## Deploy 9Router on GCP in Minutes

Launch a production-ready, self-hosted 9Router proxy on Google Cloud with a pre-configured Meetrix image and route every AI coding tool through one endpoint.

[Get Started on GCP Marketplace](https://console.cloud.google.com/marketplace/product/meetrix-public/ninerouter-llm-gateway)

Meetrix Store

9Router

One endpoint for 40+ LLM providers

[Deploy it](https://meetrix.io/store/9router/)

Meetrix Store New

Deploy what this guide covers, pre-configured.

-    [9Router One endpoint for 40+ LLM providers](https://meetrix.io/store/9router/)
-    [OpenWebUI A private ChatGPT-style assistant](https://meetrix.io/store/openwebui/)
-    [vLLM Serve open models on your own GPU](https://meetrix.io/store/vllm/)
-    [Jitsi Meet Self-hosted video calls for 50 to 500 users](https://meetrix.io/store/jitsi-meet/)
-    [RustDesk Remote desktop AMI, a TeamViewer alternative](https://meetrix.io/store/rustdesk/)
-    [Coturn TURN/STUN for WebRTC, no per-minute relay fees](https://meetrix.io/store/coturn/)

[Browse all products](https://meetrix.io/store/)
