🛠️
Stacks Documentation
  • Start Here
  • 🧠Concepts
    • Stacks 101
      • What Is Stacks?
      • Bitcoin Connection
      • Proof of Transfer
      • Stacks Among Other Layers
      • Financial Incentive and Security Budget
    • Network Fundamentals
      • Network Basics
      • Mainnet and Testnets
      • Accounts
      • Authentication
      • Bitcoin Name System
      • SIPs
      • Technical Specifications
    • Block Production
      • Mining
      • Signing
      • Bitcoin Finality
      • Bitcoin Reorgs
      • Stacking
    • Transactions
      • How Transactions Work
      • Post Conditions
    • Clarity
      • Overview
      • Decidability
    • sBTC
      • Core Features
      • sBTC Operations
        • Deposit
        • Withdrawal
        • Deposit vs Withdrawal Times
      • Emily API
      • Peg Wallet UTXO
      • Clarity Contracts
        • sBTC Registry
        • sBTC Token
        • sBTC Deposit
        • sBTC Withdrawal
      • Auxiliary Features
        • Transaction Fee Sponsorship
        • Signer Wallet Rotation
      • Walkthroughs
        • Signer Process Walkthrough
        • sBTC Transaction Walkthrough
      • sBTC FAQ
    • Gaia
      • Configuration
      • Deploy Gaia Hub
      • Amazon EC2
      • Linux
      • Mac OS
  • 🛠️Guides & Tutorials
    • Developer Quickstart
    • Clarity Crash Course
    • Build a Borrowing & Lending Protocol
    • Bitcoin Integration
      • Sending Bitcoin with Leather Wallet
      • Verifying a Bitcoin Transaction
      • Parsing a Bitcoin Transaction
    • Create Tokens
      • Creating a NFT
      • Creating a Fungible Token
    • Build a Frontend
      • Post Conditions with Stacks.js
      • Authentication with Stacks.js
      • Sending Transactions with Stacks.js
    • Testing Smart Contracts
      • Fuzz Testing
    • Run a Node
      • Run a Node with Docker
      • Run a Node with Digital Ocean
      • Run a Node with a Hosted Provider
      • Run a Node with Quicknode
      • Run a Bitcoin Node
      • Run a Pruned Bitcoin Node
    • Run a Miner
      • Miner Prerequisites
      • Miner Costs and Fees
      • Mine Testnet Stacks Tokens
      • Mine Mainnet Stacks Tokens
      • Verify Miner
    • Run a Signer
      • Signer Quickstart
      • How to Read Signer Logs
      • How to Monitor a Signer
      • Best practices for running a Signer
      • OpSec Best Practices
    • sBTC
      • How to Run an sBTC Signer
      • Best practices for running an sBTC Signer
      • How to Use the sBTC Bridge
      • Earn sBTC Rewards
    • Stack STX
      • Solo Stack
      • Operate a Pool
      • Stack with a Pool
      • Increase Stacked Position
      • Stop Stacking
    • Oracles
    • Community Tutorials
  • 📚Reference
    • API
    • Clarity Types
    • Clarity Functions
    • Clarity Keywords
    • Stacks Node Configuration
    • Signer Configuration
    • Stacks Tooling
  • 🏗️Example Contracts
    • Audited Starter Contracts
    • Stacking
    • BNS
    • Multi Send
  • 🧡Press & Top Links
    • 🔶2024
      • 🔸January 2024
      • 🔸February 2024
      • 🔸March 2024
      • 🔸April 2024
      • 🔸May 2024
      • 🔸June 2024
      • 🔸July 2024
      • 🔸August 2024
      • 🔸September 2024
      • 🔸October 2024
      • 🔸November 2024
      • 🔸December 2024
    • 🔶2025
      • 🔸January 2025
      • 🔸February 2025
      • 🔸March 2025
  • 🧡Bitcoin Theses and Reports
    • 🟠Bitcoin Theses
    • 📙Bitcoin Reports
  • Contribute
Powered by GitBook
On this page
  • Introduction
  • Prerequisites
  • Setup steps
  • Accessing your Gaia hub with SSH
  • Graphical representation of the cloudformation template

Was this helpful?

  1. Concepts
  2. Gaia

Amazon EC2

PreviousDeploy Gaia HubNextLinux

Last updated 1 year ago

Was this helpful?

Introduction

The template provided on this page provides an easy way to deploy a Gaia hub directly to Amazon EC2. You can use this template to deploy your own Gaia hub to your Amazon Web Services (AWS) account. Amazon EC2 is an affordable and convenient cloud computing provider. The template provides a one-click deploy for Amazon EC2 with either S3 or EBS as a storage provider.

Prerequisites

This procedure uses Amazon CloudFormation to configure an EC2 cloud compute provider to run the Gaia hub service with an S3 or EBS provider for file storage. You should have access to an AWS account either through your personal account or through a corporate account. This account should have permissions to create resources.

Additionally, you must also own a domain name and be able to update the DNS records associated with that domain name.

Setup steps

Step 1 - Create Stack

Use a link in the table to launch the template in the AWS region that you wish to deploy a Gaia hub.

Step 2 - Setup stack using template

You need to configure the template with the appropriate values for your hub and domain it runs on.

Select Template is ready and Amazon S3 URL and enter the following Amazon S3 URL:

https://s3-external-1.amazonaws.com/cf-templates-vzldibfi2mw8-us-east-1/2022160J6G-cloudformation.yaml

If you prefer you can instead select Template is ready and Upload a template file to upload the template file cloudformation.yaml.

The latest cloudformation.yaml file can be downloaded . On most browsers you can right-click on that page and click on Save page as to download the file. Alternatively, you can copy/paste the text into a text file called cloudformation.yaml.

Then click Next.

Step 3 - Specify stack details

Specify the stack details and then click Next:

Field
Value
Notes

Stack name

a unique name in your AWS account

e.g.: my_gaia_hub

DomainName

your-domain

EmailAddress

your email address

GaiaBucketName

S3 bucket name

The template combines this name with the stack name to create a unique S3 bucket. The template ignores this field if GaiaStorageType is set to disk.

GaiaStorageType

s3 or disk

Select the GaiaStorageType of which to use as a backend for the Gaia Hub. Selecting s3 causes the template to create an S3 bucket based on the name given in the previous field. Selecting disk causes the template to attach a separate EBS volume to the EC2 instance for Hub storage.

InstanceType

t2.micro

Select the instance type you want. Default value is t2.micro.

KeyName

SSHLocation

0.0.0.0/0

Leave the SSHLocation field with the default value of 0.0.0.0/0 to enable SSH access from any IP address. If you wish to restrict SSH access to the EC2 instance to a certain IP, you can update this field.

SubnetId

subnetid

Select a public subnet

VpcId

vpcid

Step 4 - Configure stack options

Configure any stack options that fit your desired setup and click Next. All these fields are optional.

Step 5 - Review

Review the configuration of your Gaia hub, select the checkbox to acknowledge that AWS may create IAM resources with custom names and click on Create stack.

Step 6 - Retrieve the public IP of your Gaia hub

Your stack can take several minutes to launch. You can monitor the Events tab of your hub to review the current progress of the launch. When the launch is complete, the Outputs tab displays information about the hub. Select the PublicIP and copy it to configure your domain name.

Create an A DNS record pointing to the given IP in your domain.

Wait a few minutes for the DNS record to propagate, and your should be able to access your Gaia hub with SSH.

Accessing your Gaia hub with SSH

To SSH into your Gaia hub EC2 host directly, you must have the keyfile used in container creation. Access the host with the following command in your terminal:

ssh -i <your keyfile.pem> admin@<public_ip_address>

:::tip If you can only access SSH with the IP but not with the DNS name and you wish to do so, you can optionally activate it by following these steps:

Open your [AWS Console](https://console.aws.amazon.com)
Click on `Service` -> VPC
Open Your VPCs
Select your VPC connected to your Gaia Hub
Click `Actions` -> `Edit DNS Hostnames` -> Change `DNS hostnames` to `Enable`

:::

Graphical representation of the cloudformation template

In the KeyName drop-down, select an to enable SSH access to the EC2 instance. You should download the .pem keyfile for this pair from the EC2 console. For more information see the

🧠
CloudFormation
here
EC2 KeyPair
EC2 key pair documentation