Installing SonarQube on Windows 10 isn’t exactly a walk in the park, but it’s doable when you know what to look out for. Often, the biggest headaches come from missing dependencies or misconfigurations, especially with Java or the database. If you’ve tried running SonarQube and it just won’t start, or the dashboard isn’t showing up, these steps should help troubleshoot enough to get it at least running locally. It’s kind of weird, but sometimes just restarting the server or double-checking your config files solves the issue. Usually, it’s all about making sure Java runs smoothly and that the database connection info is spot on. Once everything is aligned, you should be good to analyze code for quality and security issues. Here’s how to do it step-by-step, with a few tips thrown in based on real-world hiccups.
How to Install and Fix SonarQube on Windows 10
Ensure Java is Correctly Installed and Set Up
If SonarQube won’t start, the first thing to check is whether Java is installed and properly configured. SonarQube needs Java 11, typically, but double-check your version against the SonarQube documentation.
- Download the latest JDK from Oracle’s website or use OpenJDK.
- Install it, then open Command Prompt and run
java -version
. If you see the correct Java version, good. If not, go back and set the JAVA_HOME environment variable. To do that, right-click This PC, choose Properties, then Advanced system settings. Under Environment Variables, add or edit JAVA_HOME to point to your JDK folder (likeC:\Program Files\Java\jdk-11.0.x
), then add%JAVA_HOME%\bin
to your Path variable.
On some machines, this doesn’t work right away, so restart Command Prompt or even your PC if needed. This way, Java’s in the system path and SonarQube can find it.
Download and Extract SonarQube
Head over to the SonarQube download page and grab the edition you want — Community is free, but if you’re doing enterprise stuff, the paid ones add more features. Extract the zip to something like C:\SonarQube. No surprises here, but make sure the folder path doesn’t have spaces or weird characters, or SonarQube could choke.
Configure Your Database Correctly
SonarQube doesn’t include its own database, so you’ll need one like PostgreSQL or MySQL. On one setup I did, PostgreSQL was easiest. Create a new database and user; for example:
CREATE DATABASE sonarqube; CREATE USER sonaruser WITH PASSWORD 'yourpassword'; GRANT ALL ON DATABASE sonarqube TO sonaruser;
Then, open C:\SonarQube\conf\sonar.properties and update your database connection info:
sonar.jdbc.username=sonaruser sonar.jdbc.password=yourpassword sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube
This part trips folks up a lot if you forget to tweak the file or don’t restart the server after changes.
Start the SonarQube Server
Navigate to the bin folder inside your extracted SonarQube directory. For Windows, it’s probably C:\SonarQube\bin\windows-x86-64. Right-click StartSonar.bat and pick Run as Administrator.
Yes, you might see a flash of logs or a command prompt pop up — don’t freak out if it seems slow or throws errors, but IF you see errors about Java or database, double-check the paths and configs. Some people just kill the process and restart if things hang. On some setups, the first run fails but subsequent ones work fine after a reboot or cleaning temp files.
Access the Dashboard in Your Browser
If the server starts okay, open http://localhost:9000 in your favorite browser. You should see the login screen with default credentials: admin
/ admin
. If it doesn’t load, verify the server is running and that your firewall isn’t blocking port 9000.
Sometimes, just restarting the server or your PC makes a difference — Windows and SonarQube don’t always play nice on the first try.
Extra Tips for Troubleshooting
If SonarQube refuses to start or crashes midway, check the logs stored in C:\SonarQube\logs. Look for errors related to Java, database, or memory. On some setups, increasing the heap size in sonar.properties can help:
# For example, add these lines at the end wrapper.java.opts=-Xmx4g -Xms512m
In practice, some machines need a bit more heap. If memory errors pop up, bump it up. Also, make sure Java isn’t running any conflicting versions, especially if you have multiple JDKs installed.
Summary
- Install Java 11+ and update environment variables if needed.
- Download and set up SonarQube, making sure paths are simple.
- Configure a working database connection.
- Start the server, check logs if anything goes wrong.
- Access the dashboard at http://localhost:9000.
Wrap-up
Getting SonarQube up and running locally isn’t always straightforward, especially with Java and database stuff. But once it’s working, it’s a serious boost to code quality. The key is double-checking configs, watching log files, and sometimes doing a quick reboot. The first time’s rough, but after that, it’s just routine maintenance. Fingers crossed this helps someone avoid the same frustrations experienced on multiple setups — of course, Windows loves to make things a little harder than necessary.