> For the complete documentation index, see [llms.txt](https://thorstenkramm.gitbook.io/saltstack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thorstenkramm.gitbook.io/saltstack/salt-cloud/digitalocean.md).

# Digitalocean

### SSH Schlüsselpaar erzeugen

```bash
mkdir /etc/salt/cloud.keys.d 
ssh-keygen -N "" -t ed25519 -C "salt@digitalocean" \ 
-f /etc/salt/cloud.keys.d/digitalocean
```

### Account vorbereiten

Erzeugen Sie einen API-Token. Klicken Sie im linken Menü den Bereich »API« an.

Hinterlegen Sie den zuvor erzeugen öffentlichen Schlüssel. Dazu wählen Sie auf der linken Seite den Menüpunkt »Settings« aus.

<div><figure><img src="/files/fxn185IsyMmu5q6ai3mj" alt=""><figcaption><p>API Token erzeugen</p></figcaption></figure> <figure><img src="/files/p5os0EpXw9r51QOTtlha" alt=""><figcaption><p>SSH Schlüssel hinterlegen</p></figcaption></figure></div>

### Konfigurationsdateien anlegen

#### Cloud Provider

{% code title="/etc/salt/cloud.providers.d/digitalocean.conf " %}

```
digitalocean:
  driver: digitalocean
  personal_access_token: <TOKEN>
  ssh_key_file: /etc/salt/cloud.keys.d/digitalocean
  ssh_key_names: salt # Must match the name of your SSH pub key
  location: Frankfurt 1
  minion:
    master: <MASTER-IP-OR-FQDN>
    master_port: <MASTER-PORT>    # omit to use default 4506
    publish_port: <PUBLISH-PORT>  # omit to use default 4505
    # Make connection more fault tolerant
    tcp_keepalive_idle: 60
    tcp_keepalive_cnt: 2
    tcp_keepalive_intvl: 60
```

{% endcode %}

Testen Sie mit `salt-cloud --list-images digitalocean`, ob die Konfiguration funktioniert

#### Cloud Profile

{% code title="/etc/salt/cloud.profiles.d/digitalocean.conf " %}

```
ubuntu-s@do:
  provider: digitalocean
  image: 22.04 (LTS) x64
  size: s-1vcpu-1gb
  private_networking: False
  backups_enabled: False
  ipv6: True
  create_dns_record: False
```

{% endcode %}

### VM verwalten

Legen Sie nun eine neue VM an

```
salt-cloud -p ubuntu-s@do umar -l debug
salt umar test.ping
```

VM können mit `salt-cloud -d <MINION-ID>` wieder gelöscht werden.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://thorstenkramm.gitbook.io/saltstack/salt-cloud/digitalocean.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
