Skip to content

Get started with VPC

View as Markdown

Build a private network and put your first node on it. You need a MyAccount account with some credit or a payment method on file, and an SSH key saved in MyAccount so that you can sign in to the node. The whole path takes about 10 minutes, a few of them waiting for the VPC and the node to start.

A VPC is a private network in one region. Resources on it reach each other on private addresses, and that traffic stays off the public internet. That makes it the place for anything only your own servers should talk to, such as a database or an internal service.

  1. Open Network > VPC and click Create VPC.
  2. Keep the suggested VPC Name, or type one that says what the network is for, such as app-network.
  3. Under Select CIDR Option, keep E2E provided IPv4 CIDR. E2E picks a range of 512 private addresses for you, which is plenty for a first network. The other choice, Custom CIDR, is for when you need your own range or subnets; see VPC address ranges.
  4. To pay only for the hours the VPC exists while you try it out, keep Hourly under Select an Hourly / Committed Plan.
  5. Click Create VPC Network, and close the message that confirms the address range.

The VPC shows Creating in the list, then Active after a few minutes. Select it and note two things on its VPC Details tab: the CIDR, such as 10.100.74.0/23, and the private IP in Network Gateway, such as 10.100.74.1.

Create a Linux node in the same region as the VPC, the way Create a node describes, with two choices in the create form’s VPC section:

  1. Turn on Enable VPC and pick your new VPC from the list. It is marked Default, the label the list gives a VPC with an E2E provided range.
  2. To reach the node over SSH from your computer, tick Enable this option to assign a static public IPv4 address for this node.

Pick your SSH key in the form as usual, and create the node. It shows Running after a few minutes.

Sign in to the node over SSH on its public IP; see Connect to a Linux node. Then list its addresses:

ip -4 -br addr

One interface holds an address from the VPC’s range. For a VPC with the range 10.100.74.0/23, it looks like this:

lo UNKNOWN 127.0.0.1/8
ens3 UP 203.0.113.71/23
ens4 UP 10.100.74.6/23

Here ens3 carries the public address, and ens4 the node’s private IP on the VPC; the interface names depend on the operating system, so yours may differ. To check that the private network answers, ping the gateway’s private IP that you noted:

ping -c 3 10.100.74.1

Three replies come back, and the node is on your private network. Resources you put on the same VPC use this private IP, 10.100.74.6 here, to reach it.

  • Put more resources on the network: attach an existing node from its Network tab, as Attach a node to a VPC describes.
  • Keep a database or an internal port open to the VPC only, with a security group rule whose source is VPC Network; see Add or edit rules.
  • Join this VPC to another one, in the same region or the other, with Peer two VPCs.
  • For help with any message along the way, see Troubleshooting VPC.