2 minutes read

Get Started with the API

Set up API authentication, deploy an Ubuntu server with a REST request, and establish an SSH connection to the instance.
Marko Aleksic
· Updated
November 27, 2026

This tutorial shows how to use the phoenixNAP Bare Metal Cloud (BMC) API to deploy a server. You authorize the API, send a request from the BMC developer portal, and connect to the server over Secure Shell (SSH). You do not need to write any code.

Prerequisites

Log in to the BMC portal (if you are a new user, set up your account and add a payment method). You also need to create API credentials with the bmc scope. Have the Client ID and Client Secret ready, and open a terminal with an SSH client.

Step 1: Create an SSH Key

Create an SSH key pair on your computer.

1. In your terminal, create a key pair:

ssh-keygen -f ~/.ssh/bmc_keyCode language: Bash (bash)

2. Press Enter to skip the passphrase prompts.

3. Display the public key:

cat ~/.ssh/bmc_key.pubCode language: Bash (bash)

4. Copy the output. You'll paste it into the server request in Step 3.

Step 2: Authorize the API

1. Open the POST /servers endpoint page in the BMC developer portal.

2. Click Authorize.

3. Enter your Client ID and Client Secret.

4. Click Authorize.

Note

The access token is valid for 15 minutes. If a request fails with an authorization error, authorize again.

Step 3: Deploy a Server

Warning

Servers are billed hourly from the moment you deploy them, with a minimum charge of one hour. Delete the server in Step 6 to stop billing.

1. On the POST /servers page, paste the following into the Request Body field:

{
  "hostname": "my-first-server",
  "os": "ubuntu/noble",
  "type": "s0.d1.small",
  "location": "PHX",
  "sshKeys": [
    "[PUBLIC_KEY]"
  ]
}Code language: JSON / JSON with Comments (json)

Replace [PUBLIC_KEY] with the public key you copied. Paste the full line, including the ssh- prefix.

2. Click Execute.The response shows the server details. Save the id and one address from the publicIpAddresses.

Use the ID in Step 4 to fetch server details and in Step 6 to delete the server. The public IP address is required in Step 5 to connect to your server.

Below is a trimmed example of a response:

{
  "id": "[SERVER_ID]",
  "status": "creating",
  "hostname": "my-first-server",
  "publicIpAddresses": [
    "[PUBLIC_IP_ADDRESS]"
  ]
}Code language: JSON / JSON with Comments (json)

The actual response shows additional fields.

Step 4: Check the Server Status

1. Open the GET /servers/[SERVER_ID] endpoint page.

2. Expand the standard parameters section to show the serverId field.

3. Provide the id from Step 3 into the serverId field.

4. Click Execute.

Deployments take from 3 minutes to 15 minutes. When the status field shows powered-on, the server is ready. Repeat this check until the status changes.

Step 5: Connect to the Server

1. In your terminal, connect to the server:

ssh -i ~/.ssh/bmc_key ubuntu@[PUBLIC_IP]Code language: Bash (bash)

Replace [PUBLIC_IP] with the address from Step 3.

2. If prompted to trust the host, enter yes.

The terminal changes to ubuntu@my-first-server. You are now connected to your server.

Step 6: Delete the Server

Warning

Deleting a server permanently erases its data.

1. Enter exit to close the SSH connection.

2. Open the DELETE /servers/[SERVER_ID] endpoint page.

3. Expand the standard parameters field to view all fields.

4. In the serverId field, enter the id value from Step 3.

5. Click Execute.

Billing stops when the server is deleted.

Find out more

API overview