---
title: "Configure a custom iPXE script to boot your server from the OVHcloud API"
description: "NOTE: This article is intended for experienced users who have at least basic knowledge about Preboot Execution Environment (PXE) and its implementation being us"
url: https://docs.us.ovhcloud.com/en/bare-metal-cloud/dedicated-servers/ipxe-scripts
lang: en
---
> For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt.

# Configure a custom iPXE script to boot your server from the OVHcloud API

**Warning:**

**NOTE:** This article is intended for experienced users who have at least basic knowledge about [Preboot Execution Environment (PXE)](https://en.wikipedia.org/wiki/Preboot_Execution_Environment) and its implementation being used at OVHcloud: [iPXE](https://ipxe.org/).

In the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/), it is possible to specify a boot mode among a predefined list: primary disk or rescue.\
With the [OVHcloud API](https://api.us.ovhcloud.com/), you can define custom scripts.

A custom script can be useful in the following use cases:

- You are using a volatile OS that you don't want to install on disk, and that remains only in memory.
- You have a multi-cloud strategy and one of the other cloud providers you use doesn't offer the OS you want to install, nor does it offer an alternative solution such as [Bring Your Own Image](https://docs.us.ovhcloud.com/en/bare-metal-cloud/dedicated-servers/bring-your-own-image.md).
- You want a standard installation process whatever the cloud provider is, so you have built your own rescue installation image to fully manage the complete OS installation of your dedicated server.

 

## Requirements

- A [dedicated server](https://us.ovhcloud.com/bare-metal/) **ready to be booted/rebooted** in your OVHcloud account
- Access to the [OVHcloud API](https://api.us.ovhcloud.com/)

**Warning:**

**NOTE:** Restarting a dedicated server can cause an outage of all services that only depend on this dedicated server.

 

## Instructions

### Generate an iPXE script for your dedicated server

#### Change server iPXE script

[PUT /dedicated/server/{serviceName}](https://api.us.ovhcloud.com/console/?section=/dedicated/server&branch=v1#put-/dedicated/server/-serviceName-)

Specify your script within the `bootScript` attribute directly.

 

#### Get the server iPXE script

[GET /dedicated/server/{serviceName}](https://api.us.ovhcloud.com/console/?section=/dedicated/server&branch=v1#get-/dedicated/server/-serviceName-)

You can see your script within the `bootScript` attribute.

For example, the following script chainloads the [netboot.xyz](https://netboot.xyz/) boot menu:

```
{
   "noIntervention": false,
   "name": "nsXXXXXXX.ip-XXX-XXX-XXX.us",
   "rack": "SXXXBXX",
   "commercialRange": "fs",
   "os": "debian11_64",
   "rootDevice": null,
   "rescueMail": null,
   "linkSpeed": 1000,
   "bootScript": "#!ipxe\necho Chainloading netboot.xyz\ndhcp\nchain --autofree https://boot.netboot.xyz\n",
   "reverse": "nsXXXXXXX.ip-XXX-XXX-XXX.us",
   "state": "ok",
   "ip": "XXX.XXX.XXX.XXX",
   "bootId": null,
   "newUpgradeSystem": false,
   "datacenter": "sbg3",
   "professionalUse": false,
   "supportLevel": "pro",
   "serverId": 123456,
   "powerState": "poweron",
   "monitoring": false
}
```

You can now reboot your server, and it will use your [iPXE](https://ipxe.org/) to boot.

 

### Changing boot modes

You can now switch back to disk or rescue boot from the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/) (see our guide on [Activating and using rescue mode](https://docs.us.ovhcloud.com/en/bare-metal-cloud/dedicated-servers/rescue-mode.md)), or the [OVHcloud API](https://api.us.ovhcloud.com/).

#### Switch to disk

[PUT /dedicated/server/{serviceName}](https://api.us.ovhcloud.com/console/?section=/dedicated/server&branch=v1#put-/dedicated/server/-serviceName-)

Specify `1` in the `bootId` attribute.

[GET /dedicated/server/{serviceName}](https://api.us.ovhcloud.com/console/?section=/dedicated/server&branch=v1#get-/dedicated/server/-serviceName-)

You can now see that the attribute value `bootScript` is null.

 

## Go further

[iPXE - open source boot firmware](https://ipxe.org/)

Browse all the [Dedicated Servers guides](https://docs.us.ovhcloud.com/en/bare-metal-cloud/dedicated-servers/landing-page-dedicated-servers.md).

Browse the rest of the [OVHcloud US documentation](https://docs.us.ovhcloud.com/en/index.md) for guides on our other products and services.

Learn more about [Dedicated Servers](https://us.ovhcloud.com/bare-metal/) on the OVHcloud US website.
