> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-server/10.8/project-administration/creating-and-importing-projects.md).

# Creating and importing projects

How to create and import projects in SonarQube Server 10.8.

{% hint style="info" %}
**For AI agents:** You're in the SonarQube Server 10.8 documentation. For a list of all 10.8 pages, see the [SonarQube Server 10.8 page index](https://312504542-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiJj3TXBdWssTGGg8qK5I%2Fuploads%2FmeJ1nVNGPezOurNrTy4A%2Fsonarqube-server-10.8-llms.txt?alt=media). For the whole site, see the [page index](https://docs.sonarsource.com/llms.txt) or the [full text](https://docs.sonarsource.com/llms-full.txt). For another version, replace 10.8 in the URL with that version. The [latest version](https://docs.sonarsource.com/sonarqube-server/) has no version number in its URL.
{% endhint %}

## Overview <a href="#overview" id="overview"></a>

There are several ways to create a project in SonarQube Server:

* **Import from DevOps Platforms** (Enterprise edition and above): If your project is bound to a DevOps platform and you want to benefit from the integration features out of the box (pull request decoration, code scanning alerts, permission synchronization, etc.), go to **Create Project** > **Import from DevOps Platforms** from the homepage.

  If you already have a DevOps platform Integration configured, you’ll be able to directly use it. For example, by clicking **Create Project** > **From GitHub**.
* **Local project**: For a project not linked to a DevOps platform, you can use **Create** > **Local** on the Projects page.
* **Automate through the API**: Both methods mentioned above can be automated using the Web API.
* **First scan**: If none of the above is relevant, you can create a project by scanning it for the first time.

All the above methods require the **Create Projects** permission, which can be configured in **Administration** > **Security** > **Global Permissions.**

## Choosing a method for project creation <a href="#choosing-a-method-for-project-creation" id="choosing-a-method-for-project-creation"></a>

When a project is created in SonarQube Server through a first scan, the default configuration applies: default quality profile for each language, default quality gate, default visibility, a permissions template is applied if applicable, etc.

While this is handy, this method is not always desirable as it doesn’t allow a proper configuration upfront. If you want to configure your project before you run a first analysis, use one of the following options:

* **Import from DevOps Platforms**: If your project is hosted on GitHub, GitLab, Azure DevOps, or BitBucket
* **Local project:** If your project is not hosted on a DevOps platform (in rare cases).

## Automating project creation and import <a href="#automating-project-creation-and-import" id="automating-project-creation-and-import"></a>

When you have a large project base, it can be interesting to automate project creation and import using the Web API. If you’re getting started with Web API, check out the [Web API](/sonarqube-server/10.8/extension-guide/web-api.md) page.

### Automate local project creation <a href="#automate-local-project-creation" id="automate-local-project-creation"></a>

Only using the Web API `/api/projects/create` is enough to create a local project. A name and a project key are the only necessary parameters.

### Automate the import of projects hosted on a DevOps platform <a href="#automate-the-import-of-projects-hosted-on-a-devops-platform" id="automate-the-import-of-projects-hosted-on-a-devops-platform"></a>

To provision a project from a DevOps platform, SonarQube Server needs to communicate with the said platform using a personal access token.

This is done in two steps. First, get the personal access token using the `POST api/alm_integrations/set_pat`

endpoint, then use the `POST api/alm_integrations/import_<yourdevopsplatform>_project` to set up the automation.

1. You’ll first need to use the `POST api/alm_integrations/set_pat` endpoint to provide this token. Specify the following parameters:
   * `pat`: The personal access token itself.
   * `almSetting`: Optional. The DevOps Platform configuration name that you target. This can be hardcoded in your automation, or you can use `GET api/alm_settings/list` to have the full list. If you have only one Devops platform configuration in your instance, you can skip this parameter.
   * `username`: Optional. Only for BitBucket Cloud, as the actual authentication token is the combination of the username and the personal access token.

2\. Once you’ve provided the token, use the following import endpoint to set up the automation:

* `POST api/v2/dop-translation/bound-projects`

The details of how to use these endpoints are documented in the Web API v2.0 documentation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-server/10.8/project-administration/creating-and-importing-projects.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
