This Terraform plan builds a virtual home lab environment on the Oracle Cloud Infrastructure (OCI) within the always free limits.
The following resources are deployed within the free-tier offer:
- 2x VM.Standard.E2.1.Micro instances (1 OCPU, 1 GB RAM, x86_64);
- 1x VM.Standard.A1.Flex instance (4 OCPU, 24 GB RAM, aarch64);
- An additional 59 GB volume attached to the VM.Standard.A1.Flex instance;
- A volume backup policy taking one automatic snapshot per week (retained for 5 weeks); and
- Reasonably sane configuration settings.
- Terraform v1.1.0 (or higher) installed on your PC/Mac;
- An Oracle Cloud Infrastructure (OCI) account;
- An SSH public-private key pair; and
- Basic knowledge of the Linux command line.
-
In order to deploy your home lab environment with Terraform, clone or download this repository to your computer.
-
Follow the instructions at Oracle to get these configuration parameters for the terraform.tfvars configuration file:
tenancy_oid
user_ocid
private_key_path
fingerprint
region
Please be careful with the value
private_key_path
, as this is not your SSH private key but the API signing key. -
Depending on your chosen
region
, retrieve the image ID from this page for your instances.- Choose any of your preferred images (e.g. Ubuntu, CentOS) for the VM.Standard.E2.1.Micro instances.
- Choose the
aarch64
variation of Ubuntu 20.04, Oracle Linux 7.x or Oracle Linux 8.x Linux distributions for the VM.Standard.A1.Flex instance.
-
Replace
vm_image_ocid_x86_64
in terraform.tfvars with your chosen image ID for the VM.Standard.E2.1.Micro instance. -
Replace
vm_image_ocid_ampere
in terraform.tfvars with your chosen image ID for the VM.Standard.A1.Flex instance. -
Add your SSH public key to the
ssh_authorized_keys
configuration parameter in terraform.tfvars
Once your terraform.tfvars is complete, your new home lab environment is ready for deployment.
-
Run Terraform init first:
terraform init
-
Build a Terraform plan:
terraform plan -out=tfplan
-
Deploy your home lab environment:
terraform apply "tfplan"
Congratulations! Your VMs are ready to use. Check the following section for your login details.
-
Navigate to the Instances page on the OCI dashboard to obtain the sign-in details of your new virtual instances.
-
Partition, format and mount the additional 59 GB large
/dev/sdb
volume on your VM.Standard.A1.Flex instance. -
Install all security updates on your new instances.
-
Only port
tcp/22
is open to the internet by default. If you need to allow further ports, modify the network-subnet-public.tf file to your liking. If you haveiptables
or similar running on your instance, you may need to change your firewall settings on the instance, too. -
Explore the other OCI free tier services as well.
-
Refer to the project ideas if you have some free capacity on your instances.
As Oracle is providing a generous amount of free egress traffic (10 TB/month), it is reasonable to run the following services for the community and yourself on the free tier:
- Contribute to computing tasks with the BOINC client;
- Operate a Tor relay;
- Run the Archive Team Warrior internet archiving appliance;
- Audit WPA handshakes with help_crack.py;
- Operate a Syncthing relay server;
- Run a BitTorrent server seeding Linux ISOs back to the open-source community.
- Run a Honeypot;
- Run a private VPN server;
- Host your own Unifi Controller;
- Run your own Pi-Hole or AdGuard service;
- Host your own PBX for your VoIP phones;
- Get more ideas at /r/selfhosted and awesome-selfhosted/awesome-selfhosted; or
- Receive community support from the /r/oraclecloud subreddit.