Vultr Deployment Playbook
Prerequisites
Whitelist your IP
You must whitelist your IP address with Vultr.
IP Whitelist
Screenshot Example
API Key
Obtain your API key from https://my.vultr.com/settings/#settingsapi
export VULTR_API_KEY="your-api-key-here"Managing Instances
Create the Vultr Instance
The command below creates a new instance with the following parameters:
plan
vc2-6c-16gb: 6 vCPUs w/ 16GB RAM and 320GB SSDos_id
2136: Debian 12 x64region
sea: Seattle, WA, USA
Update all the params starting with REPLACE_ME_ below.
curl "https://api.vultr.com/v2/instances" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"region" : "sea",
"plan" : "vc2-6c-16gb",
"label" : "${REPLACE_ME_WITH_SOME_INSTANCE_NAME}",
"os_id" : 2136,
"backups" : "disabled",
"hostname": "${REPLACE_ME_WITH_SOME_HOST_NAME}",
"tags": ["personal", "test", "cli", "${REPLACE_ME_WITH_SOME_LABEL}"]
}' \
> vultr_create.jsonRetrieve the Vultr Instance Configuration
Check the instance status at https://my.vultr.com/subs/?id=VULTR_INSTANCE_ID
export VULTR_INSTANCE_ID=$(cat vultr_create.json | jq -r '.instance.id')
echo "##############\nVisit your instance at https://my.vultr.com/subs/?id=${VULTR_INSTANCE_ID} \n##############"Get the instance details:
curl "https://api.vultr.com/v2/instances/${VULTR_INSTANCE_ID}" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
> vultr_get.jsonEnvironment Setup
Once you've created and retrieved your instance details, set up environment variables:
export VULTR_INSTANCE_ID=$(cat vultr_create.json | jq -r '.instance.id')
export VULTR_INSTANCE_IP=$(cat vultr_get.json | jq -r '.instance.main_ip')
export VULTR_PASSWORD=$(cat vultr_create.json | jq -r '.instance.default_password')Connect to Your Instance
Connect to your instance:
ssh root@$VULTR_INSTANCE_IPThe password is in vultr_create.json under instance.default_password.
Copy password to clipboard (macOS example):
cat vultr_create.json | jq -r '.instance.default_password' | pbcopySetup password-less ssh:
ssh-copy-id root@$VULTR_INSTANCE_IP[Optional] Streamline your configs
One option is to create a directory and move the JSON files there:
mkdir -p ~/workspace/vultr/server
mv vultr_create.json ~/workspace/vultr/server
mv vultr_get.json ~/workspace/vultr/server
cd ~/workspace/vultr/serverExample opinionated .env:
cat <<EOF > .env
export VULTR_INSTANCE_ID=\$(cat vultr_create.json | jq -r '.instance.id')
export VULTR_INSTANCE_IP=\$(cat vultr_get.json | jq -r '.instance.main_ip')
export VULTR_PASSWORD=\$(cat vultr_create.json | jq -r '.instance.default_password')
export VULTR_API_KEY=""
echo "##############"
echo "Visit your instance at https://my.vultr.com/subs/?id=\${VULTR_INSTANCE_ID}"
echo "##############"
echo "ssh root@\${VULTR_INSTANCE_IP}"
echo "##############"
echo "Get password by running"
echo "cat vultr_create.json | jq -r '.instance.default_password' | pbcopy"
echo "##############"
echo "Check logs by running"
echo "sudo journalctl -u cosmovisor-pocket.service -f"
echo "##############"
echo "Check height by running"
echo "curl -X GET http://localhost:26657/block | jq '.result.block.header.height'"
echo "##############"
EOFDelete Instance
curl "https://api.vultr.com/v2/instances/${VULTR_INSTANCE_ID}" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"[Optional] Prepare your instance for Pocket
Install pocketd
curl -sSL https://raw.githubusercontent.com/pokt-network/poktroll/main/tools/scripts/pocketd-install.sh | bash -s -- --tag v0.1.12-dev1 --upgradeImport or create an account
Export a key from your local machine:
pocketd keys export {key-name} --unsafe --unarmored-hex --yesImport it into your instance:
pocketd keys import {key-name} {hex-priv-key}Or create a new one:
pocketd keys add {key-name}Run a full node
See the instructions in the full node cheatsheet: https://dev.poktroll.com/operate/cheat_sheets/full_node_cheatsheet
Additional Resources
Explore Available Plans
curl "https://api.vultr.com/v2/plans" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
> vultr_plans.jsonExplore the JSON:
cat vultr_plans.json | jqExplore Available Operating Systems
curl "https://api.vultr.com/v2/os" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
> vultr_os.jsonExplore the JSON:
cat vultr_os.json | jqAdditional Links
Vultr API Documentation: https://www.vultr.com/api
Vultr CLI GitHub Repository: https://github.com/vultr/vultr-cli
Was this helpful?
