Setting Up a SonarQube Host

Overview

 

Server Setup

This section covers setting up a SonarQube server from scratch. Ubuntu is used as the operating system and MySQL is used as the database.  

  1. Install Ubuntu
  2. Enable ssh
    sudo apt-get install openssh-server                        
                        
  3. Install a Database (MySQL)
    sudo apt-get install mysql-server
                        
  4. Add a User to the Database

    As the root user of the MySQL database, setup the user that SonarQube uses.

    CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
    CREATE USER 'sonarqube' IDENTIFIED BY 'pa55w0rd';
    GRANT ALL ON sonar.* TO 'sonarqube'@'%' IDENTIFIED BY 'pa55w0rd';
    GRANT ALL ON sonar.* TO 'sonarqube'@'localhost' IDENTIFIED BY 'pa55w0rd';
    FLUSH PRIVILEGES;                        
                        

    SQL credit goes to this Gist.

Resources