Skip to main content

Quickly spin up Hetzner instances

Project description

spawnm

"spawn machine": Quickly spin up temporary Hetzner Cloud VMs.

Simply run

spawnm --ssh --workdir

to directly SSH into a new server with the contents of the current folder copied into it.

*Requires Hetzner's CLI hcloud to be set up and authed.

Installation

uv install spawnm

Prerequisites

  1. Install the Hetzner Cloud CLI:

    brew install hcloud  # macOS
    

    Or see https://github.com/hetznercloud/cli for other platforms.

  2. Configure hcloud with your API token:

    hcloud context create myproject
    # Enter your API token from https://console.hetzner.cloud/
    
  3. Upload your SSH key to Hetzner Cloud:

    hcloud ssh-key create --name id_hetzner_macbook_air --public-key-from-file ~/.ssh/id_hetzner.pub
    

Usage

Create a VM

# Create with defaults
spawnm

# Create and SSH in immediately
spawnm --ssh

# Create, sync current directory, and SSH in
spawnm --ssh --workdir

# Create with custom options
spawnm --name my-server --size cx33 --image ubuntu-24.04

Destroy a VM

# Destroy the only tracked instance
spawnm destroy

# Destroy a specific instance
spawnm destroy my-server

# Destroy all tracked instances
spawnm destroy --all

Options

Option Default Description
--name spawn-tmp-XXXX Server name (random suffix by default)
--size cx23 Server type (cx23, cx33, cx43, etc.)
--image ubuntu-24.04 OS image
--location fsn1 Datacenter (fsn1, nbg1, hel1, ash)
--ssh-key id_hetzner_macbook_air SSH key name in Hetzner Cloud
--ssh - SSH into server after creation
--workdir - Sync current directory to the server

Server Types

Type vCPU RAM Disk
cx22 2 4 GB 40 GB
cx23 2 4 GB 80 GB
cx32 4 8 GB 80 GB
cx33 4 8 GB 160 GB
cx42 8 16 GB 160 GB
cx43 8 16 GB 320 GB

Locations

Code Location
fsn1 Falkenstein, Germany
nbg1 Nuremberg, Germany
hel1 Helsinki, Finland
ash Ashburn, USA

State

Instance information is stored in $XDG_STATE_HOME/spawnm/instances.json (defaults to ~/.local/state/spawnm/instances.json).

License

BSD-2-Clause

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spawnm-0.2.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spawnm-0.2.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file spawnm-0.2.0.tar.gz.

File metadata

  • Download URL: spawnm-0.2.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for spawnm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 74993e350b53ae86dda2f76e5575f8f4c4a41e38c6df396bb1c023eebdbcc615
MD5 c7d9169290f29ba5a0c807bf9c4a69e2
BLAKE2b-256 18d4bdfc62708af63dcf1d454a285838a95c4c78ef3c911d6b2210d4d008c54a

See more details on using hashes here.

File details

Details for the file spawnm-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: spawnm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for spawnm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e0d73fbd2903428a972d3573fe12f5afc5556b04c9f42c1bfe6ea13496b61df
MD5 a5a34743790b2042055bd37121bc8dd0
BLAKE2b-256 254a5a416ff1afabce7dde2abad2489f01f375ab0866f50372cef93cb35099f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page