Getting started

From nothing to a patched server in about fifteen minutes. You need an account; if you do not have one yet, ask us.

1. Create an API token

In the console, go to Settings, API tokens and create a token with these scopes: servers:read, servers:write, runbooks:read, runbooks:launch. Set the expiry to 30 days while you are experimenting. The secret is shown once. Copy it somewhere safe, and see Authentication for what the scopes mean.

2. Install the CLI

acloud is a single static binary for Linux (amd64, arm64) and macOS (arm64). Download it from Settings, CLI downloads in the console, together with its checksum file.

$ sha256sum -c acloud_1.7.1_linux_amd64.sha256
acloud_1.7.1_linux_amd64: OK
$ sudo install -m 0755 acloud_1.7.1_linux_amd64 /usr/local/bin/acloud
$ acloud version
acloud 1.7.1 (api v1)

3. Sign in

$ acloud auth login
Token: ****************************************
Saved profile "default" to ~/.config/acloud/config.toml
$ acloud auth status
account:  your-company
token:    tok_01JC7R8M2QX4N0T6B9WVKA3DEH (scopes: servers:read, servers:write, runbooks:read, runbooks:launch)
expires:  in 30 days

For scripts, set ACLOUD_TOKEN in the environment, or pipe the token in with acloud auth login --token-stdin.

4. Add an SSH key

$ acloud ssh-key add laptop ~/.ssh/id_ed25519.pub
key_01JC7SB4K1ZP6H3N8VAYT2R9WD  laptop  SHA256:Vq0x...j4E

5. Create a server

List what is available, then create one. --wait blocks until the server has an address and has passed its first boot checks.

$ acloud plan list --site denver
PLAN   CORES  MEMORY  STORAGE           GPU        NETWORK  MONTH   HOUR
c1.16  16      64 GB   2 x 960 GB NVMe   -          10 Gbps  $229    $0.318
c2.32  32      128 GB  2 x 1.92 TB NVMe  -          10 Gbps  $389    $0.540
c3.64  64      512 GB  4 x 3.84 TB NVMe  -          25 Gbps  $849    $1.179
g1.1   24      256 GB  2 x 1.92 TB NVMe  1 x 48 GB  25 Gbps  $1,290  $1.792
g1.4   64      1 TB    4 x 3.84 TB NVMe  4 x 48 GB  25 Gbps  $4,490  $6.236

$ acloud server create --site denver --plan c2.32 --image debian-13 \
    --name batch-01 --ssh-key laptop --label env=staging --wait
creating batch-01 ... allocated
creating batch-01 ... installing
creating batch-01 ... first boot
batch-01 ready in 6m48s
id:      srv_01JC7SFX0RZ8M2K5Q4PYN7A3VB
address: 203.0.113.41

The first user is ops, with your SSH key and passwordless sudo. Root login is disabled.

$ ssh ops@203.0.113.41

6. Run a runbook

New control planes come with the starter library. List it, then launch base-hardening against the new server. The server is already in your inventory.

$ acloud runbook list
ID                            NAME            LAST RUN
rbk_01JA2M8Q5T7XN3V0ZC4HKD9B6E  base-hardening  never
rbk_01JA2M9D1WYQ4F8RT2NB6XMA3K  os-patch        never

$ acloud runbook launch base-hardening --limit batch-01 --follow
job_01JC7T2P8DKQ5ZV1M9A4XWR6NH started
PLAY [base-hardening] ****************************************
TASK [sshd : restrict authentication methods] ****************
changed: [batch-01]
...
PLAY RECAP: batch-01  ok=14  changed=3  unreachable=0  failed=0
job_01JC7T2P8DKQ5ZV1M9A4XWR6NH successful in 41s

7. The same thing over the API

$ curl -s -X POST https://api.ansiblecloud.io/v1/servers \
    -H "Authorization: Bearer $ACLOUD_TOKEN" \
    -H "Idempotency-Key: 5b2f6b8e-29d4-4c0a-9c5e-0e3f1d7b8a41" \
    -H "Content-Type: application/json" \
    -d '{"name":"batch-01","site":"denver","plan":"c2.32","image":"debian-13","ssh_keys":["laptop"],"labels":{"env":"staging"}}'

The response is 202 Accepted with the server in the provisioning state. See Servers for the shape.

8. Clean up

Hourly servers stop billing when they are deleted.

$ acloud server delete srv_01JC7SFX0RZ8M2K5Q4PYN7A3VB --yes
deleted srv_01JC7SFX0RZ8M2K5Q4PYN7A3VB

Where to go next

  • Build your own image: acloud image build --from image.yml. See the CLI reference.
  • Receive events instead of polling: webhooks.
  • Restrict a CI token to your office or runner network: authentication.