> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bqto.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What bqto is

> bqto opens a short-lived bastion VM in your Google Cloud project and forwards a local port through Identity-Aware Proxy to a private service.

bqto lets you reach private Google Cloud services from your laptop or a CI job. It works with
Cloud SQL, AlloyDB, and Memorystore. You do not need a VPN or a bastion that runs all the time.

bqto creates a small bastion VM in your project when you connect. When you stop, bqto deletes
the VM.

## How it works

Your client connects to a local port. bqto carries the traffic through Identity-Aware Proxy (IAP)
and a temporary bastion VM to the private address of the service.

```mermaid theme={null}
flowchart LR
    subgraph laptop["Your laptop or CI job"]
        client["your database client or app<br/>127.0.0.1:15432"]
    end
    subgraph google["Google"]
        iap["Identity-Aware Proxy<br/><i>checks your IAM roles</i>"]
    end
    subgraph vpc["Your VPC"]
        bastion["bastion VM<br/>no external IP<br/><i>deleted when you stop</i>"]
        service[("Cloud SQL, AlloyDB<br/>or Memorystore<br/>private IP")]
    end
    client -->|"HTTPS, port 443"| iap
    iap -->|"SSH, port 22<br/>from 35.235.240.0/20"| bastion
    bastion -->|"service port"| service
```

1. bqto asks the API of the service for its private address.
2. bqto checks that the firewall lets IAP reach port 22. Then it creates a small bastion VM in
   the network of the service, with no external IP.
3. bqto opens an IAP tunnel and forwards a local port through the bastion to the service.
4. When you stop, bqto deletes the bastion. If bqto cannot delete it, a deadline set on the VM
   deletes it.

bqto acts as you. It uses your `gcloud` login and your Application Default Credentials. Your IAM
roles decide what you can reach.

## Limits

bqto is for interactive use, such as `psql` or a local client on a forwarded port, and for
transfers of a few gigabytes. It is not for bulk data. Google says that IAP TCP forwarding is not
intended for bulk transfer of data. A dump or restore of tens of gigabytes belongs on a VM in the
VPC, with the data moved through Cloud Storage.

These numbers were measured in us-central1, against Cloud SQL for PostgreSQL 17:

| From | One query through bqto | 1 GB through bqto |
| - | - | - |
| A VM in the same region | About 10 ms | 14.5 s (69 MB/s), with an `e2-standard-2` bastion |
| A laptop on a 46 Mbps connection | About 150 ms | 2.1 to 2.4 min (7 to 8 MB/s) |

Each query pays the round trip through IAP and the bastion. So thousands of queries in a row are
slow. Batch them, or run the job inside Google Cloud.

IAP closes a tunnel after an hour with no traffic. bqto sends an SSH keepalive every 30 seconds,
so a quiet session stays open.

## bqto and bqto Pro

bqto is free and open source, under the Apache License 2.0. bqto Pro is the paid edition. It is
one `bqto` binary that does everything the free bqto does, and adds more services and features.

| Service or feature | bqto | bqto Pro |
| - | - | - |
| Cloud SQL, including read replicas | Yes | Yes |
| AlloyDB, including read pools | Yes | Yes |
| Memorystore for Redis, Basic and Standard tiers | Yes | Yes |
| Memorystore for Valkey, cluster mode disabled | Yes | Yes |
| Memorystore for Redis Cluster, and Valkey in cluster mode | No | Yes |
| Managed Kafka | No | Yes |
| Cloud Run, internal ingress | No | Yes |
| A private `IP:PORT` that you give (`--endpoint`) | No | Yes |
| Profiles and stacks | No | Yes |
| Bastion settings: `--spot`, `--subnet`, `--machine-type`, `--image` | No | Yes |
| The Mac menu bar app | No | Yes |

The free bqto marks the bqto Pro flags `(bqto Pro)` in its help. If you give it one of them, it
stops before it creates anything and exits with code 2.

## Next steps

> [card] [Install bqto](https://docs.bqto.dev/install.md)
>
> Install the free bqto or bqto Pro.

> [card] [First connection](https://docs.bqto.dev/quickstart.md)
>
> Sign in, get the roles, and connect to a private database.

> [card] [Permissions](https://docs.bqto.dev/reference/permissions.md)
>
> The IAM roles and APIs that bqto needs.

> [card] [GitHub Actions](https://docs.bqto.dev/guides/github-actions.md)
>
> Run a step against a private service from a workflow.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.