# Manage Cloud from the command line

Create and manage Cloud servers, databases and Kubernetes clusters from your terminal with the `betterstack` CLI.

## Install the CLI

[code-tabs]
```bash
[label macOS and Linux]
curl -fsSL https://betterstack.sh | sh
```
```powershell
[label Windows]
irm https://betterstack.sh/install.ps1 | iex
```
[/code-tabs]

## Sign in

```bash
[label Sign in with your browser]
betterstack signin
```

## Create your first server

Cloud commands take the [data center](https://betterstack.com/docs/cloud/servers/regions/) in `--availability-zone`, such as `us-west-2a`. Commands that create a resource also take `--team` with the team's ID, such as `t123`. List your teams with `betterstack team list`.

Add your SSH key, then create a server and wait until it's running:

```bash
[label Create a server]
betterstack ssh-key create --availability-zone us-west-2a --team t123 --slug my-key --public-key @~/.ssh/id_ed25519.pub
betterstack server create --availability-zone us-west-2a --team t123 --name web-1 --server-type AM4 --image ubuntu-26-04 --ssh-keys my-key --wait
```

## Manage your servers

List the servers in a data center:

```bash
[label List servers]
betterstack server list --availability-zone us-west-2a --team t123
```

Stop or start a server by its name or ID:

```bash
[label Stop and start a server]
betterstack server stop web-1 --availability-zone us-west-2a --team t123 --wait
betterstack server start web-1 --availability-zone us-west-2a --team t123 --wait
```

## Create a Kubernetes cluster

Create a [managed Kubernetes](https://betterstack.com/docs/cloud/kubernetes/) cluster with two workers and wait until it's ready:

```bash
[label Create a cluster]
betterstack kubernetes-cluster create --availability-zone us-west-2a --team t123 --name prod \
  --node-pools '[{"name": "default", "server_type": "AM4", "node_count": 2}]' --wait
```

Save its kubeconfig and use it with `kubectl`:

```bash
[label Connect kubectl]
mkdir -p ~/.kube
betterstack kubernetes-cluster kubeconfig prod --availability-zone us-west-2a --team t123 --output-file ~/.kube/betterstack-prod.yaml
export KUBECONFIG=~/.kube/betterstack-prod.yaml
kubectl get nodes
```

`betterstack --help` lists every Cloud command under **Cloud**, and `betterstack server --help` lists every server command. For the rest of the CLI, see [Better Stack CLI](https://betterstack.com/docs/getting-started/integrations/cli/).

## Need help?

Please let us know at hello@betterstack.com.  
We're happy to help! 🙏
