You can head over to SonarQube download page for the latest downloads. At the moment, the latest Community Edition release, which is a Long Term Service ( LTS ) release is SonarQube version 9.0.1.
Moving on, we are going to download the latest SonarQube binary zip file. \q Step 4: Download and configure SonarQube GRANT ALL PRIVILEGES ON DATABASE sonarqube to sonar Then, assign or grant all privileges to the database use such that they have all the privileges to modify the database. Next, create a SonarQube database with the user you created as the owner CREATE DATABASE sonarqube OWNER sonar
ALTER USER sonar WITH ENCRYPTED PASSWORD 'strong_password' With access to the PostgreSQL shell, create a password for the user you just created. Once done, switch to the PostgreSQL prompt using the command: $ psql Next, proceed and create a new database user. To do so, run the command: $ sudo passwd postgres Moving on, we are going to set the password for the Postgres user that usually comes by default when PostgreSQL is installed. So far, our PostgreSQL is up and running without any hitches. Tcp6 0 0 ::1:5432 :::* LISTEN 7768/postgresĮnable PostgreSQL to automatically start upon booting: $ sudo systemctl enable postgresql You can also confirm the port it's listening on: $ sudo netstat -pnltu | grep 5432 tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 7768/postgres Just to confirm that everything is running as expected, verify its running status. $ sudo apt install postgresql postgresql-contribīy default, the PostgreSQL service gets started after installation, if not started run the following command. Once you are done updating the package lists, install the PostgreSQL database and its dependencies.
Then update the package index to sync the new repository. $ sudo sh -c 'echo "deb `lsb_release -cs`-pgdg main" > /etc/apt//pgdg.list' Thereafter, add the PostgreSQL repository. To start off, download and add the PostgreSQL GPG key. As such, we need to install the PostgreSQL database. $ java -version Step 2: Install PostgreSQL databaseįrom 2016, SonarQube dropped support for MySQL and now only supports PostgreSQL. Once installed, you can verify the version of Java. We will install OpenJDK 11 which provides java. Since it is written in Java, SonarQube depends on Java to function. For the changes to come into effect, reboot your server. Thereafter, open the nf file $ sudo vim /etc/security/nfĪt the very bottom, add the following lines sonarqube - nofile 65536 You can make the changes persistent by modifying system parameters in the /etc/nfconfiguration file $ sudo vim /etc/nfĪdd the following lines. With the maximum number of open files $ sudo sysctl -w fs.file-max=65536Īnd the resource limits $ ulimit -n 65536 $ ulimit -u 4096 $ sudo apt install net-tools unzip vim curlĪlso, you need to increase the virtual memory kernel $ sudo sysctl -w vm.max_map_count=262144 You will need to install some tools $ sudo apt update
In this tutorial, we learn how to install SonarQube on Ubuntu 20.04. It comes in various editions including Community, Developer, Enterprise, and Datacenter editions. SonarQube can be integrated into platforms such as GitHub, Gitlab, BitBucket, and Azure DevOps to mention a few platforms.
SonarQube enables you to write cleaner and safer code by inspecting code and detecting bugs and other inconsistencies.
SonarQube is a cross-platform and web-based tool used for continuous inspection of source code. One tool that can help you achieve this is in your CI/CD pipeline is SonarQube. It's every developer's dream to have clean and issue-free code which can readily be deployed into staging and production environments.