VPS Resource Math: How Many Node.js Apps Can You Run on 1GB RAM?

Published

VPS Resource Math: How Many Node.js Apps Can You Run on 1GB RAM?

If you are an indie hacker or a developer on a budget, the 1GB RAM VPS is your best friend. But the question always comes up: Exactly how many Node.js apps can I squeeze into a single 1GB RAM instance before it starts swapping or crashing?

The short answer is: Between 1 and 8 apps, depending entirely on how you configure your V8 engine and your process manager.

Quick Comparison: 1GB VPS Capacity

App TypeMemory per InstanceMax Apps (Est.)Recommended Mode
Simple Bot / Webhook60MB - 90MB8 AppsFork
Standard REST API150MB - 250MB3 AppsFork
Next.js / Nuxt SSR350MB - 500MB+1 AppFork / Cluster (1)
Heavy AI / Discord Bot600MB+1 AppFork (Requires Swap)

The Node.js “Memory Tax”

Every Node.js process comes with a base memory overhead. Even a “Hello World” app isn’t free.

  1. V8 Engine Overhead: The V8 engine itself needs around 20MB - 30MB just to exist.
  2. Module Overhead: Every time you require() or import a heavy library like Prisma, AWS SDK, or Mongoose, you add 10MB - 50MB to the resident set size (RSS).
  3. PM2 Overhead: If you use PM2 (and you should), each managed process adds a few MB of its own management overhead.

Real-world Scenarios for a 1GB VPS

Let’s assume your Linux OS (Ubuntu 24.04) takes about 150MB - 200MB of RAM for system services. That leaves you with roughly 800MB for your apps.

Scenario A: The Micro-Service Army (5-8 Apps)

If you are running simple Telegram bots, webhooks, or static site proxies that don’t do heavy processing, you can fit a lot.

  • Trick: Use --max-old-space-size=64 to force Node.js to garbage collect early.
  • Memory per app: ~80MB - 100MB.
  • Total capacity: ~8 apps.

Scenario B: Medium APIs with Database Connections (2-3 Apps)

This is the most common case. You have an Express/Fastify API, a connection to MongoDB/PostgreSQL, and some validation logic.

  • Memory per app: ~200MB - 300MB.
  • Total capacity: 2-3 apps comfortably.

Scenario C: The Memory Hog (1 App)

If you are running a Next.js app with SSR (Server Side Rendering) or a heavy Discord bot with thousands of cached users, a 1GB VPS is barely enough for one process.

  • Memory per app: 500MB+.
  • Total capacity: 1 app (plus a swap file just in case).

5 Tips to Squeeze More Apps into 1GB

  1. Limit Heap Size: Always use the --max-old-space-size flag in your PM2 ecosystem file. For 1GB VPS, setting this to 128 or 256 prevents a single app from ballooning and killing the server.

Example ecosystem.config.js for 1GB VPS:

module.exports = {
  apps: [{
    name: 'my-api',
    script: './dist/index.js',
    // Force GC when reaching 150MB
    node_args: '--max-old-space-size=150',
    env: {
      NODE_ENV: 'production'
    }
  }]
}
  1. Avoid Cluster Mode: On a 1GB VPS (usually 1 vCPU), cluster mode adds memory overhead without giving you much performance gain. Stick to fork mode.
  2. Enable Swap: A 1GB or 2GB swap file on an NVMe SSD can prevent “Out of Memory” (OOM) crashes during peak traffic, though it will slow down performance if used heavily.
  3. Use Alpine or Slim Base Images: If you are using Docker, keep your footprint small.
  4. Optimize Dependencies: Do you really need that massive utility library for one function? Use tree-shaking or native Node.js alternatives.

Conclusion: When should you upgrade?

If you find yourself needing more than 3 medium-sized APIs, or if your app frequently hits the swap file, it’s time to move to a 2GB or 4GB plan.

For developers in 2026, the jump from a $5 (1GB) to a $10 (4GB) plan (like Hetzner CX22) is often the best “ROI” you can get for your time and stability.


Read Next: