Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Build your homelab on Oracle Cloud with Terraform for free.

Notifications You must be signed in to change notification settings

gszathmari/homelab-on-oracle-cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Lab on the Oracle Cloud Infrastructure (OCI)

This Terraform plan builds a virtual home lab environment on the Oracle Cloud Infrastructure (OCI) within the always free limits.

"Buy Me A Coffee"

About the project

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.

Requirements

  • 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.

Configuration

  1. In order to deploy your home lab environment with Terraform, clone or download this repository to your computer.

  2. 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.

  3. 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.
  4. Replace vm_image_ocid_x86_64 in terraform.tfvars with your chosen image ID for the VM.Standard.E2.1.Micro instance.

  5. Replace vm_image_ocid_ampere in terraform.tfvars with your chosen image ID for the VM.Standard.A1.Flex instance.

  6. Add your SSH public key to the ssh_authorized_keys configuration parameter in terraform.tfvars

Deployment

Once your terraform.tfvars is complete, your new home lab environment is ready for deployment.

  1. Run Terraform init first:

    terraform init
  2. Build a Terraform plan:

    terraform plan -out=tfplan
  3. Deploy your home lab environment:

    terraform apply "tfplan"

Congratulations! Your VMs are ready to use. Check the following section for your login details.

Where to go from here

  • 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 have iptables 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.

Project ideas

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:

About

Build your homelab on Oracle Cloud with Terraform for free.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages