How to install Sonarqube in ubuntu

preview_player
Показать описание
Update Server:
apt update && apt upgrade -y

Install OpenJDK:
sudo apt-get install openjdk-11-jdk -y

Install and Configure PostgreSQL:
######## i'm changing angled bracket with square bracket #########

sudo apt install postgresql postgresql-contrib -y
sudo systemctl enable postgresql
sudo systemctl start postgresql
sudo passwd postgres
su - postgres
createuser sonar
psql
ALTER USER sonar WITH ENCRYPTED password '123Admin';
CREATE DATABASE sonarqube OWNER sonar;
GRANT ALL PRIVILEGES ON DATABASE sonarqube to sonar;
\q
exit

Download and Install SonarQube:
sudo apt-get install zip -y
sudo mv sonarqube-9.8.0.63668 /opt/sonarqube

Add SonarQube Group and User:
sudo groupadd sonar
sudo useradd -d /opt/sonarqube -g sonar sonar
sudo chown sonar:sonar /opt/sonarqube -R

Configure SonarQube:

Find the following lines:
Uncomment the lines and update password
add line

ass line
RUN_AS_USER=sonar

Setup Systemd service:
paste
------------------------
[Unit]

Description=SonarQube service

[Service]

Type=forking

User=sonar
Group=sonar
Restart=always

LimitNOFILE=65536
LimitNPROC=4096

[Install]

-----------------------------------

sudo systemctl enable sonar
sudo systemctl start sonar
sudo systemctl status sonar

Modify Kernel System Limits:
add line
ulimit -n 65536
ulimit -u 4096

Access SonarQube Web Interface:

user-admin
pass-admin
Рекомендации по теме
Комментарии
Автор

I followed your tutorial, i'm trying to add the sonarqube in my vm in google cloud and i'm having some troubles with the ports. Sonarqube is running but the port 9000 is unaccessible, any suggestions?

guiramos