Running a Farcaster Hub For ~$50/Month
We've determined Google Cloud to be a great source of cost control for Farcaster Hubs (opens in a new tab) with a plethora of credits.
Start at cloud.google.com (opens in a new tab) to open an account with $300 credits to start. They also have a Web3 Startup Program (opens in a new tab) to earn thousands of more credits. Note this information is from 2023, so credit availability could change.
Compute Engine from the top search bar and configure an
e2-standard-2 instance, with 2 vCPUs with 8GB of memory and 20 GB of SSD
persistance. This should be ~$50. Make sure to select Ubuntu LTS as the boot
image when configuring SSD persistance.
Firewall from the top search bar and click
Create Firewall Rule.
We need to create two rules,
|Rule Name||Direction||Targets||Destination Filters||Protocols and Ports|
|Ingress||All instances in the network||Source IPv4 ranges: 0.0.0.0/0||tcp:22,2281,2282,2283,3000|
|Egress||All instances in the network||Source IPv4 ranges: 0.0.0.0/0||tcp:80,443,2281,2282,2283,3000|
Install the gcloud cli (opens in a new tab) or use the ssh button.
Then, run the following command which will walk you through installation, or follow the Hubble guide (opens in a new tab):
curl -sSL https://download.thehubble.xyz/bootstrap.sh | bash
You'll be able to access your hub with the external IP found on your compute instance.
For monitoring through Grafana, navigate to your external ip at port 3000, or see this guide on additional configuration (opens in a new tab).
To submit messages to your hub, see the submitMessage HTTP API (opens in a new tab).
Congrats on running your hub! This guide is open-source so feel free to update it!
Join our Developer Telegram (opens in a new tab) to follow along!