← All case studies

// case study 03 · developer tool · infrastructure

EasyInfra Deploy apps to servers you own

A command-line tool and local dashboard for running apps on servers in your own cloud account. It can create the server for you or set up one you already have, and it keeps the site up while you deploy new versions.

127.0.0.1:4243/#/apps
EasyInfra dashboard listing apps grouped by the servers they run on
Role
Solo: design, backend, frontend, infra
Stack
Go, OpenTofu, WireGuard, Docker, nginx, JS
Status
In active development

TL;DR

  • One Go binary runs both the dashboard and the CLI. Create a server on its own, or deploy an app and let EasyInfra create the server for it.
  • Servers run on DigitalOcean, Linode or AWS, with Ubuntu, Debian, Rocky Linux or AlmaLinux.
  • A new version only gets traffic after it passes a health check, so a single $5 server stays up during deploys. Rollback is one click.
  • Port 22 stays closed. Admin traffic goes over WireGuard, and cloud tokens stay on your computer.

01Problem

Managed platforms like Heroku are easy to use, but the bill grows with you and moving off them takes work. A plain VPS costs less, but setting one up safely means SSH hardening, a firewall, TLS, Docker and a deploy script, all of which then need patching.

EasyInfra does that setup for you. It runs on your own computer, so there's no hosted service in the middle. The server, the DNS records and the OpenTofu state live in your own accounts and folders, and you keep them if you stop using it.

02Getting started

Start with a server, or start with an app.

Provision a server

Create a server by itself and add apps to it later. This suits several small apps sharing one machine.

$ easyinfra server create web-1 \
    --provider linode --region us-east \
    --size g6-nanode-1 --os debian-13
$ easyinfra new ./api --server web-1

Deploy an app

Point it at a folder or a Git repo. If the app has nowhere to run yet, EasyInfra plans a server for it and creates it once you approve.

$ easyinfra new ./storefront \
    --provider aws \
    --region us-east-1 --size t3.small

Both paths show an OpenTofu plan and its monthly cost before anything is created, and both work the same from the dashboard. Already have a server? Pass --existing-host and EasyInfra sets that machine up instead of creating one.

03Product

The dashboard, from a project folder to a live site.

127.0.0.1:4243/#/new
New app wizard: choose a folder on this computer or a Git repository
Choose a folder or a Git repo. EasyInfra reads the project and works out how to build it.
127.0.0.1:4243/#/apps/storefront
App overview for storefront: live address, restart and rollback, and server details
Review the plan and approve it. Creating the server, locking it down, building the app and issuing HTTPS run as one job that picks up where it stopped if interrupted.
127.0.0.1:4243/#/apps/storefront/deployments
Deployments journal with live, previous, failed and restorable releases
Each deploy is recorded. Rolling back restarts the previous container, so nothing is rebuilt.
127.0.0.1:4243/#/apps/image-worker
A failed build diagnosed as out of memory, with an Add swap and retry button
A failed build says why. This one ran out of memory, and one button adds swap and tries again.
01 / 04

04Support

The clouds, operating systems and app types it handles today.

Clouds
DigitalOcean, Linode and AWS, from the dashboard or the CLI. Any server you already run, if it has a supported OS.
Cloudflare
Static sites go to Pages and Workers go to Workers, with D1 for their databases. No server needed.
Apps
Dockerfile, Next.js, Vite, Create React App, Node.js, Go and plain HTML. EasyInfra picks the build from package.json, go.mod, index.html or a Dockerfile.
Databases
PostgreSQL or MySQL in a container on the app's server, or as a managed database in your DigitalOcean or Linode account.
Your computer
macOS or Linux, with OpenTofu 1.8+ and OpenSSH.
Server operating systems
SystemDigitalOceanLinodeAWSSupported until
Ubuntu 24.04 LTS default✓✓✓May 2029
Ubuntu 26.04 LTS✓✓–May 2031
Debian 12–✓✓Jun 2028
Debian 13✓✓✓Jun 2030
Rocky Linux 9✓✓–May 2032
Rocky Linux 10✓✓–May 2035
AlmaLinux 9✓✓–May 2032
AlmaLinux 10✓✓–May 2035

Ubuntu and Debian servers use apt, UFW and unattended-upgrades. Rocky Linux and AlmaLinux use dnf, firewalld and dnf-automatic, with SELinux left in enforcing mode.

05Architecture

The engine runs on your computer. Choose a flow to follow it through the system.

EasyInfra system architecture Your computer runs the dashboard, engine, OpenTofu, a userspace WireGuard client and isolated builds. OpenTofu talks to the cloud provider API and Cloudflare DNS. The engine reaches the server only through a WireGuard tunnel. Visitors reach nginx over HTTPS, which proxies to rootless Docker containers on loopback. YOUR COMPUTER YOUR VPS · YOUR CLOUD ACCOUNT HTTPS · token in memory DNS-only A record user-data UDP 51820 · SSH inside the tunnel wrangler deploy resolve HTTPS 443 loopback Local dashboard127.0.0.1 · token link EasyInfra engineone Go binary · CLI + API OpenTofuplan · approve · apply WireGuard clientuserspace · no root Isolated buildssandboxed · no token Private state (0600)state · keys · journals Cloud provider APIDigitalOcean · Linode · AWS Visitorsany browser CloudflareDNS zone (your account)Pages · Workers · D1 cloud-init · first bootusers · bootstrap keys Firewall 80 443 51820/udp 22 ✕ nginx + Certbotper-app sites · auto TLS Rootless Docker app-web127.0.0.1:8102 candidatehealth-gated previousfor rollback postgresprivate net WireGuard 10.99.88.1sshd · pinned key

06Challenges

Challenge

Zero-downtime deploys on one server

A $5 server has no load balancer in front of it. Restarting the app to deploy takes the site down, and a broken release keeps it down.

Approach

The new version starts beside the old one on a spare port. nginx switches to it only after it passes a health check, and the old container is kept for rollback. Run each scenario below.

deploy.sh · simulation
visitors → nginx:8102 → 41d0e7c
candidateidle port
liveserving
previousstopped · kept
Challenge

Admin access without public SSH

An open SSH port gets scanned within minutes of a server coming up. Asking people to install and configure a VPN first would put most of them off.

Approach

I put a WireGuard client inside the dashboard. It runs in userspace, so it needs no root access and nothing else installed. Port 22 stays closed, and SSH, deploys, logs and database access all go through the tunnel.

wireguard · access model● tunnel up
Your computer dashboard process wireguard-go + gVisor netstack UDP 51820 · encrypted firewall Your VPS wg0 10.99.88.1 sshd (tunnel only) host key: pinned 169.254.169.254 blocked for uid ≠ 0 80 / 443 → nginx public web only internet scanner → :22 ✕
Challenge

Untrusted build scripts next to secrets

Building a project runs its install scripts, and any one of them could read a Cloudflare token sitting on the same machine.

Approach

The build and the deploy run in separate sandboxes. The build runs the project's code and never sees the token. The deploy has the token but only runs a pinned copy of wrangler on the build output.

two-phase cloudflare deploy

① Build sandbox

copied source · network on
  • ✓npm / pnpm / yarn / bun install
  • ✓npm run build (project code)
  • ✕Cloudflare API token
  • ✕home folder, keychain, sockets

② Deploy sandbox

pinned wrangler · generated config
  • ✓CLOUDFLARE_API_TOKEN
  • ✓wrangler deploy
  • ✕any project script
  • ✕paths outside the workspace

07Results

What you get once an app is deployed.

  • No downtimeA new version gets traffic only once it passes its health check. If it fails, the live site stays as it was.
  • Port 22 closedAdmin access goes through WireGuard. The only open ports are 80, 443 and the tunnel.
  • One-click rollbackThe previous container is kept, so going back restarts it without a rebuild.
  • Scales outOn DigitalOcean and Linode, one app can run on several servers behind a load balancer, so losing a server doesn't take it offline.
  • Finds known CVEsA security review checks server packages, app images and lockfiles, and puts actively exploited bugs first.
  • Nothing to migrateThe server, DNS and OpenTofu state are in your accounts. Stop using EasyInfra and the app keeps running.
Stack
GoJavaScriptOpenTofuWireGuardDockernginxCloudflareDigitalOceanLinodeAWS
Next case studyRandomSeedGen → Read