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 Type | Memory per Instance | Max Apps (Est.) | Recommended Mode |
|---|---|---|---|
| Simple Bot / Webhook | 60MB - 90MB | 8 Apps | Fork |
| Standard REST API | 150MB - 250MB | 3 Apps | Fork |
| Next.js / Nuxt SSR | 350MB - 500MB+ | 1 App | Fork / Cluster (1) |
| Heavy AI / Discord Bot | 600MB+ | 1 App | Fork (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.
- V8 Engine Overhead: The V8 engine itself needs around 20MB - 30MB just to exist.
- Module Overhead: Every time you
require()orimporta heavy library like Prisma, AWS SDK, or Mongoose, you add 10MB - 50MB to the resident set size (RSS). - 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=64to 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
- Limit Heap Size: Always use the
--max-old-space-sizeflag in your PM2 ecosystem file. For 1GB VPS, setting this to128or256prevents 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'
}
}]
}
- Avoid Cluster Mode: On a 1GB VPS (usually 1 vCPU), cluster mode adds memory overhead without giving you much performance gain. Stick to
forkmode. - 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.
- Use Alpine or Slim Base Images: If you are using Docker, keep your footprint small.
- 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: