---
title: How to Deploy Spinifex on Vultr - An AWS-Compatible Infrastructure Platform
url: https://docs.vultr.com/how-to-deploy-spinifex-on-vultr-an-aws-compatible-infrastructure-platform
description: Deploy a Spinifex cluster on Vultr VX1 Cloud Compute or Bare Metal, then launch an instance, attach a volume, and store objects in S3 with the AWS CLI.
publish_date: 2026-11-05T19:39:04.060000Z
last_updated: 2026-11-06T00:32:03.094026Z
author: Aashish Chaurasiya
header_image: https://assets.vultrdevrel.com/docs-main-doc-assets-1/2675/6f328bee-461f-4c96-916d-2c0b92e67694.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

[Spinifex](https://github.com/mulgadc/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 explains how to deploy a Spinifex cluster on [VX1™ Cloud Compute](https://docs.vultr.com/products/compute/cloud-compute) instances or [Bare Metal](https://docs.vultr.com/products/compute/bare-metal) servers, and how to launch an instance, attach a volume, and store objects on it with the AWS CLI. At the end, you 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](https://docs.vultr.com/platform/iam/organizations/manage-user-api-access/how-to-create-an-api-key-for-a-user) 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 `python3` installed. macOS includes an older Bash version, so install a newer one with Homebrew.
* Install [OpenTofu](https://opentofu.org/docs/intro/install/) or [Terraform](https://developer.hashicorp.com/terraform/install) 1.5 or later, and [AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

## 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.

The following table lists the supported deployment sizes, plans, and approximate costs:

| 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.

    ```console
    $ 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.

1. Create a new key pair.

    ```console
    $ 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 :key_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.

1. Display the key fingerprint to verify that the public key is readable.

    ```console
    $ 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.

    ```console
    $ git clone https://github.com/mulgadc/spinifex.git
    ```

    The command creates a `spinifex` directory in the current directory.

1. Change to the deployment directory.

    ```console
    $ cd spinifex/scripts/terraform/vultr-spx
    ```

    The directory contains the `deploy-vultr.sh` script.

1. Export your API key as an environment variable. Replace `YOUR_API_KEY` with your API key.

    ```console
    $ 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 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-64g` for VX1™ Cloud Compute or `vbm-8c-64gb-amd` for Bare Metal. The script accepts only plans with an ID that starts with `vx1-` or `vbm-`.
* **REGION_ID**: The ID of the region where you want to deploy, such as `ord` for Chicago. To find a region ID, see the [Vultr regions list](https://api.vultr.com/v2/regions).

The following commands cover both deployment sizes:

* Deploy a single node for development:

    ```console
    $ ./deploy-vultr.sh up --plan PLAN_ID --region REGION_ID
    ```

* Deploy three nodes for production:

    ```console
    $ ./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

The status command and the cluster tools confirm that every node came up and joined the cluster.

1. Display the deployment status.

    ```console
    $ ./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.

1. Log in to the first node over SSH.

    ```console
    $ ./deploy-vultr.sh ssh
    ```

    Type `exit` and press :key_enter: to return to your workstation. Use `./deploy-vultr.sh ssh node2` to log in to another node.

1. For a multinode deployment, confirm that all nodes joined the cluster.

    ```console
    $ ./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](https://console.vultr.com/), 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.

    ```console
    $ ./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.

1. Select the `spinifex` profile.

    ```console
    $ export AWS_PROFILE=spinifex
    ```

1. List the supported instance types.

    ```console
    $ 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. After the instance runs, you can add storage and a fixed public address to it. 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.

    ```console
    $ ./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.

1. 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.

    ```console
    $ ./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.

    > [!NOTE]
    > 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.

1. Confirm that the image registered.

    ```console
    $ 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. Create a key pair in the cluster and save the private key on your workstation.

1. Create the key pair and save the private key.

    ```console
    $ 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.

1. Restrict the private key permissions.

    ```console
    $ chmod 600 ~/.ssh/spinifex-key.pem
    ```

    The command prints no output when it succeeds.

1. Verify that the cluster lists the key pair.

    ```console
    $ 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. A security group controls which traffic reaches the instance.

1. Store the default VPC ID in a variable.

    ```console
    $ VPC_ID=$(aws ec2 describe-vpcs \
        --filters Name=is-default,Values=true \
        --query 'Vpcs[0].VpcId' --output text)
    ```

    In the above command, `VPC_ID` holds the ID of the default VPC.

1. Store the default subnet ID in a variable.

    ```console
    $ SUBNET_ID=$(aws ec2 describe-subnets \
        --filters Name=default-for-az,Values=true \
        --query 'Subnets[0].SubnetId' --output text)
    ```

    In the above command, `SUBNET_ID` holds the ID of the default public subnet.

1. Create a security group.

    ```console
    $ SG_ID=$(aws ec2 create-security-group \
        --group-name spinifex-sg \
        --description "SSH access" \
        --vpc-id $VPC_ID \
        --query 'GroupId' --output text)
    ```

    The command stores the ID of the new security group in the `SG_ID` variable.

1. 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.

    ```console
    $ aws ec2 authorize-security-group-ingress \
        --group-id $SG_ID \
        --protocol tcp \
        --port 22 \
        --cidr YOUR_PUBLIC_IP/32
    ```

    The output displays the new rule for port `22`. The default security group blocks all inbound traffic, so the instance rejects SSH connections without this rule.

1. Store the ID of the imported image in a variable.

    ```console
    $ AMI_ID=$(aws ec2 describe-images \
        --filters Name=name,Values=ami-ubuntu-26.04-x86_64 \
        --query 'Images[0].ImageId' --output text)
    ```

    The command selects the image by the name that the import registered. If you imported a different image, use the name from the `describe-images` output instead.

1. Launch the instance.

    ```console
    $ 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.

1. Check the instance state and addresses.

    ```console
    $ 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.

    ```console
    $ PUBLIC_IP=$(aws ec2 describe-instances \
        --instance-ids $INSTANCE_ID \
        --query 'Reservations[0].Instances[0].PublicIpAddress' --output text)
    ```

    The `PUBLIC_IP` variable holds the public address of the instance.

1. Connect to the instance over SSH.

    ```console
    $ 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 :key_enter:. If you imported another image, replace `ubuntu` with the default user of that image.

1. On the instance, verify the outbound internet access.

    ```console
    $ curl -s http://ifconfig.me
    ```

    The output displays the public address of the instance.

1. Type `exit` and press :key_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.

    ```console
    $ 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.

1. Attach the volume to the instance.

    ```console
    $ 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.

1. Connect to the instance over SSH. Run the remaining steps in this section on the instance.

    ```console
    $ ssh -i ~/.ssh/spinifex-key.pem ubuntu@$PUBLIC_IP
    ```

1. List the disks of the instance.

    ```console
    $ 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`.

1. Create a file system on the volume. The command erases the target disk, so confirm the device name in the previous step first.

    ```console
    $ sudo mkfs.ext4 DEVICE_NAME
    ```

    The command creates an ext4 file system and prints a summary that ends with `done`.

1. Create a mount point.

    ```console
    $ sudo mkdir /mnt/data
    ```

    The command prints no output when it succeeds.

1. Mount the volume.

    ```console
    $ sudo mount DEVICE_NAME /mnt/data
    ```

    The command prints no output when it succeeds.

1. Verify that the volume is mounted.

    ```console
    $ df -h /mnt/data
    ```

    The output displays a file system of about 4.9 GB mounted at `/mnt/data`.

1. Type `exit` and press :key_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, which gives the instance an address that you control. Spinifex backs each Elastic IP address with a reserved IP address that Vultr bills while it exists, and removing the deployment releases it.

1. Allocate an Elastic IP address.

    ```console
    $ ALLOCATION_ID=$(aws ec2 allocate-address --domain vpc \
        --query 'AllocationId' --output text)
    ```

    The command stores the allocation ID of the new address in the `ALLOCATION_ID` variable.

1. Associate the address with the instance.

    ```console
    $ aws ec2 associate-address \
        --allocation-id $ALLOCATION_ID \
        --instance-id $INSTANCE_ID
    ```

    The command associates the address with the instance and displays an association ID.

1. Verify the address on the instance.

    ```console
    $ 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 status` command lists.

1. Create a bucket.

    ```console
    $ aws s3api create-bucket \
        --bucket BUCKET_NAME \
        --endpoint-url https://NODE1_ADDRESS:8443
    ```

    The output displays the location of the new bucket.

1. Create a local file to upload.

    ```console
    $ echo "hello" > hello.txt
    ```

    The command creates a local file named `hello.txt`.

1. Upload the file to the bucket.

    ```console
    $ aws s3 cp hello.txt s3://BUCKET_NAME/hello.txt \
        --endpoint-url https://NODE1_ADDRESS:8443
    ```

    The output displays an `upload` line for the file.

1. List the objects in the bucket.

    ```console
    $ 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.

## Manage the Spinifex Deployment

The same script manages the cluster after the first run. The following sections cover the commands that power nodes off and on, create additional deployments, and remove a deployment. Run each command from the directory that contains the script, in the terminal session where you exported your API key.

### Stop and Start a Node

The stop command powers a node off through the API, the same way a hardware failure would, so the node gets no chance to hand over its work. Use it on a multinode deployment to confirm that the remaining nodes keep the cluster running.

> [!WARNING]
> The power-off is immediate and interrupts any instances that run on the node.

1. Stop the second node.

    ```console
    $ ./deploy-vultr.sh stop node2
    ```

    The script confirms that it requested the power-off for the node and prints the node address.

1. Start the second node.

    ```console
    $ ./deploy-vultr.sh start node2
    ```

    The node rejoins the cluster after it boots.

1. Confirm that the node returns to the `Ready` state.

    ```console
    $ ./deploy-vultr.sh ssh 'spx get nodes'
    ```

    The output displays the second node in the `Ready` state. If the node does not appear as `Ready`, wait a few minutes and run the command again.

### Deploy Additional Clusters

Every resource the script creates carries the deployment name, which is `default` unless you set another one. A different name creates a separate deployment with its own nodes, network, and AWS profile, so you can run more than one cluster in the same account.

1. Deploy a cluster with a custom name. Replace `DEPLOYMENT_NAME` with a name of up to 24 lowercase letters, digits, and hyphens.

    ```console
    $ ./deploy-vultr.sh up --name DEPLOYMENT_NAME --plan PLAN_ID --region REGION_ID
    ```

    The AWS profile for the deployment is named `spinifex-vultr-DEPLOYMENT_NAME`.

1. Select the AWS profile of the deployment.

    ```console
    $ export AWS_PROFILE=spinifex-vultr-DEPLOYMENT_NAME
    ```

    The AWS CLI commands in this terminal session now target the named deployment.

1. Pass the same name to every other script command that targets this deployment.

    ```console
    $ ./deploy-vultr.sh status --name DEPLOYMENT_NAME
    ```

    The output lists only the resources of the named deployment.

### 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.

> [!WARNING]
> The command permanently deletes the nodes and all data stored on them, including instances, volumes, and objects.

Run the destroy command to remove the deployment:

```console
$ ./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.

## Conclusion

You have deployed a Spinifex cluster on VX1™ Cloud Compute instances or Bare Metal servers and used the AWS CLI to launch an instance, attach a volume, assign an Elastic IP address, and store objects on it. To continue, deploy a load-balanced web server with the [Nginx Web Server (Load Balanced)](https://docs.mulgadc.com/docs/nginx-alb) Terraform workbook, or manage access with [IAM users and policies](https://docs.mulgadc.com/docs/iam-users-and-policies). For more information, see the [official Spinifex documentation](https://docs.mulgadc.com/docs/vultr-integration).
