Loading...

How to Install SonarQube on Ubuntu 20.04?

Simple.Predictable.Scalable

Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing SonarQube on Ubuntu 20.04

SonarQube is an open-source platform used for continuous code quality inspection. It helps developers to detect bugs, vulnerabilities, and code smells in their codebase. SonarQube analyzes your codebase using static code analysis and provides detailed reports with actionable insights to improve the overall code quality.

Here are the steps to install SonarQube on Ubuntu 20.04:

sudo apt update
  sudo apt upgrade
sudo apt install openjdk-11-jdk
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.1.0.47736.zip
sudo apt install unzip
unzip sonarqube-9.1.0.47736.zip
sudo mv sonarqube-9.1.0.47736 /opt/sonarqube
sudo adduser --system --no-create-home --group --disabled-login sonarqube
sudo chown -R sonarqube:sonarqube /opt/sonarqube
sudo nano /opt/sonarqube/conf/sonar.properties
sonar.jdbc.username=sonarqube
sonar.jdbc.password=strong_password
sudo nano /etc/systemd/system/sonarqube.service
[Unit]
  Description=SonarQube service
  After=network.target
  
  [Service]
  Type=simple
  User=sonarqube
  Group=sonarqube
  ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
  ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop
  ExecReload=/opt/sonarqube/bin/linux-x86-64/sonar.sh restart
  PIDFile=/opt/sonarqube/bin/linux-x86-64/./SonarQube.pid
  Restart=always
  
  [Install]
  WantedBy=multi-user.target
sudo systemctl daemon-reload
  sudo systemctl start sonarqube
  sudo systemctl enable sonarqube

Open your web browser and visit http://localhost:9000 to access the SonarQube web interface.

Use the default administrator credentials:

Follow the instructions provided in the SonarQube web interface to configure your projects and analyze your codebase.

  1. Update the system packages:
  2. Install the OpenJDK 11 package:
  3. Download the SonarQube package:
  4. Install the unzip utility:
  5. Unzip the downloaded package:
  6. Move the extracted folder to the /opt directory:
  7. Create a new sonar user:
  8. Change the ownership of the SonarQube directory:
  9. Edit the SonarQube configuration file:
  10. Uncomment the line starting with "sonar.jdbc.username" and set the username:
  11. Uncomment the line starting with "sonar.jdbc.password" and set the password:
  12. Save and close the file.
  13. Create a new systemd service file for SonarQube:
  14. Paste the following content into the file:
  15. Save and close the file.
  16. Reload systemd and start SonarQube service:
  17. Access SonarQube web interface:
  18. Log in to SonarQube:
    • Username: admin
    • Password: admin
  19. Configure SonarQube and analyze your codebase:

Congratulations! You have successfully installed SonarQube on Ubuntu 20.04. Start improving your code quality by analyzing your projects with SonarQube.

Refer A Friend
Get $25

installing SonarQube
SonarQube installation
SonarQube Ubuntu 20.04
Ubuntu 20.04 SonarQube installation
how to install SonarQube on Ubuntu 20.04
SonarQube setup on Ubuntu 20.04
SonarQube installation guide
SonarQube installation steps
installing SonarQube on Ubuntu
SonarQube installation tutorial

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.