Creating a VPS with Oracle's always free tier¶
Create an Oracle Cloud account¶
Pretty simple, create an account. You will need to provide a credit card iirc, however, we'll be creating a free tier account.
Create a VCN and Subnet¶
Before creating a compute instance, go ahead and create a Virtual Cloud Network. You can choose your root compartment, the default IPv4 CIDR Block is fine (10.0.0.0/16), and give a name to your DNS resolver.
After that is created, go to the Subnets tab and create a Subnet. You can call it public-subnet
. You can go with the example CIDR Block (10.0.0.0/24). Make sure it is set to public.
Creating your Compute Instance¶
Create one of your Always Free Tier options. Recall from the documentation:
Free Tier Options
Available Shapes Micro instances (AMD processor): All tenancies get up to two Always Free VM instances using the VM.Standard.E2.1.Micro shape, which has an AMD processor. OCI Ampere A1 Compute instances (Arm processor): All tenancies get the first 3,000 OCPU hours and 18,000 GB hours per month for free for VM instances using the VM.Standard.A1.Flex shape, which has an Arm processor. For Always Free tenancies, this is equivalent to 4 OCPUs and 24 GB of memory. In regions with multiple availability domains:
You can create OCI Ampere A1 Compute instances in any availability domain. Instances using the VM.Standard.E2.1.Micro shape can only be created in one availability domain. Number of Compute Instances Available to Your Account Depending on the size of the boot volume and the number of OCPUs that you allocate to each OCI Ampere A1 Compute instance, you can create up to four compute instances. The minimum boot volume size for each instance is 47 GB, regardless of shape. Your account comes with 200 GB of Always Free block volume storage which you use to create the boot volumes for your compute instances.
For example, using the default boot volume size of 47 GB, you could provision two instances using the VM.Standard.E2.1.Micro shape, and two OCI Ampere A1 Compute instances that each have 2 OCPUs. Or, you could provision four OCI Ampere A1 Compute instances with 1 OCPU each, and zero instances using the VM.Standard.E2.1.Micro shape. Many combinations are possible, depending on how you allocate your block storage and OCI Ampere A1 Compute OCPUs. See Details of the Always Free compute instances for more information on allocating OCPU and memory resources when creating OCI Ampere A1 Compute instances.
You do get a warning if you use all 4 OCPUs in one Ampere instance, however, I think it's just because you're right there at the max. Also, after you've configured everything, it will say that the estimated Boot Volume cost is $2/month. You can safely ignore this "estimated" cost. I'm not really sure what it shows you this in the free tier.
If you have trouble SSHing into the instance, go to the Networking tab of the instance and you may see a quick action to Connect public subnet to internet
. Take that action it try to SSH again.
Opening Ports to your instance (HTTP / HTTPS)¶
This is done in the subnet settings for the subnet we created public-subnet
. Go to the security tab and you should have a Default Security List
. Click on that and then go to the security rules. Click on Add Ingress Rules
. Create TCP rules for HTTP and HTTPS, source being 0.0.0.0/0
, IP Protocol TCP
, Source Port Range All
, destination port is 80
and 443
respectively. If setting up pangolin, create a UDP
for port 51820 as well. I'd start with the source being 0.0.0.0/0
, and in the future you may try to modify this to only allow connections to your homelab because that's all you need it for.