# Setup Hcloud ## Step 1: - Create a new working directory - `mkdir hcloud` - `cd hcloud` - Download the hcloud binaries and setup, - `wget https://github.com/hetznercloud/cli/releases/download/v1.13.0/hcloud-linux-amd64-v1.13.0.tar.gz` - `tar -xzf hcloud-linux-amd64-v1.13.0.tar.gz` - `sudo cp hcloud-linux-amd64-v1.13.0/bin/hcloud /usr/local/bin/` - Check if the binary is working or not by using `hcloud` command. - Generate an API token in the hetzner cloud console. - link: https://console.hetzner.cloud/projects - Add a new project if there isn't one specifically meant for your work. - ![](https://i.imgur.com/HSUhqPW.png) - Inside the project on the left side pane you can see access option, click on that. - On the top left subpages you will see 3 options with one mentioning `API tokens`, click on that to create an API access token - ***save the token you will need it in further steps*** - Creating a context on the server/local machine. - `hcloud context create <context name>` - You will be prompted to enter the API token enter paste here the token you have created in the above step. - Generate SSH key ID.(you will need these ID's while launching the cloud instances) - `hcloud ssh-key create --name <ssh key display name> --public-key-from-file <ssh public key file>` - launching an instance. - `hcloud server create --image <image ID> --name <server host name> --ssh-key <ssh keys comma separated> --type <server type ID> --datacenter <data center ID>` - Command to find the Image ID `hcloud image list` - ![](https://i.imgur.com/sVfe5W7.png) - Command to list added ssh keys `hcloud ssh-key list` - Command to list available server types `hcloud server-type list` - ![](https://i.imgur.com/dGelrbS.png) - Command to list datacenters `hcloud datacenter list` (We generally use Nuremberg) - ![](https://i.imgur.com/yeTNm4S.png)