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

macOS and Linux Windows
curl -fsSL https://betterstack.sh | sh
irm https://betterstack.sh/install.ps1 | iex

Sign in

Sign in with your browser
betterstack signin

Create your first server

Cloud commands take the data center 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:

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:

List servers
betterstack server list --availability-zone us-west-2a --team t123

Stop or start a server by its name or ID:

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 cluster with two workers and wait until it's ready:

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:

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.

Need help?

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