How to Create a Compartment in Oracle Cloud Infrastructure (OCI)

In this tutorial we will see how to create a new compartment in Oracle Cloud Infrastructure. Before we begin, let us gather details which will be required while creating compartment.
Following details need to be ready with us:
- Compartment Name
- Compartment Description
- Parent Compartment Name
For this example, let us create a compartment with following details:
- Compartment Name – Finance_Compartment
- Compartment Description – This compartment will contain resources belonging to Finance department of the company
- Parent Compartment – Root Compartment
Following rules need to be followed related to compartment creation:
- Compartment name can contain only alphanumeric characters, along with periods, hyphens and underscores (spaces are not allowed in compartment names)
- Compartment name can be upto 100 characters long
- Compartment name should be unique within its parent compartment
- Compartment description can be upto 400 characters long
- Compartments can be created upto 6 levels deep, not beyond that
Let us now look at steps to create a compartment in Oracle Cloud Infrastructure.
Step 1: Login to Oracle Cloud Infrastructure




Step 2: Select Compartment Menu
Click on hotdog menu, hover over Identity option and click on Compartments




Step 3: Click on Create Compartment button
Once inside Compartments menu, you will see “Create Compartment” button at top. Click on it.




Step 4: Fill Compartment Details and Create Compartment
Fill in the compartment details we had collected before and click on “Create Compartment” button at left bottom of the screen.




Step 5: Verify your compartment is created
You should be able to see your newly created compartment in the list of compartments.



