Because GCP has a free tier, we can run a super tiny VM for free. And Veilid-Server is a super low resource consumer, so we can easily run a node to sustain and grow the network.
This terraform configuration will help you do that!
Because GCP doesn't (currently) charge for ephemeral ipv4 addresses, we can run a dual stack network (with both ipv4 and ipv6 configuration) for free. So this veilid node will have both enabled by default.
- Sign up for a GCP account if you don't already have one.
You shouldn't need to explicitly create a project. This configuration should set up everything you need.
-
Install the gcloud cli. The docs here are very good and easy to follow.
-
Set up authentication locally. Just run
gcloud auth application-default loginand you'll have the credentials stored for when you want to run commands via terraform.
- Add your public SSH key to the metadata in
main.tfin the format of"USER:PUBLIC_SSH_KEY_CONTENTS". I've left theveiliduser in there by default, but you can specify whichever username you want.
If you want to use a separate SSH key, then generate one in this folder like
ssh-keygen -t ed25519 -o -a 100 -f veilid-key.
-
Decide which region(s) you want to run a veilid node in, and uncomment the relevant line(s) in the
locals.free_regionsblock inlocals.tf. NOTE: only the regions infree_regionsqualify for the free tier, so use one of those unless you want to spin up a bunch of nodes and pay more. -
Run the terraform command and get a/some shiny new node(s)!
terraform init && terraform applyOutputs:
public_ip_ipv4 = [
"35.212.176.254",
]
public_ip_ipv6 = [
"2600:1900:4040:6a7:0:0:0:0",
]and you can connect via ssh like so:
ssh -i ROUTE_TO_PRIVATE_KEY veilid@IP_ADDRESS_FROM_OUTPUTNOTE: since the cloud init script takes a bit of time to run, if you SSH in immediately, you might not have access to the
veilid-clicommand for a few minutes.