Creating an Instance

Create a bare metal or virtual machine (VM) compute instance by using Compute service.

Tip

If this is your first time creating an instance, for a guided tutorial consider one the following:
Tip

If this is your first time creating an instance, we recommend creating a Virtual Cloud Network (VCN) first. You can use the "Start VCN Wizard" workflow and select the "Create VCN with Internet Connectivity" option. The workflow creates a VCN which automatically configures both a public and a private subnet along with any required gateways and route rules. In addition, the workflow provides an option to configure IPv6. For details on running the workflow see: Virtual Networking Quickstart.

Instance IP addresses

When you create an instance, the instance is automatically attached to a virtual network interface card (VNIC) in the cloud network's subnet and given a private IP address from the subnet's CIDR. You can let the system assign the IP address, or you can specify an address. The private IP address lets instances within the VCN communicate with each other. If you've set up the cloud network for DNS, instances can instead use fully qualified domain names (FQDNs).

If the subnet is public, you can optionally assign the instance a public IP address. A public IP address is required to communicate with the instance over the internet, and to establish a Secure Shell (SSH) or Remote Desktop Protocol (RDP) connection to the instance from outside the cloud network. You can also create SSH or RDP connections to instances without public IP addresses by using a bastion.

Capacity availability

To determine whether capacity is available for a specific shape before you create an instance, use the CreateComputeCapacityReport operation.

Note

Partner images and pre-built Oracle enterprise images are not available in Government Cloud realms.
Important

When a compartment is part of a security zone, you must follow security zone policies when creating a compute instance. This means failing to implement security zone policies might prevent instance creation in that compartment. See security zone policies for a detailed list of default security zone policies.

For permissions, see Required IAM Policy for Working with Instances.

Before You Begin

Before you create an instance, you need these things:

  • (Optional) An existing VCN to create the instance in. Alternatively, you can create a new VCN while you create the instance. For information about setting up VCNs, see Networking.
  • Public SSH key (Linux instances): If you want to use your own SSH key to connect to the instance using SSH, you need the public key from the SSH key pair that you plan to use. The key must be in OpenSSH format. For more information, see Managing Key Pairs on Linux Instances.
  • VCN security rule to enable RDP access (Windows instances): A VCN security rule that enables RDP access so that you can connect to your instance. Specifically, you need a stateful ingress rule for TCP traffic on destination port 3389 from source 0.0.0.0/0 and any source port. For more information, see Security Rules.

    You can implement this security rule either in a network security group (NSG) that you add this Windows instance to or, in a security list that's used by the instance's subnet.

    For instructions for either method, see: Enabling RDP Access to a Windows Instance.

  • (Optional) To create the instance by using a host capacity type other than on-demand capacity, prepare the capacity as follows:

    • To create an instance and have it count against a capacity reservation, you must have a capacity reservation in the same availability domain as the instance.
    • To place an instance on a dedicated virtual machine host, you must have a dedicated virtual machine host in the same availability domain and fault domain as the instance.

    The capacity types are mutually exclusive.

Create an Instance

The following steps describe how to create an instance using the console, CLI, or API.

What's Next