nativeInstallersonarqube

Get started with SonarQube

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

NOTE: The Approach A sections referred to below do not apply to Bitnami native installers. Users of Bitnami native installers should refer only to the Approach B sections.

The SonarQube installation folder has the following contents:

NOTE: Depending on your installation type, the SonarQube installation folder will be located in the following paths:

  • Approach A (Bitnami installations using system packages): installdir/sonarqube

  • Approach B (Self-contained Bitnami installations): installdir/apps/sonarqube/sonarqube

Directory Content
bin/ SonarQube’s binaries.
conf/ SonarQube’s configuration files.
data/ SonarQube’s data.

Analyze your first project with SonarQube Scanner

To get started with the Bitnami SonarQube Stack and SonarQube Scanner, you can follow this two-minute quickstart guide to analyze a sample project:

Windows

  • Download the SonarQube Scanner zip file. You can find it for all platforms on this link.

  • Unzip it in C:\sonar-scanner.

  • Download some sample projects from this link.

  • Unzip them in %HOMEPATH%\sonar-scanning-examples.

  • Analyze a project as shown below. Replace the USERNAME and PASSWORD placeholders with the correct user name and password.

      $ cd %HOMEPATH%\sonar-scanning-examples\sonarqube-scanner
      $ C:\sonar-scanner\bin\sonar-scanner.bat -D sonar.login=USERNAME -D sonar.password=PASSWORD
    
  • Browse to http://localhost to find out the results. Replace the localhost placeholder with the actual domain name for your SonarQube server.

Linux and Mac OS X

  • Download the SonarQube Scanner zip file. You can find it for all platforms on this link.

  • Unzip it in /opt:

      $ sudo unzip -d /opt sonar-scanner-cli-*.zip
    
  • Download some sample projects from this link.

  • Unzip them in $HOME/sonar-scanning-examples:

      $ unzip -d $HOME master.zip
    
  • Analyze a project as shown below. Replace the USERNAME and PASSWORD placeholders with the correct user name and password.

      $ cd $HOME/sonar-scanning-examples/sonarqube-scanner
      $ /opt/sonar-scanner-*/bin/sonar-scanner -Dsonar.login=USERNAME -Dsonar.password=PASSWORD
    
  • Browse to http://localhost to find out the results. (localhost is a placeholder. Please, replace it with the actual domain of your SonarQube server).

You can find more information about SonarQube Scanner at SonarQube’s official documentation.

Last modification July 14, 2021