Skip to content
Your first machine

Your first machine

This takes you from a fresh install to a shell in a machine, and shows suspend and resume. To meet your agent in a project instead, in the portal, see Your first agent. You need the CLI installed, an API key saved with space login, and an ed25519 or ECDSA SSH key on your machine.

Add your SSH key

In the portal, go to Account → SSH keys and add your public key (~/.ssh/id_ed25519.pub or ~/.ssh/id_ecdsa.pub). The CLI cannot add it: an SSH key opens the machines of every project, and an API key works in the projects it reaches. Check that it is there:

space ssh-keys list

Create a machine

space machines create dev --wait

--wait returns once the machine is running. By default a machine has 2 vCPUs, 2 GiB of memory and a 10 GiB disk; size it with --vcpus, --mem (MiB) and --disk (GiB), see space machines create.

If you belong to more than one organization, add --org <slug> or set a default (see Configuration).

Connect

space ssh dev

You are root in the machine. See Connect over SSH for scp, rsync, port forwarding and ~/.ssh/config.

Suspend and resume

space machines sleep dev --wait
space machines list
space machines wake dev --wait

Files on the machine’s disk survive a suspend; running processes do not (see the note on suspending). A suspended machine also resumes when you connect to it, so space ssh dev works on a suspended machine too; the first connection just takes a little longer.

Clean up

space machines delete dev

This asks for confirmation; add --yes to skip it (scripts must).

Last updated on