# Add Servers

In Clouddley, a server is any compute resource (**VM, bare metal, or cloud instance**) where you deploy your workloads to. Servers lets you manage workloads from one place, deploy faster, and monitor everything together. By adding your servers to Clouddley, you can see the compute resources in use on your Clouddley account. This guide walks you through adding new servers to Clouddley and removing existing ones.

### Prerequisites

Before you begin, make sure you have:

* Have a [Clouddley](https://app.clouddley.com/) account
* Have a server with its details:
  * VM host&#x20;
  * VM port
  * VM user
* Basic familiarity with the command-line

### Add a Server

To add a server to your Clouddley account:

1. Sign in to your **Clouddley** account
2. Select **Servers**
3. Select  <mark style="color:blue;">**+**</mark> **Add Server**
4. Enter a **name** for the server
5. Complete the **VM host**, **VM user**, and **VM port** fields
6. Run the installation commands on your remote machine:

**Install Clouddley CLI**

```bash
curl -L https://raw.githubusercontent.com/clouddley/cli/main/install.sh | sh
```

**Add the SSH public key to the remote server**

```
clouddley add key
```

{% hint style="info" %}
Ensure you have the necessary permissions to run these commands.
{% endhint %}

7. Click on **Save**

<figure><img src="/files/TMmGa80S2fMycBFVH3n8" alt="Create server form" width="563"><figcaption><p>Creating a server on Clouddley</p></figcaption></figure>

You've successfully created a server on Clouddley!

### Troubleshooting Common Issues

<details>

<summary>Connection fails during setup</summary>

* Check that your VM host, port, and user details are correct
* Make sure port 22 (SSH) is open on your server
* Verify your server allows SSH connections

</details>

<details>

<summary>Permission denied when running commands</summary>

* Make sure your user has sudo privileges
* Check that you're using the correct username for your server

</details>

<details>

<summary>Server shows offline</summary>

* Confirm your server is running and accessible
* Try reconnecting by running the installation commands again

</details>

### Security Considerations

When you add a server to Clouddley:

* Clouddley adds its SSH public key to your server's authorized keys.
* All communication happens over encrypted SSH connections.
* You can revoke access by removing the Clouddley public key from your server.&#x20;

{% hint style="info" %}
Note that revoking access disrupts the connection between Clouddley and your server.
{% endhint %}

### Best Practices

* Server naming: Use descriptive names that help you quickly identify your servers.
* Regular maintenance: Run the cleanup regularly to free up disk space.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clouddley.com/servers/add-servers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
