Collections
Try out SonarQube
00 min
Nov 7, 2023
Nov 7, 2023
type
status
date
summary
tags
category
URL
password
slug
icon
You've heard about how SonarQube and the Clean as You Code strategy can help you write cleaner and safer code, and now you're ready to try it out for yourself. This guide shows you how to install a local instance of SonarQube and analyze a project. Installing a local instance gets you up and running quickly, so you can experience SonarQube firsthand.
Once you're ready to set up a production instance, take a look at the Install SonarQube documentation.

Installing a local instance of SonarQube

You can evaluate SonarQube using a traditional installation with the zip file or you can spin up a Docker container using one of our Docker images. Select the method you prefer below to expand the installation instructions:
From the zip file
  1. Download and install Java 17 on your system.
  1. Download the SonarQube Community Edition zip file.
  1. As a non-root user, unzip it in, for example, C:\sonarqube or /opt/sonarqube.
  1. As a non-root user, start the SonarQube server:
If your instance fails to start, check your logs to find the cause.
From the Docker image
Find the Community Edition Docker image on Docker hub.
  1. Start the server by running:
Once your instance is up and running, Log in to http://localhost:9000 using System Administrator credentials:
  • login: admin
  • password: admin

Analyzing a project

Now that you're logged in to your local SonarQube instance, let's analyze a project:
  1. Select Create new project.
  1. Give your project a Project key and a Display name and select Set up.
  1. Under Provide a token, select Generate a token. Give your token a name, select Generate, and click Continue.
  1. Select your project's main language under Run analysis on your project, and follow the instructions to analyze your project. Here you'll download and execute a scanner on your code (if you're using Maven or Gradle, the scanner is automatically downloaded).
After successfully analyzing your code, you'll see your first analysis on SonarQube:
notion image
notion image
Screenshot showing the home page of a project
Your first analysis is a measure of your current code. As a developer, you focus on maintaining high standards and taking responsibility specifically for the new code you're working on. Code that has been added or changed from this point should be your focus moving forward. For more information about the Clean as You Code strategy, please review the SonarQube User guide concepts.
上一篇
Downloads | Steampipe
下一篇
How to automate opening and login to websites with Python | by Hristina Gulabovska | Medium