Free live webinar • November 21, 2026 • 9:30 AM CST   Register free →
2017–2027Celebrating Our 10th Year

Transform Your Career.
Engineer Your Future.

Build the skills to become an AI-Enabled DevSecOps & Cloud Engineer with 15 weeks of live training, hands-on labs and personal mentorship.

Coach AK in his DevOps learning studio
Coach AK | Ananth KannanSenior DevOps & SRE Architect • Founder, CoachDevOps
3,500+Students Trained
25+ YearsIT Experience
15 WeeksLive Training
70+Hands-on Labs

Master In-Demand Technologies

AWSAzureDockerKubernetesTerraformJenkinsGitHub ActionsAnsibleGitLab

AI-Enabled DevSecOps & Cloud Engineering Bootcamp

Next weekend batch: December 5, 2026
Saturday 9:30–11:30 AM CST • Sunday 10:30 AM–12:30 PM CST

Live classes, practical projects, personal mentorship and career preparation.

View Program Details →

Real Students. Real Success.

Career milestones shared by our students.

✓ Placement in an AI role
“The concepts you taught have improved my technical understanding and confidence.”
ManimaranJuly 2026 Bootcamp
✓ DevSecOps Engineer offer
“I want to sincerely thank you for your mentorship, training, and support.”
Femi AshayeCoachDevOps Alumni
✓ DevOps Engineer offer
“I got an offer for Devops engineer Last week and happy to inform you. I really appreciate you.”
EbenezerCoachDevOps Alumni
View All Success Stories →

Individual student experiences; employment is not guaranteed.

Ready to Take the Next Step?

Explore the program or get answers to your questions before enrolling.

Monday, April 15, 2019

Install Sonarqube on Ubuntu - How to install SonarQube on Ubuntu 16.0.4 - How to setup Sonar on Ubuntu?

Please find steps for installing SonarQube on Ubuntu EC2. Make sure port 9000 is opened in security group(firewall rule).

SonarQube is java based tool along with back end - back end can be MySQL, Oracle or PostgreSQL. We will use Postgres for set up on Ubuntu.

Let us start with java install (skip java install if you already have it installed)

1. Java steps 

sudo apt-get update
sudo apt-get install default-jdk -y

Verify Java Version

java -version

openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.16.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

2. Postgres Installation

1. sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'


 
2. sudo wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -



3. sudo apt-get -y install postgresql postgresql-contrib








4. sudo systemctl start postgresql
5. sudo systemctl enable postgresql

Login as postgres user now
7. sudo su - postgres

8. Now create a user below
createuser sonar

9. Switch to sql shell by entering
psql







Execute the below three lines (one by one)

ALTER USER sonar WITH ENCRYPTED password 'password';
CREATE DATABASE sonar OWNER sonar;
\q






type exit to come out of postgres user.




3. Now install SonarQube Web App

sudo wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-6.4.zip


sudo apt-get -y install unzip
sudo unzip sonarqube-6.4.zip -d /opt





sudo mv /opt/sonarqube-6.4 /opt/sonarqube -v




Modify sonar.properties file
sudo vi /opt/sonarqube/conf/sonar.properties
uncomment the below lines by removing # and add values highlighted yellow
sonar.jdbc.username=sonar
sonar.jdbc.password=password







Next, uncomment the below line, removing #
sonar.jdbc.url=jdbc:postgresql://localhost/sonar





Press escape, and enter :wq! to come out of the above screen.

Create Sonar as a service

Execute the below command:
sudo vi /etc/systemd/system/sonar.service











add the below code in green color:
[Unit]
Description=SonarQube service
After=syslog.target network.target

[Service]
Type=forking

ExecStart=/opt/sonarqube/bin/l
inux-x86-64/sonar.sh start
ExecStop=/opt/sonarqube/bin/li
nux-x86-64/sonar.sh stop

User=root
Group=root
Restart=always

[Install]
WantedBy=multi-user.target


sudo systemctl enable sonar
sudo systemctl start sonar
sudo systemctl status sonar
type q now to come out of this mode.
Now execute the below command to see if Sonarqube is up and running. This may take a few minutes.

tail -f /opt/sonarqube/logs/sonar.log

Make sure you get the below message that says sonarqube is up..
Now access sonarQube UI by going to browser and enter public dns name with port 9000

Click here to learn how to integrate SonarQube with Jenkins.

Please watch above steps in myYouTube video as well:

5 comments:

  1. Hi DevOps Coach, thanks for nice tutorials on this 👍 can you provide us some leads how we can achieve this jenkins to sonarqube integration with actually installing sonarqube plugin and making rest api calls to sonarqube. if you got some sample script of achieving this way, please share it with me.

    ReplyDelete
  2. Hi Sir

    I am getting unable to create java virtual machine error after while starting the sonar quebe.

    Kindly help me Sir

    ReplyDelete
  3. Can you please explain steps to do setup on Windows Machine also ?

    ReplyDelete