# Creating an Environment

Follow this guide to install P0 for data collection in your cloud provider, and to run your first posture and inventory scans.

## Install for IAM data collection

First, you'll need to connect P0 to your cloud service provider.

{% hint style="warning" %}
If you have P0 installed for just-in-time access, you'll still need to follow this step, as data collection requires different permissions in your cloud provider.
{% endhint %}

Begin by navigating to your provider's integration page on the P0 app (after login to [p0.app](https://p0.app), select "Integrations", then your cloud provider):

Choose "IAM assessment", then follow the steps on the app to install P0.

<figure><img src="/files/NZ54NhyUiZ81NuhYUABv" alt="Google Cloud integration page in P0 showing available components including Access logging, Cloud Run invocation, Domain-restricted sharing, and IAM assessment" width="563"><figcaption></figcaption></figure>

{% hint style="info" %}
Make sure you have the ability to create custom roles and assign privileges in your cloud provider before beginning.
{% endhint %}

{% hint style="info" %}
To augment the usage data available to P0, you may also install "Access logging"
{% endhint %}

## Running your first scan

Navigate to "Dashboard", then select "Create" under "Create an environment to get started":

<figure><img src="/files/Cg4DQmTHm2oOnOZcFaqq" alt="P0 dashboard prompt showing Create an environment to get started with a Create button"><figcaption></figcaption></figure>

Choose a useful name, an assessment frequency, and the targets to assess (this will be the resources you installed in the previous step), then select "Create Environment".

<figure><img src="/files/FN0QIOBSOZdIHbuhylT4" alt="Create New Environment dialog with fields for environment name, assessment frequency, integration selection, and an option to start scheduling immediately" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
If you select "start scheduling assessments immediately", the first scan will run as soon as the environment is created. If you would rather trigger the scan manually, you may uncheck this setting, and navigate to "Settings" to run a scan once the environment is created.
{% endhint %}

Within a few moments P0 will start collecting data from your project:

<figure><img src="/files/QXKfCqNvQBdXHavmE8Fo" alt="Environment status page showing data collection progress with steps for Data Sources Prepared, Collecting Data, Constructing IAM Graph, and Evaluating Monitors" width="563"><figcaption></figcaption></figure>

Once the data-collection job completes, click "Dashboard" to see your results.

<figure><img src="/files/fFIhzxqmlrTyizWNCm43" alt="P0 dashboard showing posture findings chart, inventory identity breakdown, and just-in-time access metrics including approval time and request frequency" width="563"><figcaption></figcaption></figure>

Congratulations, you've run your first environment scan with P0!

For information on how to view and use the results, see [Access Inventory](/inventory/access-inventory.md) and [Posture Overview](/posture/posture-overview.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.p0.dev/environments/creating-an-environment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
