Start Free
2025.2 | Project administration | Creating and importing projects

Creating and importing projects

On this page

Overview

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

  • Import from DevOps Platforms: If your project is bound to a DevOps platform and you want to benefit from the integration features out of the box.
  • Local project: For a project not linked to a DevOps platform, you can create your SonarQube project manually.
  • 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.

Choosing a method for project creation

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).

Importing a DevOps platform repository

Once the global-level integration with your DevOps platform is complete, you can create your SonarQube Server project by importing your DevOps platform repository. The so-created SonarQube Server project is “bound” to its Azure DevOps repository. With a bound project, you benefit from integration features, such as pull request decoration, code scanning alerts, permission synchronization, etc.

To import your repository, you need the Create Projects permission in SonarQube Server and the corresponding access rights on the repository. 

To import a DevOps platform repository into SonarQube Server:

  1. In the top navigation bar of SonarQube Server, select the Projects tab.
  2. In the top right corner, select the Create Project > From <DevOps Platform> button.
  3. If your instance has multiple DevOps platform Integrations, select the configuration from which you want to import your project. 
  4. Select the repository to be imported.

Creating your SonarQube Server project manually (local project)

You need the Create Projects permission in SonarQube Server.

Proceed as follows: 

  1. In the top navigation bar of SonarQube Server, select the Projects tab.
  2. In the top right corner, select the Create Project > Local Project button.

Automating project creation and import

When you have a large project base, it can be beneficial to automate project creation and import using the Web API. If you're getting started with Web APIs, check out the Web API documentation.

Automate local project creation

Only using the Web API POST /api/projects/create endpoint 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

To provision a project from a DevOps platform, SonarQube Server must be first configured with the platform.

  • Use POST api/v2/dop-translation/bound-projects endpoint to create a SonarQube project with the information from the provided DevOps platform project. This requires the Create Projects permission and setting a Personal Access Token with POST api/alm_integrations/set_pat endpoint for a user who will be using this endpoint. 
  • To list all DevOps platform integrations use GET /api/v2/dop-translation/dop-settings endpoint.

Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License