# SonarQube Installation on Linux

In 
Published 2022-12-03

This tutorial explains to you how to install SonarQube on Linux.

# Prerequisites

  • Java 1.8 or above as per the version of the sonarqube. You can take a look here.

# Create the directory which will keep SonarQube software

First, we need to create the directory which will keep SonarQube software:

mkdir -p /u01/sonarqube

# SonarQube download

The software could be downloaded from www.sonarsource.com.

or by using the wget command (from the directory in which we want to keep the software):

cd /u01/sonarqube
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.8.0.63668.zip

I have chosen the Community Edition.

# Unzip the download to the desired location

You can run the following command:

cd /u01/sonarqube
unzip sonarqube-9.8.0.63668.zip

# Start SonarQube

Go to /u01/sonarqube/sonarqube-9.8.0.63668/bin/linux-x86-64 and run the following command:

./sonar.sh start

If you want you can create a Linux service for starting/stopping SonarQube.

If the Java version is not the right one, SonarQube will not start.

Other commands:

  • stop SonarQube (Graceful shutdown)
./sonar.sh stop
  • stop SonarQube (Hard stop)
./sonar.sh force-stop
  • check SonarQube status
./sonar.sh status