# How do I host a DeFi front end on a VPS?

> How do I host a DeFi front end on a VPS? Static build, nginx, Let's Encrypt and an RPC route, from $10.12 a month on Flop. No keys on it.

- URL: https://anteforge.com/defi-front-end-on-a-vps/
- Last updated: 2026-11-13
- Publisher: Anteforge (https://anteforge.com)

A static build behind nginx, a TLS certificate from certbot and an RPC route that keeps an API key out of the browser, with the settings that matter and the limits of the plan.

**Quick answer — How do I host a DeFi front end on a VPS?**

To host a DeFi front end on a VPS, build it to static files, serve them with nginx, add a Let's Encrypt certificate and keep every private key off the server. On **Anteforge**, Flop covers this at $10.12 a month on a 12-month term, as of 3 November 2026. The front end stays subject to your own law.

**In brief**

- **What runs where**: the interface in the browser, signatures in the user's wallet, contracts on chain; the VPS serves files and, optionally, relays RPC reads.
- **Plan**: Ante for static files alone; Flop (4 vCPU / 8 GB / 120 GB) for the front end, an RPC route, a small API and Redis; Turn when an indexer joins.
- **Six steps**: DNS records, nginx and a deploy account, build elsewhere and rsync, server block, certbot certificate, renewal test.
- **RPC keys stay on the server**: an nginx route takes POST only and limits each address, here to 10 requests a second.
- **On Anteforge** a front end is allowed when it is lawful for you; anything that holds user funds needs its own authorisation first.

## What does a DeFi front end need from a server?

**Very little: it is a folder of static files, and the browser does the work.** Contracts live on chain and signatures happen in the user's wallet. The server delivers the interface and, if you want, relays read calls to an RPC endpoint. A DeFi front end that holds no keys is a website with a high price on tampering, and that is how to run it.

*The four parts of a DeFi front end, where each runs and what the VPS holds*

| Part | Where it runs | What the VPS holds |
| --- | --- | --- |
| Interface (HTML, JavaScript, CSS) | The browser, delivered by nginx | The build output in `/var/www/app` |
| Signing | The user's own wallet | Nothing: no private key |
| Contracts | On chain | Nothing |
| Chain reads | An RPC endpoint | An optional nginx route |

## Which plan fits a DeFi front end?

**Flop, unless the site is static files alone.** According to Anteforge's survey of 3 November 2026, 15 hosts list a plan of at least 4 vCPU / 8 GB / 100 GB, at a median of $41.35 a month. Flop is $10.12 a month on a 12-month term, at least 25% under a named comparable plan read on 3 November 2026: AliasVPS VPS Growth, $13.50 a month in Amsterdam. Anteforge is not the least expensive at every size. All lengths are on [the pricing page](https://anteforge.com/pricing/ "How much does an Anteforge VPS cost per month?").

*Sizes are vCPU / RAM / NVMe. Three Anteforge plans and the parts of a DeFi front end each one fits, by the workload tiers of the Anteforge survey; not a benchmark*

| Plan | Size | Fits |
| --- | --- | --- |
| Ante | 2 vCPU / 4 GB / 65 GB | The static front end alone |
| Flop | 4 vCPU / 8 GB / 120 GB | The front end, an RPC route, a small API and Redis |
| Turn | 8 vCPU / 24 GB / 400 GB | All of that plus an indexer and its database |

## How do I set up the front end, step by step?

These steps assume a Debian or Ubuntu image and root over SSH. Replace `app.example.com`, `rpc.example.net` and the address with your own.

1. **Point the domain** — Create A and AAAA records for the VPS address shown in your dashboard.
2. **Install nginx and a deploy account** — Keep uploads on an account that can write the web root and nothing else.
3. **Build elsewhere and upload** — Build on your own machine or in CI from a committed lockfile, then send the output with rsync. The server never needs Node.
4. **Add the server block** — Enable the site, run nginx -t, then reload.
5. **Request the certificate** — certbot needs port 80 open to the internet, and by default it adds the redirect from HTTP to HTTPS.
6. **Test renewal** — Run the dry run once. Most installs ship a scheduled certbot renew; check with systemctl list-timers.

*Step 2, on the VPS*

```bash
apt-get update && apt-get install -y nginx rsync
useradd -m -s /bin/bash deploy
install -d -o deploy -g deploy /var/www/app
install -d -m 700 -o deploy -g deploy /home/deploy/.ssh
# paste the deploy public key into /home/deploy/.ssh/authorized_keys
```

*Step 3, on your build machine*

```bash
npm ci && npm run build
rsync -az --delete dist/ deploy@203.0.113.10:/var/www/app/
```

*Step 4: /etc/nginx/conf.d/rpc-limit.conf*

```nginx
limit_req_zone $binary_remote_addr zone=rpc:10m rate=10r/s;
```

*Step 4: /etc/nginx/sites-available/app*

```nginx
server {
    listen 80;
    listen [::]:80;
    server_name app.example.com;

    root /var/www/app;
    index index.html;

    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "no-referrer" always;
    add_header Content-Security-Policy "default-src 'self'; connect-src 'self'; frame-ancestors 'none'; base-uri 'self'" always;

    location / {
        try_files $uri $uri/ /index.html;
    }

    location /assets/ {
        expires 1y;
    }

    location = /rpc {
        limit_except POST { deny all; }
        limit_req zone=rpc burst=20 nodelay;
        limit_req_status 429;
        client_max_body_size 64k;
        proxy_pass https://rpc.example.net/v1/YOUR_KEY;
        proxy_ssl_server_name on;
        proxy_ssl_verify on;
        proxy_ssl_verify_depth 2;
        proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
    }
}
```

*Steps 4 to 6: enable, certificate, renewal test*

```bash
ln -s /etc/nginx/sites-available/app /etc/nginx/sites-enabled/app
nginx -t && systemctl reload nginx
apt-get install -y snapd
snap install --classic certbot
ln -s /snap/bin/certbot /usr/local/bin/certbot
certbot --nginx -d app.example.com
certbot renew --dry-run
```

## Why these nginx settings?

**Each one closes a mistake that is easy to make.**

- `try_files` sends unknown paths to `index.html`, so client-side routes survive a reload.
- `expires` sets the cache on hashed assets. A plain `add_header` inside that location would drop the three headers set above it, because nginx inherits them only when the current level defines none.
- `connect-src` lists where scripts may connect. Add each RPC or relay host your app calls, and nothing else: an injected script then has fewer places to send data.

## How should the front end reach an RPC endpoint?

**Through a provider or a node you run, with any API key kept on the server.** A key in a JavaScript bundle is public. The `/rpc` location keeps it in the nginx configuration, takes POST only, limits each address to 10 requests a second with bursts of 20, and answers 429 beyond that. Those two numbers are examples, so set them from your own traffic.

`proxy_ssl_verify` is off by default, so the configuration turns it on. Without it, nginx does not check whose certificate it reached.

A node of your own is a sizing question. [What VPS specs do I need to run a Bitcoin node?](https://anteforge.com/bitcoin-node-vps/ "What VPS specs do I need to run a Bitcoin node?") shows a pruned node that fits, and [which hosting providers allow Ethereum validators on a VPS?](https://anteforge.com/ethereum-node-hosting/ "Which hosting providers allow Ethereum validators on a VPS?") shows why a mainnet Ethereum node does not fit any plan here.

## What does the VPS not do for you?

**It does not filter attacks, keep copies or guard your build.** Anteforge promises no DDoS protection beyond whatever filtering the data-centre network applies by default, so a site that draws attacks needs a filtering service of its own in front of the VPS. No plan includes backups: keep your own copies off the VPS. Your repository and a clean build are the real copy of a front end. Keep the nginx files there too, and a reinstall plus one rsync brings the site back.

The worst failure is altered JavaScript that asks users to sign the wrong thing. Log in with SSH keys, keep the deploy key separate from your own, and rebuild from the lockfile, never from the server.

## Is a DeFi front end allowed at Anteforge?

**Yes, when it is lawful for you, and that assessment is yours.** The status of a front end depends on what it does and on the law that applies to you, so Anteforge states nothing general about it, and this is not legal advice. Holding every licence your activity requires, in every market you serve, is the customer’s obligation under the Anteforge terms, and so is staying within its conditions. Anteforge verifies nothing at signup: nobody asks for a licence number, reads a regulator register or approves your project before the VPS is built.

A server that holds keys or funds for users is no longer only a front end. Anything that holds customer funds, such as an exchange or a custodial wallet, needs the authorisation its market requires before it runs on Anteforge, and that authorisation is the customer’s obligation too. [Which hosting providers allow crypto wallets and exchanges?](https://anteforge.com/crypto-wallet-and-exchange-hosting/ "Which hosting providers allow crypto wallets and exchanges on their servers?") sets out that condition.

## Which questions come up most about DeFi front ends on a VPS?

### Does a DeFi front end need a database?

Not for static files. A database comes in when you add an API or an indexer, and that is when a larger plan makes sense.

### Can the server hold a wallet that signs for users?

Then it holds funds for customers, and the condition changes. Anything that holds customer funds, such as an exchange or a custodial wallet, needs the authorisation its market requires before it runs on Anteforge, and that authorisation is the customer’s obligation too.

### Which city should I pick?

Amsterdam, Frankfurt and New York: every plan in every city, at one price. Choose the city nearest most of your users. Geolocation databases decide on their own where a data-centre address sits; Anteforge promises nothing about how they label yours.

### Can a Bitcoin node share the VPS with the front end?

Yes, on a plan with room for both: set the prune value from the disk that is left. A mainnet Ethereum node does not fit any plan here, with or without a front end.

### How fast is the VPS ready?

A few minutes after the payment confirms, 1 hour at most. You can pay in BTC, USDT, USDC, ETH, SOL, LTC, XMR, as [where can I buy a VPS with Bitcoin in 2026?](https://anteforge.com/buy-a-vps-with-crypto/ "Where can I buy a VPS with Bitcoin in 2026?") explains.

**Verdict**

- **Anteforge is the better choice if** the front end is static files plus an RPC route and holds no keys: Flop runs it for $14.46 month to month, paid in crypto.
- **A host with its own DDoS filtering, or a filter in front of the VPS, is the better choice if** the front end draws attacks; and a server that signs for users is no longer a front end, so authorise it first.

## Sources

1. [Module ngx_http_core_module (try_files, limit_except)](https://nginx.org/en/docs/http/ngx_http_core_module.html) — nginx.org (read 2026-11-04)
2. [Module ngx_http_headers_module (add_header, expires)](https://nginx.org/en/docs/http/ngx_http_headers_module.html) — nginx.org (read 2026-11-04)
3. [Module ngx_http_limit_req_module](https://nginx.org/en/docs/http/ngx_http_limit_req_module.html) — nginx.org (read 2026-11-04)
4. [Module ngx_http_proxy_module (proxy_pass, proxy_ssl_verify)](https://nginx.org/en/docs/http/ngx_http_proxy_module.html) — nginx.org (read 2026-11-04)
5. [Module ngx_http_v2_module (http2)](https://nginx.org/en/docs/http/ngx_http_v2_module.html) — nginx.org (read 2026-11-04)
6. [Certbot instructions, nginx on snap](https://certbot.eff.org/instructions?ws=nginx&os=snap) — EFF (read 2026-11-04)
7. [User guide (nginx plugin, redirect, renewal, port 80)](https://eff-certbot.readthedocs.io/en/stable/using.html) — Certbot documentation (read 2026-11-04)
8. [Content-Security-Policy: connect-src directive](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/connect-src) — MDN (read 2026-11-04)

**Serve a DeFi front end from Flop** 4 shared vCPU, 8 GB RAM, 120 GB NVMe, 6 TB a month, at $10.12 a month on a 12-month term or $14.46 month to month. [Order Flop](https://anteforge.com/app/checkout/?plan=flop&from=defi-front-end-on-a-vps&lang=en) · [Order Ante for static files](https://anteforge.com/app/checkout/?plan=ante&from=defi-front-end-on-a-vps&lang=en)

---

Anteforge: Anteforge is a Linux VPS host for licensed iGaming operators and lawful crypto projects, paid in crypto with no ID at signup. It runs in Amsterdam, Frankfurt and New York and is operated by DomaineGoat LLC (Panama). Holding the licences a project needs is the customer's obligation under the terms: Anteforge verifies nothing at signup.
