Install SonarQube on MacOSX

Steps:

  1. Make sure you have homebrew installed in your machine, otherwise follow instrunctions at brew.sh.
  2. Open terminal, run brew install sonar. Assuming brew installs SonarQube successfully, take a look at the last line of the terminal where the SonarQube location is printed. In my case it is /usr/local/Cellar/sonarqube/7.1.
  3. Now run brew install sonar-scanner (N.B. sonar-runner is no longer available, it’s replaced by sonar-scanner).
  4. After installation is complete, run the following commands consecutively:
  export SONAR_HOME=/usr/local/Cellar/sonar-scanner/3.2.0.1227/libexec
  export SONAR=$SONAR_HOME/bin
  export PATH=$SONAR:$PATH

[Note: exporting path in this way will work for the current session of terminal, for permanent use, I need to transfer these path variables to .bashrc file.]

  1. Now we can run SonarQube from terminal by issuing this command /usr/local/opt/sonarqube/bin/sonar console.
  2. Go to http://localhost:9000/ (or appropriate port based on your system) to view the main page of SonarQube. Use this credentials (username: admin, password: admin) to login.

References (a bit deprecated):

Sajid Rahman
Sajid Rahman
PhD Student

My research interests include software security & privacy engineering, deep learning, and human-centered computing.