How to set up SonarQube on AWS Ubuntu EC2

Updated 26 December 2024

SonarQube is an open-source platform for continuous code quality inspection.

Static code analysis is performed by Sonar, which results in a full report of flaws, code smells, vulnerabilities, as well as code duplications.

However, It comes with built-in rulesets for 25+ main programming languages and may be expanded with plugins.

Benefits of SonarQube

  1. Sustainability – Reduces application complexity, potential vulnerabilities, and code duplications, extending program life.
  2. Increase productivity – Reduces the application’s size, cost of maintenance, and risk; as a result, it eliminates the need to spend more time modifying the code.
  3. Quality code – Controlling the quality of code is an inextricable aspect of the software development process.
  4. Detect Errors – Detects errors in code and immediately warns developers to repair them before submitting them for output.
  5. Increase consistency – Identifies when the coding criteria have been broken and improves quality.
  6. Scalability of the business – There is no limit to the number of projects that can be reviewed.
  7. Enhance developer skills – Providing developers with regular feedback on quality issues allows them to improve their coding abilities.

Prerequisite

Before you begin, be certain you match the following requirements:

  1. Need Sudo privilege and the Ubuntu version must be 20.04 LTS.
  2. Make sure your computer has at least 4GB of RAM and 2 virtual CPU cores.

How to set up SonarQube on AWS

Run Ubuntu system update # apt update

SonarQube

In my case, java is already installed if not installed in your system then Install Java OpenJDK # apt install openjdk-11-jre-headless.

SonarQube

Create a dedicated user. # adduser sonarqube

SonarQube

Go to its root directory, Download, and Setup from HERE.

# wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.4.0.54424.zip

SonarQube

Unzip it by using the unzipping command.

SonarQube

Assigning permission and ownership.

# chmod -R 755 /home/sonarqube/sonarqube-9.4.0.54424

# chown -R sonarqube:sonarqube /home/sonarqube/sonarqube-9.4.0.54424

SonarQube

Then, Go to the Sonarqube /bin/linux-x86-64 and start the service.

SonarQube

Check if the service is listening to port 9000.

SonarQube

Now, Using the Web Interface http://your-Instance-public-IP:9000

SonarQube

Conclusion

In this way, you can set up it on AWS EC2. You can stay connected for further updates.

For further help or queries, please contact us or raise a ticket.

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project




    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home