Getting Started
initialize
onctl initis required before using onctl. It always ensures a global~/.onctldirectory exists, and -- if run interactively -- asks whether to also create a project-local.onctlin the current directory (its settings override the global ones). Either way you end up with a directory that looks like this:
❯ tree
.onctl
└── onctl.yaml
1 directory, 1 file
onctl.yamlis the single source of truth for every configurable parameter for every provider (global settings, hetzner, aws, gcp, azure, ovh, fc, ch), each grouped under its own section, pre-filled with working defaults.- edit the values you want to change; CLI flags (
onctl create --help) still override whatever is in this file.gcp.project,azure.subscriptionIdandovh.serviceNameship as placeholders and must be set to use those providers.
set cloud provider
- set
ONCTL_CLOUDenvironment variable (or pass-p/--provideron any command) to the name of the cloud provider. Supported values;- aws
- azure
- gcp
- hetzner
- ovh (requires a one-time consumer-key setup — see api.ovh.com/createToken — then set
OVH_APPLICATION_KEY,OVH_APPLICATION_SECRET,OVH_CONSUMER_KEY) - fc (local Firecracker microVM, no cloud account needed)
- ch (local Cloud Hypervisor microVM, no cloud account needed)
# set the active cloud provider
export ONCTL_CLOUD=hetzner
!!! note
If you don't set ONCTL_CLOUD environment variable, onctl tool will try to find credentials on your shell and use the first one it finds.
spin up a virtual machine
- We're ready. Let's create a Virtual Machine (Instance)
# create a VM
❯ onctl up -n onctl-test
Using: hetzner
Creating SSHKey: onctl-xxx...
SSH Key already exists (onctl-xxx)
Starting server...
Server IP: x.x.x.x
Vm started.
ssh access
- Just use ssh command to ssh into the virtual machine.
# ssh into the VM
❯ onctl ssh onctl-test
Using: hetzner
.
.
.
root@onctl-test:~#