Provisions a DigitalOcean droplet to run a Valheim server.
- Terraform
- A DigitalOcean personal access token in an environment variable
- An SSH key in your DigitalOcean account. Note that this by default will grant any SSH key under your account access to the droplet that this script provisions.
Create a Valheim config. Make sure to update the file to your preferences:
cp ./server/valheim.sample.env ./server/valheim.env
region
- For best performance, select one that is physically closest to you.droplet_size
- This is theslug
property coming from the API. The default is set based on this recommendation.
A full list of slugs are available from the /v2/sizes
API:
curl -XGET \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/sizes?per_page=100"
Finally, run terraform apply
. You'll need to type "yes" when SSHing into your droplet for the first time.