We're here to assist with any of your needs, don't hestitate to reach out.
SonarQube is an open-source platform for continuous code quality inspection that helps to identify bugs, vulnerabilities, and maintainability issues in your codebase. By analyzing source code and providing detailed reports, SonarQube helps development teams improve code quality and maintain high standards.
First, update your CentOS 7 system packages:
SonarQube requires Java to run. Install the JDK:
Download the latest version of SonarQube:
Create a new system unit file for SonarQube:
Create a new system user to run SonarQube:
Change the ownership of the SonarQube installation directory:
Start the SonarQube service and enable it to start on boot:
After starting the service, you can access the SonarQube web interface by navigating to http://your_server_ip_or_domain:9000 in your web browser. This will launch the SonarQube dashboard where you can configure projects and perform code analysis.
sudo yum update -y
sudo yum install java-1.8.0-openjdk-devel -y
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-8.9.0.43852.zip
Unzip the downloaded file:
unzip sonarqube-8.9.0.43852.zip
Move the extracted folder to the desired location:
sudo mv sonarqube-8.9.0.43852 /opt/sonarqube
sudo vi /etc/systemd/system/sonar.service
Add the following configuration:
[Unit]
Description=SonarQube service
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop
User=sonarqube
Group=sonarqube
Restart=always
LimitNOFILE=131072
LimitNPROC=8192
[Install]
WantedBy=multi-user.target
Save and close the file.
sudo useradd -r -s /bin/false sonarqube
sudo chown -R sonarqube:sonarqube /opt/sonarqube
Ensure that other users cannot access the SonarQube installation directory:
sudo chmod -R 775 /opt/sonarqube
sudo systemctl start sonar
sudo systemctl enable sonar
Congratulations! You have successfully installed SonarQube on CentOS 7. You can now start using SonarQube to analyze and improve your code quality.
What our customers say about us
Create your free account today.