PostgreSQL on Virtual Machines

From ₹0 to Production —
The Complete VM Guide

A clear, no-fluff pricing breakdown for Indian developers. Every major provider compared with real costs in ₹ and $, Month 1 vs. ongoing — explained for beginners and intermediates.

📍 India-focused 🗓 March 2025 🎓 Beginner to Intermediate 🐘 PostgreSQL 16 💱 ₹84 = $1 USD

What is PostgreSQL, and why run it on a VM?

PostgreSQL — everyone calls it "Postgres" — is a free, open-source relational database. A relational database stores data in rows and columns, like a very powerful spreadsheet that your application can read and write to in milliseconds.

Think of it this way: your app is a restaurant. The VM (Virtual Machine) is the kitchen. PostgreSQL is the chef who organises and serves all your food — your data. Without the chef, no one eats.

💡
Beginner tip — what is a VM?
A VM (Virtual Machine) is a computer that lives in someone else's data centre. You rent it monthly. It runs 24/7 even when your laptop is off. You connect to it over SSH — a secure terminal. PostgreSQL runs on it as a background service.

You have two ways to run Postgres in the cloud:

  1. Managed Database — e.g. Supabase, AWS RDS, DigitalOcean Managed DB. Zero server management. But 5–10× more expensive for the same specs.
  2. Self-hosted on a VM — You install Postgres yourself on a rented server. Cheaper. Full control. Requires basic Linux knowledge. This entire guide is about this option.

If you're building an MVP, a startup, or a side project — self-hosting on a VM is the right call. You save 5–10× versus managed databases at equivalent specs.

Key terms before we dive into pricing

Before any pricing table makes sense, here's a quick glossary of what you're comparing.

vCPU
Virtual CPU core — the "brain speed" of your server. More cores = handles more tasks at once. 1 for dev/testing, 2+ for production.
RAM
Memory the server uses while running. Postgres caches data in RAM for fast reads. 1–2 GB for small apps, 4+ GB for real workloads.
SSD / NVMe
Storage for your database files. NVMe is faster than SSD. For Postgres, faster storage = faster queries. Prefer NVMe when available.
Bandwidth
How much data your server can send per month. Most small apps use under 100 GB/month. 1 TB is generous for starters.
KVM / ARM
KVM = standard virtualisation (runs all normal Linux software). ARM = different processor architecture — cheaper but needs minor setup adjustments.
SSH
Secure Shell — how you log in to your VM from a terminal. Like a remote control for your server. You'll use this daily.
Shared vCPU
CPU cores shared with other customers. Fine for low traffic. Under heavy load, performance can vary unpredictably.
Dedicated vCPU
CPU cores reserved only for you. Consistent, predictable performance. Costs more — essential for database servers in production.
📐
Rule of thumb for PostgreSQL memory
Postgres uses ~25% of your RAM as shared_buffers by default. On a 2 GB server that's 500 MB. Fine for small apps. For anything with 1,000+ daily users, get at least 4 GB RAM.

Tier 1 — Completely Free: Oracle Cloud Always Free

Yes, you can run PostgreSQL completely free — forever. Oracle Cloud's "Always Free" tier is the most generous free cloud offering available in 2025. No expiry. No credit card charges after signup.

01 Oracle Cloud Infrastructure (OCI) Free Forever
Oracle Cloud — Always Free Tier
Ampere A1 ARM · Lifetime, no expiry · Mumbai & Hyderabad regions
₹0
forever
SpecWhat You GetGood for Postgres?
CPU4 Ampere A1 ARM cores (3.0 GHz)✓ Excellent
RAM24 GB✓ Outstanding
Storage200 GB Block Storage (split across VMs)✓ Plenty
Bandwidth10 TB outbound / month✓ Extremely generous
OS SupportUbuntu 22.04, Oracle Linux, CentOS✓ Yes
ArchitectureARM (Ampere Altra)⚠ Minor quirks for some packages
India RegionMumbai + Hyderabad✓ Low latency in India
Bonus VMs2× AMD VMs (1/8 OCPU, 1 GB RAM each)Use for monitoring / proxy
Month 1
₹0 / $0
Includes $300 trial credit for paid services
Month 2 onwards
₹0 / $0
No renewal. No hidden charges. Truly always free.
Best for: MVPs, learning, side projects, solo developers, small startups with under 500 daily users.
⚠️
Three caveats about Oracle Always Free
1. ARM processor: Postgres installs fine on ARM Ubuntu. Some obscure extensions may lack ARM builds, but 90% of use cases have zero issues.

2. Signup: Oracle requires a credit card to verify identity but won't charge it unless you explicitly upgrade. Some Indian cards get declined — try a Visa debit or virtual card.

3. Availability: Free ARM instances can show "Out of Capacity" in popular regions. Try at off-peak hours or a different region.
The verdict
4 vCPUs, 24 GB RAM, 200 GB storage, 10 TB bandwidth — all free, forever. This is better hardware than most paid plans under ₹2,000/month. If you can get an account, start here.

Tier 2 — Budget Plans (₹373–₹1,000/mo)

If you need a standard x86 server or want simpler India-based billing in INR, these providers are your next stop. Watch closely — many have promotional first-month pricing that increases significantly at renewal.

02 Hostinger KVM VPS — India Budget · INR Billing
Hostinger KVM VPS (KVM 1 & KVM 2)
India data centre · KVM virtualisation · NVMe SSD · AMD EPYC · INR billing
₹373
promo/mo (24-mo plan)
SpecKVM 1KVM 2
vCPU1 vCPU (AMD EPYC)2 vCPU
RAM4 GB8 GB
Storage50 GB NVMe SSD100 GB NVMe SSD
Bandwidth4 TB / month8 TB / month
Architecturex86 KVM (standard)x86 KVM
India server✓ Available✓ Available
BackupsWeekly (free)Weekly (free)
Month 1 (promo, 24-mo plan)
KVM 1: ₹373 / ~$4.50
KVM 2: ₹522 / ~$6.30 · paid upfront for 24 months
Renewal Rate (after plan ends)
KVM 1: ₹449–599
KVM 2: ₹650–850 · ~60% jump at renewal — plan for this
Best for: Indian-market apps, agencies running client MVPs, budget founders who want India-region servers with fixed INR billing.
03 Vultr Cloud Compute — Foreign Budget · USD · Flat Pricing
Vultr — High Performance Cloud Compute
No India data centre · Nearest: Singapore · Hourly billing · AMD EPYC + NVMe · No promo pricing — flat rate
$6
~₹515/month
PlanSpecsUSD/mo~INR/mo
Starter1 vCPU, 1 GB RAM, 25 GB SSD, 1 TB BW$6~₹515
Basic1 vCPU, 2 GB RAM, 55 GB NVMe, 2 TB BW$12~₹1,030
Standard2 vCPU, 4 GB RAM, 80 GB NVMe, 3 TB BW$24~₹2,060
Mid4 vCPU, 8 GB RAM, 160 GB NVMe, 4 TB BW$48~₹4,120
Month 1
$6 / ₹515
No promotions — what you see is what you pay
Month 2 onwards
Same price — no hike
Only variable: USD/INR forex rate. Budget accordingly.
Best for: Developers who value transparent USD billing with no renewal surprises. Global apps where Singapore latency (~60 ms from India) is acceptable.
💱
INR-USD note for Indian users
When you pay in USD from India, your bank converts at the current rate plus typically 2–4% forex markup. At ₹84/$, a $6 plan costs roughly ₹510–520 after markup. Always factor this in when comparing USD vs. INR plans.

Tier 3 — Mid-range Plans (₹1,000–₹3,000/mo)

This tier gives you better specs and more reliable performance, suitable for apps with real users — roughly 100–2,000 daily active users with a moderately complex database.

04 DigitalOcean Droplets — Bangalore Mid-range · India DC
DigitalOcean — Basic & General Purpose Droplets
Bangalore data centre ✓ · Per-second billing · $200 free credit for new accounts (60 days) · Flat rate, no renewal hike
$6
~₹505/month
PlanSpecsUSD/mo~INR/moPostgres fit
Basic S11 vCPU, 1 GB RAM, 25 GB SSD, 1 TB$6~₹505Dev / Test only
Basic S21 vCPU, 2 GB RAM, 50 GB SSD, 2 TB$12~₹1,010Small apps
Basic S32 vCPU, 4 GB RAM, 80 GB SSD, 4 TB$24~₹2,015✓ Good
General Purpose2 vCPU, 8 GB RAM, 25 GB NVMe, 4 TB$63~₹5,290✓ Production
Month 1–2 (new accounts)
$200 free credit
Covers ~2 months of a $24/mo Droplet at zero cost
Month 3 onwards
$6–$63 / ₹505–₹5,290
No renewal hike. Backups cost 20% extra of Droplet price.
Best for: Startups serving Indian users (Bangalore DC), developers who value DigitalOcean's documentation, apps that may need to scale over time.
05 AWS Lightsail — Mumbai Mid-range · India DC
Amazon AWS Lightsail
Mumbai data centre ✓ · 3 months free on select plans for new accounts · Simple flat pricing, unlike full EC2
$3.50
~₹295/month
PlanSpecsUSD/mo~INR/moPostgres fit
Nano2 vCPU, 512 MB RAM, 20 GB SSD, 1 TB$3.50~₹295✗ Too little RAM
Micro2 vCPU, 1 GB RAM, 40 GB SSD, 2 TB$5~₹420Dev only
Small2 vCPU, 2 GB RAM, 60 GB SSD, 3 TB$10~₹840Small apps
Medium2 vCPU, 4 GB RAM, 80 GB SSD, 4 TB$20~₹1,680✓ Recommended
Large2 vCPU, 8 GB RAM, 160 GB SSD, 5 TB$40~₹3,360✓ Production
Month 1–3 (new accounts)
Free for 3 months
Applies to the $5 and $7 Micro/Small plans for new accounts
Month 4 onwards
$5–$40 / ₹420–₹3,360
No renewal hike. Data beyond quota billed at $0.09/GB.
Best for: Founders wanting AWS reliability + Mumbai region for Indian users, without full EC2 complexity. Good if you plan to grow into the AWS ecosystem.

Tier 4 — Production-Ready Plans (₹3,000+/mo)

When your app has real revenue, real users, or can't tolerate downtime — this is where you need to be. Dedicated CPUs, NVMe storage, higher RAM, and proper SLAs.

ProviderPlanCPURAMStorageUSD/mo~INR/moIndia DC?
HostingerKVM 48 vCPU16 GB200 GB NVMe~$22~₹1,850✓ Yes
HostingerKVM 88 vCPU32 GB400 GB NVMe~$45~₹3,780✓ Yes
DigitalOceanCPU-Optimized 2×2 vCPU ded.4 GB25 GB NVMe$42~₹3,530✓ Bangalore
DigitalOceanMem-Optimized2 vCPU ded.16 GB50 GB NVMe$84~₹7,060✓ Bangalore
AWS LightsailXLarge4 vCPU16 GB320 GB SSD$80~₹6,720✓ Mumbai
Vultr High-Freq4 vCPU plan4 vCPU ded.8 GB160 GB NVMe$48~₹4,030✗ Singapore nearest
Oracle OCI PaidARM VM8 OCPU ARM48 GB200 GB block~$35~₹2,940✓ Mumbai / Hyderabad
📌
Production PostgreSQL tip
For production: minimum 2 dedicated vCPUs and 4 GB RAM. Set shared_buffers to 25% of RAM, enable WAL archiving for backups, and set up daily automated snapshots. Ideally, run Postgres on a separate VM from your application server.

Full comparison table — all providers

Every provider, entry plan, first-month cost, renewal cost, and India availability. All INR calculated at ₹84 = $1 USD (March 2025) + ~3% forex markup for foreign providers.

ProviderEntry SpecsMonth 1 ₹Month 1 $Month 2+ ₹Month 2+ $India DCPromo Risk
Oracle Always Free4 vCPU ARM, 24 GB, 200 GB, 10 TB₹0$0₹0$0✓ MumbaiNone
Hostinger KVM 11 vCPU, 4 GB, 50 GB NVMe, 4 TB₹373~$4.50₹449–599~$8–9✓ YesRenewal hike
Hostinger KVM 22 vCPU, 8 GB, 100 GB NVMe, 8 TB₹522~$6.30₹650–850~$10–11✓ YesRenewal hike
Vultr Starter1 vCPU, 1 GB, 25 GB SSD, 1 TB₹515$6₹515$6✗ SingaporeNone — flat
Vultr Basic1 vCPU, 2 GB, 55 GB NVMe, 2 TB₹1,030$12₹1,030$12✗ SingaporeNone
DigitalOcean S21 vCPU, 2 GB, 50 GB SSD, 2 TB$200 creditCovered₹1,010$12✓ BangaloreNone after credit
DigitalOcean S32 vCPU, 4 GB, 80 GB SSD, 4 TB$200 creditCovered₹2,015$24✓ BangaloreNone
AWS Lightsail Small2 vCPU, 2 GB, 60 GB SSD, 3 TBFree 3 mo$0₹840$10✓ MumbaiNone after trial
AWS Lightsail Medium2 vCPU, 4 GB, 80 GB SSD, 4 TBFree 3 mo$0₹1,680$20✓ MumbaiNone

India vs. Foreign servers — what actually matters?

This is the most common question from Indian developers. Here's the practical breakdown.

FactorIndia ServerForeign Server (Singapore / US)
Latency for Indian users5–20 ms (Mumbai/Bangalore)40–120 ms (Singapore ~60 ms, US ~180 ms)
Postgres query speedFaster — lower network round-tripSlightly slower for synchronous queries
Currency riskFixed INR — no forex exposureUSD-priced — bill fluctuates with ₹/$ rate
Data residencyRequired for Indian PII / financial dataNon-compliant for certain regulated data
GST billingGST invoices, Indian billing supportGST (18%) applicable on foreign services for businesses
Who it's forIndian user base, compliance needs, INR budgetGlobal apps, USD-comfortable teams
📍
Practical answer for most Indian devs
If your users are in India → use India servers (Hostinger India, DO Bangalore, AWS Mumbai, Oracle Mumbai). Building globally or just testing → Singapore from Vultr or DO is fine. The latency difference matters far less than your query optimisation does.

How to run PostgreSQL on your VM

Once you've picked a provider and spun up an Ubuntu 22.04 VM, here's the flow to get Postgres running. This works on any provider.

1

SSH into your VM

Use the IP address and SSH key from your provider dashboard. Open your terminal and connect securely.

2

Update packages and install PostgreSQL 16

Always run a package update first, then install the official PostgreSQL 16 package from the APT repository.

3

Secure PostgreSQL

Set a strong password for the postgres user. Configure pg_hba.conf to restrict access. Bind Postgres to localhost — connect from your app via SSH tunnel.

4

Set up automated backups

Use pg_dump via a cron job, or your provider's snapshot feature. This is the step most beginners skip and regret.

5

Tune for your RAM

Edit /etc/postgresql/16/main/postgresql.conf. Set shared_buffers, work_mem, and effective_cache_size based on your server's available RAM.

# 1. SSH into your server ssh ubuntu@YOUR_SERVER_IP # 2. Update and install PostgreSQL 16 sudo apt update && sudo apt upgrade -y sudo apt install -y postgresql-16 postgresql-contrib-16 sudo systemctl status postgresql # 3. Set postgres password and create your app database sudo -u postgres psql ALTER USER postgres PASSWORD 'your_strong_password_here'; CREATE DATABASE myapp_db; CREATE USER myapp_user WITH PASSWORD 'another_strong_password'; GRANT ALL PRIVILEGES ON DATABASE myapp_db TO myapp_user; \q # 4. Tuning for a 4 GB RAM server — edit postgresql.conf shared_buffers = 1GB # 25% of RAM effective_cache_size = 3GB # 75% of RAM work_mem = 16MB # per query sort operation maintenance_work_mem = 256MB # for VACUUM, index builds # 5. Daily automated backup via cron crontab -e 0 2 * * * pg_dump -U postgres myapp_db | gzip > /backups/db-$(date +\%F).sql.gz
🐳
Optional — run Postgres in Docker
Many teams containerise Postgres with Docker Compose. This makes version upgrades and data management cleaner. Always use a named volume (pgdata) so your data survives container restarts. Set resource limits in your docker-compose.yml.

The pricing reality check

The #1 mistake developers make with VM pricing

You see ₹373/month on Hostinger. You buy it for 24 months upfront. Two years later the plan renews at ₹599/month — a 60% increase. If you weren't expecting this, it breaks your budget.

Similarly, DigitalOcean gives you $200 free credits for 60 days. After day 60, billing starts at full rate. If you scaled to a $24/month Droplet and forgot, you now owe $24/month.

The rule: Always calculate and plan for the renewal or post-credit price — not the promotional rate. Your long-term infrastructure cost is what actually matters.

Real cost over 12 months

ScenarioProvider + PlanMonth 1–3Month 4–1212-month total
Zero budget MVPOracle Always Free₹0₹0₹0
Starter Indian appHostinger KVM 1 (24 mo)₹373/mo₹373/mo (in-plan)~₹4,476 upfront
Starter + AWS trialAWS Lightsail $5 plan₹0 (3 mo free)₹420/mo × 9 mo~₹3,780 total
Dev on DO creditDigitalOcean $12 Basic₹0 (2 mo credit)₹1,010/mo × 10 mo~₹10,100 total
Flat USD billingVultr $12/mo₹1,030/mo₹1,030/mo~₹12,360 total
Production appDO General Purpose $63Credit covers it₹5,290/mo × 10 mo~₹52,900 total

Which one should you actually pick?

Your situationRecommended optionWhy
Learning Postgres / student projectOracle Always Free4 vCPU, 24 GB RAM, zero cost. Best lab you'll find.
MVP / early startup, Indian usersAWS Lightsail $10 (Mumbai)3 months free, India region, AWS reliability, flat pricing.
Budget Indian app, INR billingHostinger KVM 2 (India DC)2 vCPU, 8 GB RAM, INR pricing, India server. Lock in 24-mo rate.
Want simple flat USD billingVultr $12 or $24No promos, no renewal surprises. Pay what you see.
Small startup, planning to growDigitalOcean Basic $24 (Bangalore)Excellent docs, India DC, easy vertical scaling, $200 head start.
Production app with real revenueDO CPU-Optimized or AWS Lightsail LargeDedicated CPU, NVMe, India region. Worth paying for reliability.
Cost-conscious productionOracle OCI Paid ARMOutstanding specs per rupee. ARM is fully production-ready in 2025.
The CraftMVP recommendation for Indian startups
Start on Oracle Always Free (₹0) → validate your MVP → when you have users and revenue, migrate to DigitalOcean Basic $24/Bangalore or AWS Lightsail Medium/Mumbai. Use the $200 DO credit or 3-month AWS trial as your bridge during migration. Never pay for a database server before you have real users.

Quick checklist before going live

1

Secure your server

Disable root SSH login, configure UFW firewall, block port 5432 from public access. Only your app server should reach Postgres.

2

Set up automated backups

Daily pg_dump to Backblaze B2 ($0.006/GB/mo — cheapest option). Never rely on provider snapshots alone.

3

Set up monitoring

Use free Netdata or Prometheus + Grafana. Set a disk alert at 70% full — databases grow quietly and quickly.

4

Add connection pooling

Install PgBouncer between your app and Postgres. Prevents "too many connections" errors and improves performance significantly under load.

5

Know your scaling trigger

Generally: over 1,000 DAU → upgrade RAM. Over 10,000 DAU → dedicated CPU + read replica. Plan ahead, don't scramble under pressure.

Building an MVP or product?

CraftMVP helps startups and founders build and ship their first product — fast, affordable, and production-ready.

Visit CraftMVP → Read more guides