# How to create a folder in an object storage bucket

Source: https://docs.quake.ai/docs/object/how-to/create-folder
Markdown: https://docs.quake.ai/docs/object/how-to/create-folder.md

---

# How to create a folder in an object storage bucket

Create a logical folder (prefix) within an object storage bucket to organize objects. Folders in object storage are not real directories; they are a naming convention that the console and many clients treat as folders. You can create nested folders.

<PrerequisiteBlock methods={["console", "cli", "api"]}>

- An existing object storage bucket: see [Create an object storage bucket](/docs/object/how-to/create-container)
- For S3-compatible CLI and API: [S3 credentials](/docs/object/how-to/create-s3-credentials) configured

</PrerequisiteBlock>

## Create a folder

<MethodTabs>
<Method label="Console">

1. Go to **Storage** > **Object Storage**.
2. Select the bucket.
3. Optionally navigate into an existing folder to create a nested folder.
4. Select **Create Folder**. The Create Folder dialog opens with a read-only **Bucket Name** field that displays the parent bucket.
5. Enter a name in the required **Folder Name** field.
6. Select **OK**.

</Method>
<Method label="CLI">

Object storage folders are zero-byte objects with a trailing `/`. Create one:




```bash
openstack object create my-bucket /dev/null --name "my-folder/"
```

Create a nested folder:

```bash
openstack object create my-bucket /dev/null --name "parent-folder/child-folder/"
```




```bash
aws --endpoint-url https://object.us-east-1.rumble.cloud s3api put-object \
  --bucket my-bucket --key "my-folder/"
```

Create a nested folder:

```bash
aws --endpoint-url https://object.us-east-1.rumble.cloud s3api put-object \
  --bucket my-bucket --key "parent-folder/child-folder/"
```




</Method>
<Method label="API">

<ObjectApiEnvironment />

Upload a zero-byte object with a trailing `/` to create a folder:

```bash
curl -X PUT "$OS_SWIFT_URL/my-bucket/my-folder/" \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Length: 0"
```

Create a nested folder:

```bash
curl -X PUT "$OS_SWIFT_URL/my-bucket/parent-folder/child-folder/" \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Length: 0"
```




Create a folder using `boto3` by uploading a zero-byte object with a trailing `/` key. Object storage does not have real directories; folders are a naming convention that the console and S3 clients display as a hierarchy.

```python
import boto3

s3 = boto3.client(
    "s3",
    endpoint_url="YOUR_S3_ENDPOINT",
    aws_access_key_id="YOUR_ACCESS_KEY",
    aws_secret_access_key="YOUR_SECRET_KEY",
)

# Create a folder
s3.put_object(Bucket="my-bucket", Key="my-folder/", Body=b"")

# Create a nested folder
s3.put_object(Bucket="my-bucket", Key="parent-folder/child-folder/", Body=b"")
```




</Method>
</MethodTabs>

## See also

- [Create an object storage bucket](/docs/object/how-to/create-container)
- [Upload a file to a bucket](/docs/object/how-to/upload-file)
- [Object storage console reference](/reference/object-storage/console/object-storage)
