Installing SonarQube on Windows

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign [Music] ER in this video I'm going to show you how to install sonar Cube on Windows the system I'm going to be using has Windows 10 but any 64-bit version of Windows should work just fine before installing sonar Cube there are some prerequisites that need to be downloaded install and set up if they're not the first is Java you can always find the required version of Java for the version of sonar Cube that you're using from here with the current long-term support version 9.9 as well as any sonar key version 10. you'll see that the required version of java is jdk 17. you can use either Oracle jdk or open jdk I've already installed Oracle jdk 17 after installing you can verify that Java is installed and it's the correct version by opening up command prompt and running Java Dash version you'll want to make sure that the Java version shown is in fact the version you are expecting in this case Java 17. once Java is set up you'll also need to make sure you have a database set up you can see the supported databases are listed under the versions of java and you can see that with this version we support postgres Microsoft SQL Server and Oracle for this installation I'm going to be using SQL Server now I've already gone in and configured my SQL server but for each database you're going to want to refer to the installing the database section of the installation instructions for any database you're going to want to create a schema and Son our Cube User it's also recommended to create a sonar Cube database within that specific database platform you'll need to make sure that the user you've created has create update and delete permissions within that schema and database for each database there's Specific Instructions that you'll also need to make sure you follow as I said I'm using SQL Server so that specifically says I need to make sure I'm using a collation that's case sensitive and accent sensitive as well as setting the read committed snapshot I can show you within SQL Server management Studio that I've created a sonar Cube database that I'm going to be using as well as creating a center Cube user within this that has right permissions to this database as well as creating a sonar Cube schema within this database that again this user has permission to write what once that's all set up now you're ready to download and set up sonar Cube you can download sonar Cube by going here this will always show you the latest version of sonar Cube and you can pick which Edition you would want to download additionally if you prefer the long term support version you can scroll down on this page and you can see the long-term support here you can pick which Edition you would want and then select download for this download though we're going to be using version 10.1 the current latest release and the Developer Edition so I can click here to download that this is going to download the sonar Cube installation zip file the zip file will need to be extracted into whatever directory you want sonar Cube installed I'm going to pick the root C directory you can pick whichever directory is appropriate for your installation and then extract you can now see that I have sonar Cube extracted into my root C directory if I go in here this is my installation directory this is where all of the files for sonar key were located before we start sonar Cube we're going to need to go into the conf directory and configure sonar Cube to use the database that we've set up the sonar.properties is where you would configure any parameters that you want to specific to your sonar Cube instance all of the sonar Cube parameters are available within here but most of them are going to be commented out with the pound sign so to use them we're going to need to remove the pound sign as well as setting the values appropriately the first two that we're going to need to use are the sonar jdbc username and password and these are going to be set up with the username and password that is created for your specifics on our Cube user and the database that you've set up now you can see that we have different parameters available depending on which database you're using as I said I'm using SQL server and specifically I'm using SQL server with SQL authentication so I can use this URL and I want to set this specific to my host and my database now if you're using SQL Server most of the new versions will use SSL by default which means that there's some additional parameters that you'll need to set to connect via SSL specifically the encrypt equals true trust server certificate and host name in certificate parameters as appropriate once you've set all these you can save this file and now you're ready to start sonar Cube to start sonar Cube you can open up a command prompt go to the installation directory and in here you'll see there's a bin directory go into the bin directory and we can see that there's specifically a directory for Windows so we go in there and we see the start cylinder.bat this file is what we're going to want to use to start selling our Cube now the first time you run sonar it's going to connect to the database and see that the appropriate tables have not been created so it's going to need to create those tables which will take a little bit longer starting up then than it will on subsequent startups of sonar Cube you'll know that sonar cube is ready once you see the line Center Key was operational in your console so with that we can now access the sonar Cube to our browser by default sonar cube is going to be installed on Port 9000 so I can go to localhost 9000 and we're presented with the login page the default username and password you can find in the installation guide the default username is admin I'll put in the password and the first time we log in we're going to be presented with the screen to change our password so I want to update the password and now we're in the sonar Cube if you are using the Community Edition then that's it you've had sonar Cube set up and you are ready to start scanning code however if you're using a commercial version like I am with the Developer Edition it's going to need a license for you to use this so it's going to provide you the link how to install the license you'll see here that there is a server ID you'll need to copy this server ID and send this to your account representative with that they'll be able to give you a license key once you have your license key you can enter that here and sonar Cube will be ready for use there are some additional steps that you should take if you're going to be using Sonar cube in a production environment you can see those in the installation instructions under the operating the server the first step would be setting this up as a service here you can see the instructions for how to start this as a service additionally if you wanted to secure your server and use an HTTP proxy there's instructions for that down here under securing the server This is highly recommended if you're using a virtual machine running on the cloud such as through Azure or AWS there's also additional instructions for configuring other properties within sonar Cube within the documentation now if you have any problems while running sonar Cube it would be advised that you go to your installation directory and go into the logs directory and then here you'll see all of the logs that sonar Cube generates while it's running the first two places that you should probably look would be the sonar.log and the web.log most of the issues that you'll run into you will see logging for those here now that you've finished setting up your sonar Cube instance you're ready to start scanning your code they're Wizards available when you first log in to configure sonar cube with a variety of devops platforms or to scan code manually these Wizards will take you through the steps of how to scan and analyze your code once you've created your first project and you attempt to create other projects these Wizards will also be available to once again connect to the code and allow you to scan that thank you for taking the time to set up sonar cube with me foreign [Music]
Info
Channel: Sonar
Views: 29,286
Rating: undefined out of 5
Keywords:
Id: O0yFLS30InY
Channel Id: undefined
Length: 9min 30sec (570 seconds)
Published: Fri Aug 25 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.