Cloud VPS for AI backends: picking, configuring and paying for the app server in front of your LLM
Your cloud VPS for AI backends is a plain Linux box. It checks logins, enforces rate limits, runs retrieval, builds prompts and streams answers between your users and the model API. It needs a little CPU, some RAM and a solid network. It does not need a GPU. FastCPU has 25 plans billed per minute, starting at $0.0115/hr, or about $8.40 over a 730-hour month. Below: sizing by concurrency, a production setup, and keeping the bill tied to real use.
The job this server does
Your users never talk to the model directly. A service in the middle keeps the provider API key, validates the session, applies per-user quotas, fetches context from a database or vector store, builds the prompt, sends it to the model and pipes the streamed reply back to the browser. Almost none of that burns CPU. Most of the time the process sits idle on a socket. So two numbers decide the size of the box: how many connections it can keep open at once, and how much memory each one holds (request state plus whatever stream data is buffered). That is exactly the profile of a cloud VPS. A GPU only enters the picture when you run the model on your own hardware.
Plan sizes by number of open streams
| Active streams at once | vCPU | RAM | Notes |
|---|---|---|---|
| Up to 50 | 1–2 | 2 GB | Hobby projects, internal tools, staging |
| 50–300 | 2 | 4 GB | A typical production SaaS feature; run one Node or Uvicorn process per vCPU |
| 300–1,000 | 4 | 8 GB | Add a local Redis for the session cache and rate limits |
| 1,000+ | 2 × (4 vCPU / 8 GB) | — | Put two servers behind a load balancer for redundancy before buying a bigger one |
One streamed completion holds its connection open for the entire generation, anywhere from a few seconds to a minute. "Concurrent" therefore counts users who are in the middle of receiving an answer, not requests per second. Each open stream needs only tens of kilobytes of memory, as long as you forward chunks as they arrive instead of collecting the full response first. Current plans and prices are listed below.
| Plan | vCPU | RAM | Disk | $/hour | $/730 h |
|---|---|---|---|---|---|
| CPX 11 | 2 | 2 GB | 40 GB | $0.0115 | $8.40 |
| CX 23 | 2 | 4 GB | 40 GB | $0.0124 | $9.05 |
| CAX11 | 2 | 4 GB | 40 GB | $0.0132 | $9.64 |
| CX 33 | 4 | 8 GB | 80 GB | $0.0184 | $13.43 |
| CPX 21 | 3 | 4 GB | 80 GB | $0.0201 | $14.67 |
| CPX 12 | 1 | 2 GB | 40 GB | $0.0201 | $14.67 |
| CAX21 | 4 | 8 GB | 80 GB | $0.0227 | $16.57 |
| CX 43 | 8 | 16 GB | 160 GB | $0.0331 | $24.16 |
| CPX 22 | 2 | 4 GB | 80 GB | $0.0348 | $25.40 |
| CPX 31 | 4 | 8 GB | 160 GB | $0.0366 | $26.72 |
| CAX31 | 8 | 16 GB | 160 GB | $0.0443 | $32.34 |
| CX 53 | 16 | 32 GB | 320 GB | $0.0617 | $45.04 |
Per-minute billing and the servers you don't keep
Your production API runs all month. The machines around it usually don't. Staging, a preview environment per branch, a load-test target, a box for a one-off data migration: these live for hours, not weeks. Billed per minute, a preview environment that exists for a four-hour review costs four hours of the hourly rate, and the cheapest plan is $0.0115 an hour. The habit that makes this work: one script creates the server and the same script deletes it. Left running 24×7, the smallest plan comes to about $8.40 over a 730-hour month. At that price, squeezing your database and your API onto one machine to save money makes little sense.
Setting the server up properly
- Operating system. Choose Ubuntu 24.04 LTS or Debian 12 when you deploy; both are on the list. Stay on an LTS release and turn on unattended security upgrades.
- SSH and firewall. Log in with keys only and switch off password authentication. Create a non-root user for deploys. Let
ufwallow ports 22, 80 and 443 and nothing else. - Containers. Run Docker with Compose and give each service its own container: the API, the reverse proxy and, if needed, Redis. Pin every image tag.
- TLS and proxying. Caddy or Nginx handles TLS and forwards to the API. Turn buffering off on streaming routes so server-sent events reach the client the moment they are written.
- Keys and secrets. Keep the model provider's API key in an environment file that only the deploy user can read. It never goes into the image.
- Logs and metrics. Log each request in a structured format with the model id, the token counts from the
usageblock and the time to first token. Send the logs to another machine.
Check the buffering setting on purpose. If it stays on, Nginx collects the whole streamed reply and only then sends it, so the user stares at a blank screen until the model is done and streaming buys you nothing.
Where a request spends its time
Expect 50–200 ms inside your own backend for auth, retrieval and building the prompt. After that the request waits for the model's time to first token, then forwards tokens as they come. Most of the total belongs to the model. What you can control are the round trips on your side: the TLS handshake, the first byte of the request and relaying each chunk. Hosting the VPS close to your users shortens all of them. A warm connection pool to the API host saves one handshake per call. Past that point, a bigger server won't make answers arrive faster; the choice of model and provider will.
Grow wider before you grow bigger
Usually the first limit you hit is a single process, not the hardware. Run one worker per vCPU (Gunicorn with Uvicorn workers, or Node in cluster mode) and only then think about resizing. The next concern is redundancy. Two small servers behind a load balancer keep serving through a reboot; a single large one doesn't. Get state off the API box early: sessions and rate-limit counters into Redis, documents into a managed database or a dedicated database server. After that, a second API node is just a config change.
What a small stack costs
Take a realistic setup. Production is two 2 vCPU / 4 GB nodes running all the time. Staging is one node that runs during business hours only, roughly 220 hours a month. On top of that come ten preview environments a month, four hours each. Together, the variable pieces cost about a third of one always-on node, and that part of the bill moves up and down with how much the environments are actually used. The pricing page lists the current hourly rate of every plan. For hardening and sizing advice per runtime, see the rest of the cloud VPS guides.
Shipping updates with no downtime
Docker Compose on the VPS makes a zero-downtime deploy simple. Pull the new image, start the new API container on a second port, switch the reverse proxy to it, then stop the old container. For the health check, send a real request to the model provider through the new container. That one call confirms the API key, the network path and the streaming relay, not merely that the process booted. Keep the previous image tag around; rolling back is then a single command.
Rotating secrets follows the same pattern. Generate a new API key in the provider's console, write it to the environment file, restart the container, and delete the old key. Model APIs typically accept any active key on the account, so users notice nothing. Put the rotation on a schedule, and leave OS patching to unattended upgrades, so security on the box happens by routine instead of by memory.
Frequently asked questions
Does building an AI app require a GPU server?
No. Your application server reaches the model API over HTTPS and never runs the model itself. A small CPU VPS is enough for authentication, retrieval, prompt building and streaming. You only need a GPU if you decide to host the model on your own hardware.
How many users fit on a 2 vCPU / 4 GB VPS?
If the API mostly relays streamed completions, expect a few hundred active streams at the same time. That usually maps to thousands of daily active users. Confirm it with a load test that tracks open connections and memory use.
What operating systems can I choose?
At deploy time you can pick Ubuntu 24.04 LTS, Ubuntu 22.04 LTS or Debian 12. Go with an LTS release and switch on unattended security upgrades so patches land without manual work.
If a server runs 24×7, does per-minute billing cost more than a monthly plan?
A server that never stops costs its hourly rate multiplied by about 730 hours, so set that number next to any monthly plan you are considering. Per-minute billing pays off on short-lived servers, because they cost only the minutes they exist.
Can the database share the VPS with the API?
Avoid it in production. A stateless API node lets you add a second one at any time. Run PostgreSQL or your vector store on its own server, a managed service or a dedicated machine with proper storage.
Last reviewed November 7, 2026 by FastCPU. Every price and count here is pulled fresh from the live catalog each time the page loads.