Spinifex is an open-source infrastructure platform that brings core Amazon Web Services (AWS) compatible services, such as compute, block storage, object storage with Simple Storage Service (S3), and Virtual Private Cloud (VPC) networking, to bare-metal, edge, and on-premises environments. Spinifex exposes AWS-compatible APIs, so the AWS Command Line Interface (CLI), AWS software development kits, and the AWS Terraform provider work against it without modification. This guide deploys a Spinifex cluster on VX1™ Cloud Compute instances or Bare Metal servers on Vultr, then launches an instance, attaches a volume, and stores objects with the AWS CLI. By the end, you'll have a working cluster that provides AWS-compatible APIs for compute, storage, and networking, along with many other AWS services.
Prerequisites
Before you begin, ensure you:
- Have a Vultr API Key with an access control list that allows requests from your workstation and from the nodes that the deployment creates.
- Have a Linux or macOS workstation with Git, Bash 4 or later, and
python3installed. macOS includes an older Bash version, so install a newer one with Homebrew. - Install OpenTofu or Terraform 1.5 or later, and AWS CLI version 2.
Choose a Deployment
You can deploy a single node for development and testing, or three nodes for a highly available cluster. Each Spinifex node runs on its own instance or server. A node reserves two virtual CPUs (vCPUs) for the host and Spinifex services, and offers the remaining vCPUs to your workloads without overcommitting.
| Use case | Spinifex nodes | Plan | Approximate cost while running |
|---|---|---|---|
| Development and testing | 1 | vx1-g-16c-64g (16 vCPUs, 64 GB RAM) | $0.48 per hour |
| Production | 3 | vx1-g-16c-64g | $1.44 per hour |
| Production on bare metal | 1 or 3 | vbm-8c-64gb-amd (8 cores, 16 threads, 64 GB RAM, 2 x 1.9 TB Non-Volatile Memory Express (NVMe) drives) | $0.55 per hour per server |
The 16-vCPU VX1™ Cloud Compute plan is the recommended minimum. Bare metal takes longer to provision, and billing starts at creation whether the server is running or stopped.
Prepare an SSH Key Pair
The deployment installs your public key on every node and uses the matching private key to connect and configure them. Verify that a key pair exists on your workstation before you deploy, and create one if it does not.
1. Check for an existing key pair:
$ ls ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub If the output lists both files, skip to the next section. If the output displays No such file or directory, continue with the next step.
2. Create a new key pair:
$ ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 In the above command:
-
-t ed25519: Sets the key type to Ed25519. -
-f ~/.ssh/id_ed25519: Sets the file name and location the deployment expects.
The command prompts you to enter a passphrase. Press Enter to leave it empty, or load a passphrase-protected key into ssh-agent with ssh-add before you deploy, because the script connects without prompting.
3. Display the key fingerprint to verify that the public key is readable:
$ ssh-keygen -lf ~/.ssh/id_ed25519.pub The output displays the key size, the fingerprint, and the key type, ED25519.
Prepare the Deployment Environment
The script in the Spinifex repository wraps OpenTofu and the Vultr Terraform provider. It creates a private VPC network and the cluster nodes, then installs Spinifex on each node over SSH and forms the cluster.
1. Clone the Spinifex repository:
$ git clone https://github.com/mulgadc/spinifex.git The command creates a spinifex directory in the current directory.
2. Change to the deployment directory:
$ cd spinifex/scripts/terraform/vultr-spx The directory contains the deploy-vultr.sh script.
3. Export your API key as an environment variable. Replace YOUR_API_KEY with your API key:
$ export VULTR_API_KEY="YOUR_API_KEY" The script copies the key to each node over SSH so Spinifex can allocate public addresses. The key does not appear in the Terraform state or the instance metadata.
Deploy the Cluster
Spinifex uses the API key to allocate a Vultr reserved IP address whenever a resource needs a public address, such as an instance in a public subnet, an Elastic IP, an internet-facing load balancer, or a network address translation (NAT) gateway. A single command provisions the infrastructure and forms the cluster.
Run the command that matches your deployment, and replace:
- PLAN_ID: The plan from the deployment table, such as
vx1-g-16c-64gfor VX1™ Cloud Compute orvbm-8c-64gb-amdfor Bare Metal. The script accepts only plans with an ID that starts withvx1-orvbm-. - REGION_ID: The ID of the region where you want to deploy, such as
ordfor Chicago. To find a region ID, see the Vultr regions list.
1. Deploy a single node for development:
$ ./deploy-vultr.sh up --plan PLAN_ID --region REGION_ID 2. Or deploy three nodes for production:
$ ./deploy-vultr.sh up --plan PLAN_ID --nodes 3 --region REGION_ID The deployment runs for a while, and the script prints no progress while a node boots, so leave the command running until it returns to the prompt. When the deployment succeeds, the script prints the API endpoint, the AWS profile name, the path to the certificate authority (CA) file, the web console address, and the node addresses.
Verify the Deployment
1. Display the deployment status:
$ ./deploy-vultr.sh status The output lists the nodes, the VPC network, the volumes, and the reserved IP addresses that the deployment owns, and the completed deployment steps.
2. Log in to the first node over SSH:
$ ./deploy-vultr.sh ssh Type exit and press Enter to return to your workstation. Use ./deploy-vultr.sh ssh node2 to log in to another node.
3. For a multinode deployment, confirm that all nodes joined the cluster:
$ ./deploy-vultr.sh ssh 'spx get nodes' Your output should be similar to the one below:
NAME │ STATUS │ ROLES │ IP │ REGION │ AZ │ UPTIME │ VMs │ SERVICES ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── node1 │ Ready │ nats:leader │ 192.0.2.4 │ us-east-1 │ us-east-1a │ 36m │ 0 │ nats,predastore,viperblock,daemon,awsgw,vpcd,ui node2 │ Ready │ nats:follower │ 192.0.2.5 │ us-east-1 │ us-east-1a │ 35m │ 0 │ nats,predastore,viperblock,daemon,awsgw,vpcd,ui node3 │ Ready │ nats:follower │ 192.0.2.3 │ us-east-1 │ us-east-1a │ 34m │ 0 │ nats,predastore,viperblock,daemon,awsgw,vpcd,ui The output displays three nodes in the Ready state. One node acts as the leader of the NATS messaging system that the cluster services use, the other two act as followers, and all three run the same services.
In the Vultr Console, navigate to Compute. The instances or servers appear with the names spinifex-default-node1, spinifex-default-node2, and spinifex-default-node3. Each one carries the spinifex tag.
Retrieve the AWS Credentials
The deployment generates an AWS-style access key pair and writes it to an AWS profile named spinifex on your workstation, with the endpoint and CA certificate preconfigured.
1. Display the credentials:
$ ./deploy-vultr.sh credentials Your output should be similar to the one below:
[spinifex] aws_access_key_id = ACCESS_KEY aws_secret_access_key = SECRET_KEY Do not redirect this output to a file or share it in chat, tickets, source control, or logs. Use the credentials to sign in to the web console at https://NODE1_ADDRESS:3000/. Replace NODE1_ADDRESS with the public address of node1, which the ./deploy-vultr.sh status command lists.
2. Select the spinifex profile:
$ export AWS_PROFILE=spinifex 3. List the supported instance types:
$ aws ec2 describe-instance-types A list of instance types confirms that the AWS CLI reaches the cluster and the installation works.
Provision an Instance
With the credentials in place, you use the AWS CLI to run workloads on the cluster the same way you would on AWS. An instance needs an operating system image to boot from, a key pair for SSH access, and a security group that controls its network traffic. Run the commands in the following sections in the same terminal session, because they rely on the profile and the shell variables you set.
Import an Image
A new cluster has no machine images. Importing a bundled operating system image registers it as an Amazon Machine Image (AMI) that instances launch from.
1. List the bundled images:
$ ./deploy-vultr.sh ssh 'spx admin images list' The output lists each image with its distribution, version, architecture, and boot mode. The bundled images include Alpine, Debian, Oracle Linux, Rocky Linux, and Ubuntu.
2. Import an image. Replace IMAGE_NAME with a name from the list, such as ubuntu-26.04-x86_64, which the later steps in this guide use:
$ ./deploy-vultr.sh ssh 'spx admin images import --name IMAGE_NAME --config /etc/spinifex/spinifex.toml' The command downloads the image, verifies its checksum, and writes it to the cluster storage. If the import fails with an Input/output error message, wait a few minutes for the cluster services to recover, and run the command again. The command reuses the image file it already downloaded.
3. Confirm that the image registered:
$ aws ec2 describe-images --query 'Images[].[ImageId,Name,State]' --output text Your output should be similar to the one below:
ami-38f95b67ff4948840 ami-ubuntu-26.04-x86_64 available Create an Instance Key Pair
Instances accept SSH logins only from the key pair you select at launch.
1. Create the key pair and save the private key:
$ aws ec2 create-key-pair --key-name spinifex-key \ --query 'KeyMaterial' --output text > ~/.ssh/spinifex-key.pem The command saves the private key to the spinifex-key.pem file and prints nothing.
2. Restrict the private key permissions:
$ chmod 600 ~/.ssh/spinifex-key.pem 3. Verify that the cluster lists the key pair:
$ aws ec2 describe-key-pairs --query 'KeyPairs[].KeyName' --output text The output displays spinifex-key.
Launch an Instance
The deployment creates a default network with a public subnet that assigns public addresses automatically, so you launch instances without building a network first.
1. Store the default VPC ID in a variable:
$ VPC_ID=$(aws ec2 describe-vpcs \ --filters Name=is-default,Values=true \ --query 'Vpcs[0].VpcId' --output text) 2. Store the default subnet ID in a variable:
$ SUBNET_ID=$(aws ec2 describe-subnets \ --filters Name=default-for-az,Values=true \ --query 'Subnets[0].SubnetId' --output text) 3. Create a security group:
$ SG_ID=$(aws ec2 create-security-group \ --group-name spinifex-sg \ --description "SSH access" \ --vpc-id $VPC_ID \ --query 'GroupId' --output text) 4. Allow SSH traffic from your workstation. Replace YOUR_PUBLIC_IP with the public IP address of your workstation, which the curl -s ifconfig.me command displays:
$ aws ec2 authorize-security-group-ingress \ --group-id $SG_ID \ --protocol tcp \ --port 22 \ --cidr YOUR_PUBLIC_IP/32 The default security group blocks all inbound traffic, so the instance rejects SSH connections without this rule.
5. Store the ID of the imported image in a variable:
$ AMI_ID=$(aws ec2 describe-images \ --filters Name=name,Values=ami-ubuntu-26.04-x86_64 \ --query 'Images[0].ImageId' --output text) If you imported a different image, use the name from the describe-images output instead.
6. Launch the instance:
$ INSTANCE_ID=$(aws ec2 run-instances \ --image-id $AMI_ID \ --instance-type t3.micro \ --key-name spinifex-key \ --subnet-id $SUBNET_ID \ --security-group-ids $SG_ID \ --count 1 \ --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=spinifex-test}]' \ --query 'Instances[0].InstanceId' --output text) Run aws ec2 describe-instance-types to list other available instance types.
7. Check the instance state and addresses:
$ aws ec2 describe-instances \ --instance-ids $INSTANCE_ID \ --query 'Reservations[0].Instances[0].[State.Name,PrivateIpAddress,PublicIpAddress]' \ --output text Your output should be similar to the one below:
running 198.51.100.5 203.0.113.10 The instance reaches the running state within a minute. The public address is a reserved IP address that Spinifex creates for the instance. To view it, navigate to Reserved IPs in the console.
Connect to the Instance
The instance runs its first-boot configuration after it reaches the running state, so SSH connections fail for about a minute. Retry the connection until the instance accepts it.
1. Store the public address in a variable:
$ PUBLIC_IP=$(aws ec2 describe-instances \ --instance-ids $INSTANCE_ID \ --query 'Reservations[0].Instances[0].PublicIpAddress' --output text) 2. Connect to the instance over SSH:
$ ssh -i ~/.ssh/spinifex-key.pem ubuntu@$PUBLIC_IP If the connection is refused, wait 30 seconds and run the command again. A connection timeout indicates that the security group blocks your IP address. On the first successful connection, SSH prompts you to confirm the host key fingerprint. Type yes and press Enter. If you imported another image, replace ubuntu with the default user of that image.
3. On the instance, verify the outbound internet access:
$ curl -s http://ifconfig.me The output displays the public address of the instance.
4. Type exit and press Enter to return to your workstation.
Attach a Volume
A block volume adds storage that exists independently of the instance. Create the volume in the same availability zone as the instance, attach it, and then format it from inside the instance.
1. Create a 5 GB volume in the availability zone of the instance:
$ VOLUME_ID=$(aws ec2 create-volume \ --availability-zone us-east-1a \ --size 5 \ --volume-type gp3 \ --query 'VolumeId' --output text) The cluster reports the us-east-1a availability zone by default, regardless of the region where you deployed.
2. Attach the volume to the instance:
$ aws ec2 attach-volume \ --volume-id $VOLUME_ID \ --instance-id $INSTANCE_ID \ --device /dev/sdf The output displays the attached state. The --device value is only a label. The instance assigns its own device name to the volume, so /dev/sdf does not appear inside the instance.
3. Connect to the instance over SSH. Run the remaining steps in this section on the instance:
$ ssh -i ~/.ssh/spinifex-key.pem ubuntu@$PUBLIC_IP 4. List the disks of the instance:
$ lsblk -o NAME,SIZE,TYPE,MOUNTPOINT The new volume is the 5 GB disk without partitions or a mount point. In the following steps, replace DEVICE_NAME with the path of that disk, such as /dev/vdb.
5. Create a file system on the volume. The command erases the target disk, so confirm the device name in the previous step first:
$ sudo mkfs.ext4 DEVICE_NAME 6. Create a mount point and mount the volume:
$ sudo mkdir /mnt/data $ sudo mount DEVICE_NAME /mnt/data 7. Verify that the volume is mounted:
$ df -h /mnt/data The output displays a file system of about 4.9 GB mounted at /mnt/data. Type exit and press Enter to return to your workstation.
Assign an Elastic IP Address
The public address that an instance receives at launch is released when the instance stops, and the instance receives a different address when it starts again. An Elastic IP address stays allocated to your account until you release it. Spinifex backs each Elastic IP address with a Vultr reserved IP address that Vultr bills while it exists, and removing the deployment releases it.
1. Allocate an Elastic IP address:
$ ALLOCATION_ID=$(aws ec2 allocate-address --domain vpc \ --query 'AllocationId' --output text) 2. Associate the address with the instance:
$ aws ec2 associate-address \ --allocation-id $ALLOCATION_ID \ --instance-id $INSTANCE_ID 3. Verify the address on the instance:
$ aws ec2 describe-instances \ --instance-ids $INSTANCE_ID \ --query 'Reservations[0].Instances[0].PublicIpAddress' --output text The output displays the Elastic IP address. SSH connections to this address reach the instance.
Store Objects in S3
The object storage service runs on a separate endpoint from the compute API. Point the AWS CLI at that endpoint, and the same profile supplies the credentials and the certificate.
In the commands in this section, replace:
- BUCKET_NAME: A bucket name you choose.
- NODE1_ADDRESS: The public address of node1, which the
./deploy-vultr.sh statuscommand lists.
1. Create a bucket:
$ aws s3api create-bucket \ --bucket BUCKET_NAME \ --endpoint-url https://NODE1_ADDRESS:8443 2. Create a local file to upload:
$ echo "hello" > hello.txt 3. Upload the file to the bucket:
$ aws s3 cp hello.txt s3://BUCKET_NAME/hello.txt \ --endpoint-url https://NODE1_ADDRESS:8443 4. List the objects in the bucket:
$ aws s3 ls s3://BUCKET_NAME/ \ --endpoint-url https://NODE1_ADDRESS:8443 The output displays the hello.txt object with its size and upload time.
Remove the Deployment
The destroy command removes the nodes, the VPC network, and every billable leftover the deployment created, including boot volumes and reserved IP addresses. Run it from the directory that contains the script, in the terminal session where you exported your API key.
Warning: The command permanently deletes the nodes and all data stored on them, including instances, volumes, and objects.
1. Run the destroy command:
$ ./deploy-vultr.sh destroy The script lists the resources it deletes and prompts you to type the deployment name, default, to confirm. To remove a named deployment, add --name DEPLOYMENT_NAME to the command. When the deletion completes, the script prints deployment 'default' destroyed; nothing of it is left in the account. If any resource remains, the script lists it and exits with an error.
Next Steps
Your Spinifex cluster is running and serving AWS-compatible APIs on Vultr. From here you can:
- Deploy a load-balanced web server with the Nginx Web Server (Load Balanced) Terraform workbook
- Manage access with IAM users and policies
- Run more than one cluster in the same account by passing
--name DEPLOYMENT_NAMEtodeploy-vultr.sh, and test failover on a three-node cluster with./deploy-vultr.sh stop node2 - Review the official Spinifex documentation for the full Vultr integration reference
For the full guide with additional tips, visit the original article on Vultr Docs.
