What is a VPC?
A VPC, or Virtual Private Cloud, is a private, isolated network that you create inside a public cloud. Your servers, databases, and other resources live inside it, and you decide who and what can reach them.
Think of a public cloud as a large office building shared by many companies. A VPC is your own locked floor in that building. Other tenants share the building, but they cannot walk into your space unless you let them.
How a VPC works
When you create a VPC, you define a private range of IP addresses for it. Everything you launch inside gets an address from that range, and traffic between those resources stays inside your private network.
You then control how that network connects to the outside world. You can keep a resource fully private, or give it a route to the internet. Nothing gets in or out unless your rules allow it.
Key components of a VPC
- IP address range (CIDR block): The pool of private addresses your VPC uses, for example 10.0.0.0/16.
- Subnets: Smaller sections of the VPC. You split your network into subnets to group resources by purpose, such as web servers in one and databases in another.
- Route tables: Rules that decide where network traffic goes.
- Internet gateway: The door that lets resources in a VPC reach the internet and be reached from it.
- NAT gateway: Lets private resources reach the internet for things like updates, without letting the internet reach them.
- Security groups and network rules: Firewall rules that control which traffic can reach each resource.
Public vs private subnets
| Subnet type | What it means | What you put there |
| Public subnet | Has a route to the internet | Web servers, load balancers |
| Private subnet | No direct route from the internet | Databases, internal apps, backend services |
A common setup puts the web server in a public subnet and the database in a private one. Users can reach the website, but nobody can connect to the database directly from the internet.
A simple example
Say you run an online store. You could set up your VPC like this:
VPC: 10.0.0.0/16
├── Public subnet (10.0.1.0/24) → load balancer, web servers
└── Private subnet (10.0.2.0/24) → database, internal services
Traffic from customers hits the load balancer in the public subnet. The web servers talk to the database over the private subnet. The database never has a public address, so it cannot be reached from the internet.
VPC vs VPN
These two get mixed up, but they do different jobs:
| Term | What it is |
| VPC | A private network environment inside the cloud where your resources run |
| VPN | An encrypted tunnel that securely connects two networks or a user to a network |
They often work together. For example, you can use a VPN to connect your office network to your VPC, so your team can reach private resources safely.
VPC vs private cloud
A private cloud is infrastructure dedicated to one organization, often on its own hardware. A VPC is a logically isolated section of a shared public cloud. You get network isolation and control, without owning the physical hardware. Our cloud computing entry explains the different deployment models.
Why use a VPC
- Security: Keep sensitive resources off the public internet and control all traffic with rules.
- Isolation: Separate environments such as development, testing, and production.
- Control: Design your own network layout, IP ranges, and routing.
- Compliance: Isolation and access control help meet data protection requirements, including India’s DPDP Act.
- Connectivity: Link to other networks through VPN or peering when needed.
VPC peering
VPC peering connects two VPCs so resources in each can talk to each other over private addresses, without going over the public internet. It is useful when separate teams or applications run in different VPCs but still need to share data.
VPC best practices
- Use private subnets for databases and internal services.
- Plan your IP ranges early. Overlapping ranges make it hard to connect networks later.
- Follow least privilege. Open only the ports and sources each resource needs.
- Separate environments. Keep production apart from development and testing.
- Monitor traffic. Review logs to spot unusual connections.
Where a VPC fits in your infrastructure
A VPC is the network layer for your cloud resources. Your virtual machines, your Kubernetes cluster, and your GPU cloud instances can all run inside it. A well-planned VPC also helps with performance, since resources in the same private network talk to each other with low latency.
A private network is the first step to keeping your workloads safe and organized. CloudPe’s cloud lets you isolate your servers in private networks with firewall controls, running in India-based data centers close to your users.