Deploy to Render (Free Tier)

How to deploy the rollup server to Render so the WASM playground talks to a real, public backend instead of localhost:3000.

Why Render

Free hosting tiers compared:

ProviderPersistent diskCredit cardCold start
RenderNo (free tier)No30-60s
Fly.ioYesRequired (after $5/7-day trial)1-2s
ShuttleLimitedNo5-10s
RailwayYesRequired< 1s

For a learning/demo project that prioritizes “no credit card”, Render wins. The trade-off is no persistent disk on free tier — sled state is lost on cold start. We handle that by re-seeding default accounts on startup.

What’s Already Set Up

This repo includes:

Deploy Steps

1. Sign up at Render

render.com, no credit card required.

2. Connect GitHub repo

3. Configure

Click Create Web Service.

4. Wait for first build (5-10 min)

Render runs:

  1. docker build .
  2. Boots a container
  3. Maps your service to a public URL

You get a URL like https://rust-zkp.onrender.com.

5. Verify

curl https://rust-zkp.onrender.com/health
# expect: ok

curl https://rust-zkp.onrender.com/accounts
# expect: JSON array with seeded accounts

6. Update WASM playground

Edit web/src/pages/demos/send.astro, accounts.astro:

<input id="server" value="https://rust-zkp.onrender.com">

Push, and GitHub Pages auto-deploys with the new default URL. Users hitting your playground will talk to your hosted server out of the box.

What to Expect

Limits to Know

ResourceFree tier
RAM512 MB
CPU0.1 shared
Bandwidth100 GB/mo
Build time90 min/mo (Docker builds)
Idle timeout15 min → scales to zero
Cold wake30-60s

For a low-traffic demo, this is plenty. If you outgrow it: move to Fly.io ($2-5/mo with persistent disk) or upgrade Render to $7/mo for always-on.

Common Pitfalls

1. “Failed to fetch” from browser

Likely CORS — but you’ve already configured Any origin, so this should work. If you hit issues:

2. App is “spinning down” / slow first request

Cold start. Hit /health to wake it before testing other endpoints.

3. Logs show panic

docker run locally first to test:

docker build -t zkp .
docker run -p 3000:3000 zkp
curl http://localhost:3000/health

4. Build fails on Render

Common reasons:

Rollback

If a deploy breaks:

That’s it.

Why No Persistent Disk on Free Tier

Render’s free tier doesn’t include persistent volumes. The container’s filesystem is ephemeral — anything written disappears on restart.

For our demo this means:

If you need persistence on Render free, you’d either:

For learning purposes, ephemeral state is acceptable — the architecture is real, just the data isn’t durable.