[{"data":1,"prerenderedAt":374},["ShallowReactive",2],{"page-/blog/19":3},{"id":4,"title":5,"body":6,"date":356,"description":17,"extension":357,"image":358,"meta":359,"navigation":361,"path":362,"seo":363,"short":364,"stem":365,"tags":366,"updated":372,"__hash__":373},"content/blog/19/index.md","How to get free instances in Oracle Cloud (ARM and AMD)",{"type":7,"value":8,"toc":343},"minimark",[9,14,18,21,28,33,36,72,76,83,86,91,102,161,165,168,205,216,220,223,246,257,261,264,268,271,280,284,287,317,320,324,327,336,339],[10,11,13],"h1",{"id":12},"getting-your-free-vps-in-oracle-cloud","Getting your free VPS in Oracle Cloud",[15,16,17],"p",{},"Oracle Cloud Infrastructure (OCI) offers one of the best free tiers in the market (\"Always Free\"), allowing you to create instances with AMD Micro architecture and up to 4 OCPUs and 24GB of RAM with ARM architecture. However, there is a recurring problem that many users experience: the lack of capacity or \"Out of host capacity\".",[15,19,20],{},"If you try to create the instance manually from the web console, it is very likely that you will run into this error. The solution is none other than persistence. Instead of trying manually every day, we can automate the process. In this post, I detail how I managed to get my instances from Windows using PowerShell.",[15,22,23],{},[24,25],"img",{"alt":26,"src":27},"OCI Free Tier","/blog/19/oci-free-tier.png",[29,30,32],"h2",{"id":31},"preparing-the-environment-in-windows","Preparing the Environment in Windows",[15,34,35],{},"For everything to work, we need to have the Oracle Command Line Interface (OCI CLI) installed and configured with our credentials.",[37,38,39,55,66],"ol",{},[40,41,42,46,47,54],"li",{},[43,44,45],"strong",{},"OCI CLI Installation",": On Windows, you can install it using PowerShell. Make sure you have Python installed and follow the ",[48,49,53],"a",{"href":50,"rel":51},"https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm",[52],"nofollow","official Oracle guide",".",[40,56,57,60,61,65],{},[43,58,59],{},"Configuration",": Run ",[62,63,64],"code",{},"oci setup config"," to link your environment with your account (\"Tenancy\") and configure the API keys.",[40,67,68,71],{},[43,69,70],{},"Identifiers",": You will need to gather the OCID of your Tenancy, Availability Domain, your Subnet, and the Image you want to use.",[29,73,75],{"id":74},"the-retry-process-powershell-scripts","The Retry Process (PowerShell Scripts)",[15,77,78,79,82],{},"The idea is simple: an infinite loop that tries to launch the instance and, if it receives the ",[62,80,81],{},"Out of host capacity"," error, waits a few seconds and tries again.",[15,84,85],{},"I have used two main scripts: one for the ARM instance and another for the AMD. These scripts generate their own SSH key if necessary and configure the required options.",[87,88,90],"h3",{"id":89},"script-for-arm-retry-launch-armps1","Script for ARM (retry-launch-arm.ps1)",[15,92,93,94,97,98,101],{},"This script is configured for the powerful \"VM.Standard.A1.Flex\" instance. Since it requires defining the memory and CPUs, we use auxiliary JSON files (",[62,95,96],{},"shapeConfig.json"," and ",[62,99,100],{},"instanceOptions.json",") that the script itself generates automatically.",[103,104,109],"pre",{"className":105,"code":106,"language":107,"meta":108,"style":108},"language-powershell shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Key snippet of the ARM script\n$output = & oci compute instance launch `\n    --availability-domain $AD --compartment-id $Tenancy `\n    --shape VM.Standard.A1.Flex --subnet-id $SubnetId `\n    --assign-public-ip true --availability-config $availCfg `\n    --display-name $DisplayName --image-id $ImageId `\n    --instance-options $instOpts --shape-config $shapeCfg `\n    --ssh-authorized-keys-file $SshPub 2>&1\n","powershell","",[62,110,111,119,125,131,137,143,149,155],{"__ignoreMap":108},[112,113,116],"span",{"class":114,"line":115},"line",1,[112,117,118],{},"# Key snippet of the ARM script\n",[112,120,122],{"class":114,"line":121},2,[112,123,124],{},"$output = & oci compute instance launch `\n",[112,126,128],{"class":114,"line":127},3,[112,129,130],{},"    --availability-domain $AD --compartment-id $Tenancy `\n",[112,132,134],{"class":114,"line":133},4,[112,135,136],{},"    --shape VM.Standard.A1.Flex --subnet-id $SubnetId `\n",[112,138,140],{"class":114,"line":139},5,[112,141,142],{},"    --assign-public-ip true --availability-config $availCfg `\n",[112,144,146],{"class":114,"line":145},6,[112,147,148],{},"    --display-name $DisplayName --image-id $ImageId `\n",[112,150,152],{"class":114,"line":151},7,[112,153,154],{},"    --instance-options $instOpts --shape-config $shapeCfg `\n",[112,156,158],{"class":114,"line":157},8,[112,159,160],{},"    --ssh-authorized-keys-file $SshPub 2>&1\n",[87,162,164],{"id":163},"script-for-amd-retry-launch-amdps1","Script for AMD (retry-launch-amd.ps1)",[15,166,167],{},"For the AMD instance (\"VM.Standard.E2.1.Micro\"), the configuration is much simpler since the shape is fixed and does not require complex additional options.",[103,169,171],{"className":105,"code":170,"language":107,"meta":108,"style":108},"# Key snippet of the AMD script\n$output = & oci compute instance launch `\n    --availability-domain $AD --compartment-id $Tenancy `\n    --shape VM.Standard.E2.1.Micro --subnet-id $SubnetId `\n    --assign-public-ip true `\n    --display-name $DisplayName --image-id $ImageIdAmd `\n    --ssh-authorized-keys-file $SshPub 2>&1\n",[62,172,173,178,182,186,191,196,201],{"__ignoreMap":108},[112,174,175],{"class":114,"line":115},[112,176,177],{},"# Key snippet of the AMD script\n",[112,179,180],{"class":114,"line":121},[112,181,124],{},[112,183,184],{"class":114,"line":127},[112,185,130],{},[112,187,188],{"class":114,"line":133},[112,189,190],{},"    --shape VM.Standard.E2.1.Micro --subnet-id $SubnetId `\n",[112,192,193],{"class":114,"line":139},[112,194,195],{},"    --assign-public-ip true `\n",[112,197,198],{"class":114,"line":145},[112,199,200],{},"    --display-name $DisplayName --image-id $ImageIdAmd `\n",[112,202,203],{"class":114,"line":151},[112,204,160],{},[15,206,207,208,211,212,215],{},"In both cases, the script captures the output. If the exit code is ",[62,209,210],{},"0",", we have had ",[43,213,214],{},"SUCCESS!"," and it proceeds to cyclically verify the public IP to display it in the console, leaving us ready to connect via SSH.",[29,217,219],{"id":218},"how-long-does-it-take-my-experience","How long does it take? My experience",[15,221,222],{},"Patience is key when it comes to the Oracle free tier. I left the scripts running on my Windows machine (with the help of variables and logs) and these were the results:",[224,225,226,236],"ul",{},[40,227,228,231,232,235],{},[43,229,230],{},"ARM Instance",": The process started on April 24, 2026. It successfully allocated the resources on May 6. It took about 12 days in total, restarting the process on several occasions (and adding up to ",[43,233,234],{},"292 attempts"," in the final successful streak).",[40,237,238,241,242,245],{},[43,239,240],{},"AMD Instance",": This one was much tougher. It started iterating on May 6 and the loop finally succeeded almost a month and a half later, on June 17. There were a total of ",[43,243,244],{},"700 actual attempts"," of the request. The high demand for these small instances caused the process to take considerably longer.",[15,247,248,249,252,253,256],{},"It is worth noting that the scripts are designed defensively: at the beginning they check if the instance already exists and is in a ",[62,250,251],{},"RUNNING"," or ",[62,254,255],{},"PROVISIONING"," state before attempting to launch another one. This is ideal so you can resume the execution of the script after restarting your Windows computer, avoiding duplicates.",[29,258,260],{"id":259},"background-automation-windows-scheduled-tasks","Background Automation (Windows Scheduled Tasks)",[15,262,263],{},"If you want this process to run completely unattended, without having a terminal window open and even if you restart your computer, you can configure it as a Windows Scheduled Task.",[87,265,267],{"id":266},"_1-grant-execution-permissions-in-powershell","1. Grant Execution Permissions in PowerShell",[15,269,270],{},"By default, Windows restricts the execution of unsigned scripts. You need to enable it by opening PowerShell as Administrator and running:",[103,272,274],{"className":105,"code":273,"language":107,"meta":108,"style":108},"Set-ExecutionPolicy RemoteSigned -Scope CurrentUser\n",[62,275,276],{"__ignoreMap":108},[112,277,278],{"class":114,"line":115},[112,279,273],{},[87,281,283],{"id":282},"_2-create-the-scheduled-task","2. Create the Scheduled Task",[15,285,286],{},"To create a task that runs your script in the background hidden from view when you log in, open PowerShell and run the following commands (change the script path to yours):",[103,288,290],{"className":105,"code":289,"language":107,"meta":108,"style":108},"$Action = New-ScheduledTaskAction -Execute \"powershell.exe\" -Argument \"-WindowStyle Hidden -File C:\\oci-free\\retry-launch-amd.ps1\"\n$Trigger = New-ScheduledTaskTrigger -AtLogOn\n$Principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -LogonType Interactive\n$Task = New-ScheduledTask -Action $Action -Trigger $Trigger -Principal $Principal\nRegister-ScheduledTask -TaskName \"OCI AMD Retry\" -InputObject $Task\n",[62,291,292,297,302,307,312],{"__ignoreMap":108},[112,293,294],{"class":114,"line":115},[112,295,296],{},"$Action = New-ScheduledTaskAction -Execute \"powershell.exe\" -Argument \"-WindowStyle Hidden -File C:\\oci-free\\retry-launch-amd.ps1\"\n",[112,298,299],{"class":114,"line":121},[112,300,301],{},"$Trigger = New-ScheduledTaskTrigger -AtLogOn\n",[112,303,304],{"class":114,"line":127},[112,305,306],{},"$Principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -LogonType Interactive\n",[112,308,309],{"class":114,"line":133},[112,310,311],{},"$Task = New-ScheduledTask -Action $Action -Trigger $Trigger -Principal $Principal\n",[112,313,314],{"class":114,"line":139},[112,315,316],{},"Register-ScheduledTask -TaskName \"OCI AMD Retry\" -InputObject $Task\n",[15,318,319],{},"With this, every time you turn on your PC and log in, the script will start and stay in the shadows trying to reserve your server.",[87,321,323],{"id":322},"_3-stop-and-delete-the-task","3. Stop and Delete the Task",[15,325,326],{},"Once you verify in the log that you have been successful (your public IP will appear), it is important that you stop the loop so you don't keep sending requests to Oracle unnecessarily. To delete the task and clean your PC, simply run in PowerShell:",[103,328,330],{"className":105,"code":329,"language":107,"meta":108,"style":108},"Unregister-ScheduledTask -TaskName \"OCI AMD Retry\" -Confirm:$false\n",[62,331,332],{"__ignoreMap":108},[112,333,334],{"class":114,"line":115},[112,335,329],{},[15,337,338],{},"Sooner or later, Oracle will free up resources and the script will grab that capacity for you completely unattended. Lots of patience and good luck!",[340,341,342],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":108,"searchDepth":115,"depth":121,"links":344},[345,346,350,351],{"id":31,"depth":121,"text":32},{"id":74,"depth":121,"text":75,"children":347},[348,349],{"id":89,"depth":127,"text":90},{"id":163,"depth":127,"text":164},{"id":218,"depth":121,"text":219},{"id":259,"depth":121,"text":260,"children":352},[353,354,355],{"id":266,"depth":127,"text":267},{"id":282,"depth":127,"text":283},{"id":322,"depth":127,"text":323},null,"md","./oci-free-tier.png",{"created":360},"2026-07-11 21:00",true,"/blog/19",{"title":5,"description":17},"A detailed guide on how to use Windows scripts to secure your OCI free tier instance by bypassing the out of host capacity error.","blog/19/index",[367,368,369,370,371],"Oracle Cloud","OCI","PowerShell","Scripts","Automation","2026-07-11","E3f44cNmgLl32CdUW3kf-ZX4LlHODxxJpUBtrZWSkRs",1783869519571]