# unikraft instances create

Create an instance.

```
unikraft instances create [flags]
```

## Examples

Create a new instance:

```bash
unikraft instance create \
	  --name demo-instance \
	  --metro fra \
	  --image nginx:latest \
	  --autostart \
	  --memory 128 \
	  --vcpus 1
```

Create an instance from a template:

```bash
unikraft instance create \
	  --name new-instance \
	  --metro fra \
	  --template my-template
```

## Options

```
  --args arg                  Arguments to pass to the instance.
  --autostart                 Start instance automatically.
  --cmd CMD                   Run a command to edit fields (receives YAML on stdin, outputs edited YAML on stdout).
  --domain fqdn               Service domain.
  --dry-run                   Print patches without applying them.
  -e, --env <key>=<value>     Environment variables.
  --features feature          Instance features.
  -f, --field FIELD           Specify which fields to include in the output.
  --image <name>:<tag>        Image to deploy.
  --load LOAD                 Load fields from a YAML file.
  -m, --memory size           Memory allocation.
  --metro metro               Metro to deploy in.
  -n, --name name             Instance name.
  -o, --output OUTPUT         Output format. One of: kv, table, json, yaml, raw, quiet, template.
  -p, --publish <src>:<dest>[/<handlers>]  Publish port.
  --replicas n                Number of replicas.
  --restart policy            Restart policy.
  --rom image=<ref>,at=<path> Attach ROM.
  --save FILE                 Save creatable fields as YAML to a file (use - for stdout).
  --scale-to-zero <key>=<value>  Scale-to-zero options.
  policy: on | off
  cooldown-time: cooldown in ms before scaling to zero
  notify-time: notification time in ms before scaling to zero
  stateful: true | false
  --service name              Service group name or key.
  --set <name>=<value>        Key-value pairs to set on the instance.
  --set-file <name>=<filename>  Files containing key-value pairs to set on the instance.
  --template name             Create from instance template.
  --vcpus n                   Number of vCPUs.
  --visual                    Open an editor to modify fields visually.
  -v, --volume <name>:<path>[:<options>]  Attach volume.
```

## Options inherited from parent commands

```
  --config file               Path to the configuration file.
  --log-level level           Set the logging level. (default info)
  --log-type type             Set the log type. (default text)
  --profile name              Set the current profile.
  --telemetry                 Toggle anonymous usage analytics. (default true)
```

## See Also

* [`unikraft instances`](../instances.mdx): Manage Unikraft Cloud instances.

