Skip to content
mulga

Spinifex on latitude.sh

Deploy Spinifex on a latitude.sh bare-metal server with one command, and run EC2, EBS, S3, VPC and more on a public latitude.sh Elastic IP.

installlatitudecloudterraform

Overview

Spinifex is an open-source infrastructure platform that brings core AWS services to bare-metal, edge, and on-prem environments. It serves the EC2, EBS, S3, VPC, IAM and STS APIs over an endpoint of your own, so the AWS CLI, the AWS SDKs and the AWS Terraform provider all work against it unmodified.

This guide runs Spinifex on one latitude.sh bare-metal server. It is the same product you would install on your own servers with Single-Node Install, so everything you build on it behaves the same wherever Spinifex runs.

Why run it on latitude.sh:

  • Hourly billing, no commitment. You pay for a bare-metal server by the hour and remove it when you are done.
  • Bare metal runs guests. Spinifex runs guests with KVM, which needs /dev/kvm, and a bare-metal server exposes it.

A virtual machine plan does not, so it cannot run guests.

  • Sites in several locations. You choose the latitude.sh site, such as DAL or LON2, so the region sits close to your users or your data.
  • Portable workloads. Your applications and Terraform code against the AWS APIs, not against latitude.sh, so they move between latitude.sh, AWS, your own rack or an edge site as a deployment decision.
  • Keep your AWS shape. VPCs, subnets, security groups, instances and volumes stay exactly as you define them today.

How Spinifex uses your latitude.sh API token

On one node the token stays on your machine. The deploy script and the Terraform provider read it from your shell to create the server and one Elastic IP, and nothing copies it to the node. Spinifex uses that Elastic IP as a static address pool: an instance in a public subnet receives it, and it returns to the pool when the instance goes away.


Prerequisites

You need:

  • A latitude.sh account with room for one server and one Elastic IP.
  • A latitude.sh API key. In the latitude.sh dashboard, open Settings, then API Keys, and choose Create API Key.

Export it as LATITUDESH_AUTH_TOKEN in step 3.

  • OpenTofu or Terraform, version 1.6 or newer. Install OpenTofu or Terraform; the deploy script uses whichever it finds, preferring OpenTofu.

The website workbook in step 7 needs 1.6.

  • The AWS CLI v2, python3 and curl.
  • No AWS credential, region or endpoint variables in your shell. Unset AWS_ENDPOINT_URL_EC2, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION if they are set, because they override the profile the deploy writes.
  • An SSH key pair at ~/.ssh/id_ed25519.

Create one with ssh-keygen -t ed25519 if you do not have one. The deploy installs the public key on the node.

The API keys page in the latitude.sh dashboard:

latitude.sh API Keys page, showing a list of API keys

Create a latitude.sh API key in the dashboard.


Instructions

1. Download Spinifex

The deploy script, deploy-latitude.sh, is in the Spinifex repository:

bash
git clone https://github.com/mulgadc/spinifex.git
cd spinifex/scripts/terraform/latitude-spx

2. Choose a deployment

UseNodesPlanCost while running
Development, testing and a first look1m4-metal-medium bare metal (AMD EPYC 9124, 16 cores, 128 GB, 2 × 1.9 TB NVMe data disks)$0.62 an hour, plus $4 a month for the Elastic IP

Check the current prices on latitude.sh before you deploy. latitude.sh bills a bare-metal server from the moment it is created, and a powered-off server still bills, so remove the deployment when you are done.

The deploy puts Spinifex's data on the largest blank NVMe disk it finds, and in our run that was a 1.9 TB disk, the largest of three.

3. Deploy

deploy-latitude.sh is a helper script around Terraform or OpenTofu and the official latitude.sh provider, so the latitude.sh side of the deployment is infrastructure as code you can read, keep and change in scripts/terraform/latitude-spx/. OpenTofu or Terraform creates a project, an SSH key, the server and one Elastic IP. The script then installs Spinifex on the server over SSH and starts it.

Spinifex on latitude.sh: deploy-latitude.sh calls the latitude.sh API to create a project, a bare-metal server and an Elastic IP, then installs Spinifex on the node over SSH; the Elastic IP routes customer traffic to a guest in a public subnet on the node

One bare-metal node, with an Elastic IP routed to a guest in a public subnet.

The node runs Ubuntu 26.04 as its host operating system, and Spinifex runs on top of it. latitude.sh installs the operating system when it creates the server, so there is no host to prepare first. The script installs the latest Spinifex release channel.

Read your API token without echoing it, so it stays out of your shell history, then run:

bash
read -rs LATITUDESH_AUTH_TOKEN
export LATITUDESH_AUTH_TOKEN

./deploy-latitude.sh up

Bare metal is slow to arrive: in our run latitude.sh delivered the server after about 10½ minutes, and the rest of up took about 3½ minutes. The default latitude.sh site is DAL; pass --site for another, such as --site LON2. Run ./deploy-latitude.sh up --help for every option.

If a site has no m4-metal-medium in stock, the deploy stops and you pick another site with --site.

If a step fails, fix the cause and run the same command again: it resumes from the step that failed.

When it finishes, the deploy prints:

ini
endpoint=https://203.0.113.10:9999
profile=spinifex-latitude-default
ca=/home/you/.spinifex/latitude-default-ca.pem
console=https://203.0.113.10:3000/
node1=203.0.113.10
elastic_ip=203.0.113.20

node1 is the server's address and elastic_ip is the public address your first instance receives.

Before it arms the node's firewall, the deploy also prints the command for the server's out-of-band console. Keep that command: it is how you log in if SSH is lost.

4. Check it worked

bash
./deploy-latitude.sh status

This prints node1 and its address, then the objects the deployment holds in your latitude.sh account by ID (the Elastic IP, project, server, SSH key and user data), then the completed deploy steps.

In the latitude.sh dashboard, the server is in the project spinifex-default, under Compute, then Bare metal, named spx-default-node1. It is the server that runs Spinifex, and the AWS workloads you create on it run inside it.

latitude.sh project Servers page, showing the Spinifex node

The Spinifex node in the latitude.sh dashboard.

The Elastic IP is under Network, then IP addresses:

latitude.sh Elastic IPs page, showing the address the deployment created

The Elastic IP the deployment created, which Spinifex hands to your first public instance.

To log in to the node:

bash
./deploy-latitude.sh ssh

5. Obtain AWS credentials

The deploy generated an AWS access key and secret on the node. Display them with:

bash
./deploy-latitude.sh credentials
WARNING

This reveals an AWS secret. Do not redirect its output, or paste the credentials into chat, tickets, source control or logs.

The output has this shape:

ini
[spinifex-latitude-default]
aws_access_key_id = <access-key>
aws_secret_access_key = <secret-key>

The browser must trust the cluster's certificate authority before the console login works, as Setting Up Your Cluster explains. The deploy already saved the CA as ~/.spinifex/latitude-default-ca.pem, which you can import instead of downloading it.

Use these to sign in to the web console at the console address the deploy printed, https://<node1 address>:3000/.

The deploy has also written them to an AWS profile named spinifex-latitude-default on your machine, with the endpoint and the cluster's certificate already set, so the AWS CLI works straight away:

bash
export AWS_PROFILE=spinifex-latitude-default
aws ec2 describe-instance-types

If this returns a list of available instance types, your installation is working.

Spinifex Web UI

The Spinifex web console, on port 3000 of the node.

Congratulations, Spinifex is installed.

6. Set up your cluster

Spinifex is running, but it holds nothing yet: no machine images, no networks, no instances.

Import the Ubuntu image on the node. This is the import part of Setting Up Your Cluster only; the next step creates its own network, key and instance:

bash
./deploy-latitude.sh ssh 'spx admin images import --name ubuntu-26.04-x86_64'

The import took 26 seconds in our run.

Do not launch the instance from Setting Up Your Cluster as well. A public instance holds the deployment's only Elastic IP, and the website in the next step needs it.

7. Launch a website

The Nginx Web Server workbook builds a VPC, a key pair, a security group and an Nginx instance, and gives the instance the Elastic IP. You run it from your own machine, against the profile the deploy wrote:

bash
cd ../../../docs/terraform-workbooks/nginx-webserver
export AWS_PROFILE=spinifex-latitude-default
tofu init
tofu apply -var region=us-east-1 \
  -var spinifex_endpoint="$(aws configure get endpoint_url)"

Use terraform in place of tofu if that is what you installed. Both -var options are required: without them the workbook targets its default region and a local endpoint.

The apply took about 2 minutes in our run. When it finishes, it prints public_ip, which equals the deploy's elastic_ip, and web_url. Open web_url in a browser, or fetch it with curl, and the page reads "Hello from Spinifex!".

Spinifex console topology view of the website instance in its VPC, with its public address

The website instance in its VPC, as the Spinifex console shows it.

Removing the deployment

Remove the website first, from the workbook directory, with the same profile and -var options as its apply:

bash
export AWS_PROFILE=spinifex-latitude-default
tofu destroy -var region=us-east-1 \
  -var spinifex_endpoint="$(aws configure get endpoint_url)"

Without those options the destroy targets the workbook's default region and a local endpoint, and removes nothing.

Then go back to the latitude-spx directory and remove the deployment:

bash
cd ../../../scripts/terraform/latitude-spx
./deploy-latitude.sh destroy

It shows what it will delete and asks you to type the deployment name, default, to confirm. It deletes the server, the Elastic IP, the SSH key, the user data and the project, each by the ID it recorded. Objects whose names match the deployment but that it did not record are listed, and are deleted only after you type delete-untracked.

The Elastic IP list in the latitude.sh API ignores pagination, so the last step asks you to check the dashboard for leftovers and to type checked. Look under Compute, then Bare metal, and under Network, then IP addresses, before you do. In our run the destroy took about 1½ minutes, including both prompts, and left nothing behind.

Limits

  • One node. Three-node deployments are not supported on latitude.sh yet.
  • One public address, so one public instance. The deployment holds a single Elastic IP, and each instance in a public subnet needs one.

A second public instance, or a load balancer that needs public addresses, has no address to take.

  • Five Elastic IPs per team. latitude.sh raises the limit on request to support.

Troubleshooting

SymptomCause and fix
shopt: inherit_errexit: invalid shell option nameYour bash is older than 4.4, which Spinifex v1.25.0 needs. Install a newer bash, for example with brew install bash, and run every command with it, including status, credentials and destroy, as $(brew --prefix)/bin/bash ./deploy-latitude.sh <command>. Releases after v1.25.0 run on the older bash.
The site has no m4-metal-medium in stockPick another site with --site.
Connection was closed before we received a valid response from endpoint URL: "http://127.0.0.1:8080/"AWS_ENDPOINT_URL_EC2, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY or AWS_DEFAULT_REGION is set in your shell and overrides the profile. Run unset on each, then export AWS_PROFILE=spinifex-latitude-default.
The workbook targets the wrong region or a local endpointPass -var region=us-east-1 and -var spinifex_endpoint="$(aws configure get endpoint_url)" to both apply and destroy.
SSH to the node stops answeringUse the out-of-band console command the deploy printed, or the Out-of-Band tab on the server in the latitude.sh dashboard. Logging in there needs a password for the ubuntu user, which you set while SSH still works: run ./deploy-latitude.sh ssh, then sudo passwd ubuntu on the node.
SERVERS_OUT_OF_STOCK from the apply, after the server orderStock levels shown before the order are not a guarantee. Run ./deploy-latitude.sh destroy, then ./deploy-latitude.sh up with another --site.
Any other failureThe logs are under ~/.spinifex/latitude/default/. up resumes from the failed step.