Prerequisites
Port opens:
TCP: 9000
TCP: 5432
TCP: 22:
TCP: 443
To Increase the vm.max_map_count kernal ,file discriptor and ulimit for current session at runtime.
sudo sysctl -w vm.max_map_count=262144
sudo sysctl -w fs.file-max=65536
ulimit -n 65536
Sudo apt-get upgrade
Sudo apt-get update
sudo apt-get install openjdk-11-jdk -y
sudo apt-get install openjdk-11-jre -y
Check java version:
Install and Setup PostgreSQL 10 Database For SonarQube
sudo apt-get -y install postgresql postgresql-contrib
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo passwd postgres
su – postgres
createuser sonar
Password: Glob@qw
Type:psql
ALTER USER sonar WITH ENCRYPTED password ‘sonar’;
grant all privileges on DATABASE sonarqube to sonar;
\q
exit
Create a sonar user :
Password for soanr user: MasterB#456OpLead
Configure SonarQube
Copy sonarqube-9.7.1.62043.zip to /opt: and unzip
sudo unzip sonarqube-9.7.1.62043.zip -d /opt
sudo mv /opt/sonarqube-9.7.1.62043 /opt/sonarqube
Give access to the sonar user:
sudo useradd -c “user to run SonarQube” -d /opt/sonarqube -g sonar sonar
sudo chown sonar:sonar /opt/sonarqube -R
sudo vim /opt/sonarqube/conf/sonar.properties
Update the username and password of database:
sudo vim /opt/sonarqube/bin/linux-x86-64/sonar.sh
sudo su sonar
cd /opt/sonarqube/bin/linux-x86-64/
./sonar.sh start
Configure Systemd service:
cd /opt/sonarqube/bin/linux-x86-64/
./sonar.sh stop
sudo vim /etc/systemd/system/sonar.service
sudo systemctl start sonar
sudo systemctl enable sonar
Click on the link below:
http://3.239.83.182:9000/sessions/new?return_to=%2F
Username:admin
Password: Glob@qw