The script exposes the client configuration on port 80 on the IP, this is only intended to be used as a temporary solution to spin up a new server when needed.
If you do not want this behaviour and want to keep the server running, modify user_data.sh removing the line.
- Go to https://console.hetzner.cloud/projects
- Create a new project
- Within the project navigate to Access > API Tokens
- Create a new token
- Copy the token in a file named
secrets.tfvars
which will look likehcloud_token = "MY_TOKEN_CONTENT_FROM_HETZNER"
terraform init
terraform apply -var-file secrets.tfvars
- Confirm by typing
yes
when prompted - Wait for the process to finish, you should see an output that looks like:
Apply complete! Resources: 1 added, 0 changed, 1 destroyed. Outputs: server_ip = 116.203.147.163
- Open the IP (might take a little to start) and download the hetzner.conf file
- Import this in your Wireguard client
In case you want to access the created server copy the contents of your public ssh key (Usually stored at ~/.ssh/id_rsa.pub
) in secrets.tfvars
adding a line that looks like:
ssh_key = "MY_PUBLIC_SSH_KEY_CONTENT"
The default server location used is nbg1
, you can change this by modifying variables.tf
or add a line in secrets.tfvars
with:
location = "fsn1"