To install SonarQube Community Edition on Ubuntu, follow these steps:
- Update the package list and install the required packages:
sudo apt-get update
sudo apt-get install -y openjdk-8-jdk wget
- Download SonarQube:
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.9.7.43533.zip
- Unzip the downloaded package:
unzip sonarqube-7.9.7.43533.zip
- Move SonarQube to the desired location (e.g., /opt/sonarqube):
sudo mv sonarqube-7.9.7.43533 /opt/sonarqube
- Create a new user for SonarQube:
sudo useradd -r sonar
- Set the owner of the SonarQube directory to the newly created user:
sudo chown -R sonar:sonar /opt/sonarqube
- Set the working directory:
sudo chdir /opt/sonarqube/sonarqube
- Configure environment variables:
echo 'export SONAR_HOME=/opt/sonarqube/sonarqube' >> /etc/profile
echo 'export PATH=$PATH:$SONAR_HOME/bin' >> /etc/profile
- Reload the profile:
source /etc/profile
- Start SonarQube:
bin/linux-x86-64/sonar.sh start
- Check the status:
bin/linux-x86-64/sonar.sh status
- Access SonarQube web interface:
Open your web browser and navigate to http://localhost:9000. Use the default credentials: admin/admin.
For more information, refer to the following resources:
- SonarQube Documentation - Installation
- SonarQube Documentation - Up and Running
- SonarQube Documentation - System Requirements
This guide covers the installation of SonarQube Community Edition on Ubuntu 18.04 or later. The installation process is split into multiple steps for better readability. It is essential to follow the steps in order and ensure the environment variables are correctly set.