---
title: "Deploy an operating system onto a machine"
method: POST
path: "/v1/projects/{projectId}/machines/{id}/deploy"
tags: ["Machines"]
---

# Deploy an operating system onto a machine

`POST /v1/projects/{projectId}/machines/{id}/deploy`

Deploys an operating system onto a bare-metal machine. All data on the machine will be lost.

## Path parameters

- `projectId` string, required
- `id` string, required

## Request body

- DeployMachineOSBody
  - `customSshKeys` string[]
  - `os` string, required
  - `sshKeySource` 'SSH_KEY_SOURCE_UNKNOWN' | 'SSH_KEY_SOURCE_PROJECT' | 'SSH_KEY_SOURCE_USER' | 'SSH_KEY_SOURCE_NONE'
  - `startScript` string
  - `userData` string — DEPRECATED: use `startScript` to run a script on boot, and `sshKeySource` or `customSshKeys` to set authorized ssh keys

## Response `200`

A successful response.

- object

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/cudocompute/apis/cudo-compute-service.md) · [All operations](https://skmtc.net/cudocompute/apis/cudo-compute-service/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cudocompute/cudo-compute-service/revisions/93dc40dababc/schema)
