- SonarQube is a leading code quality and security analysis platform for multiple programming languages.
- Version 25.12 is the latest Community Build, offering updated rules and features.
- Supports static code analysis, bug detection, and vulnerability scanning in CI/CD pipelines.
- This guide will help you understand the process of Installing SonarQube on Ubuntu 24 for a secure and efficient setup.
Install Java (Java 21)
SonarQube 25.12 requires Java 21 as the preferred JDK for the server.
Install Java 21
sudo apt update
sudo apt install openjdk‑21‑jdk ‑y
Verify:
java ‑version
Install PostgreSQL
sudo apt install postgresql postgresql‑contrib ‑y
Create database and user for Sonar:
sudo -i -u postgres
psql
Inside psql:
CREATE DATABASE sonarqube;
CREATE USER sonar WITH ENCRYPTED PASSWORD 'YourStrongPass!';
GRANT ALL PRIVILEGES ON DATABASE sonarqube TO sonar;
\q
exit
Create SonarQube User
sudo useradd -m -d /opt/sonarqube -s /bin/bash sonar
Download and Extract SonarQube 25.12
Download the specific version:
cd /opt
sudo wget https://dl.sonarsource.com/communitybuilds/sonarqube/25.12.0.117093/sonarqube‑25.12.0.117093.zip
sudo unzip sonarqube‑25.12.0.117093.zip
sudo mv sonarqube‑25.12.0.117093 sonarqube
sudo chown -R sonar:sonar sonarqube
Configure SonarQube
Open the main config:
sudo nano /opt/sonarqube/conf/sonar.properties
Update database settings:
sonar.jdbc.username=sonar
sonar.jdbc.password=YourStrongPass!
sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube
Specify web host & port:
sonar.web.host=0.0.0.0
sonar.web.port=9000
Save and exit.
Set Up systemd Service
Create unit file:
sudo nano /etc/systemd/system/sonarqube.service
Add the following:
[Unit]
Description=SonarQube 25.12 service
After=network.target postgresql.service
[Service]
Type=forking
ExecStart=/opt/sonarqube/bin/linux‑x86‑64/sonar.sh start
ExecStop=/opt/sonarqube/bin/linux‑x86‑64/sonar.sh stop
User=sonar
Group=sonar
Restart=always
LimitNOFILE=65536
LimitNPROC=4096
[Install]
WantedBy=multi‑user.target
Reload and enable:
sudo systemctl daemon‑reload
sudo systemctl enable sonarqube
sudo systemctl start sonarqube
Check status:
sudo systemctl status sonarqube
Access SonarQube
Open browser:
http://<YOUR_SERVER_IP>:9000
Installing SonarQube 25.12 involves Java 21, PostgreSQL, and a dedicated system user for security.
Running SonarQube as a systemd service ensures automatic startup and management.
Using a reverse proxy (Nginx) and optional HTTPS improves accessibility and security.
SonarQube enables continuous code quality monitoring, helping teams detect bugs and vulnerabilities early.
Conclusion
Successfully Installing SonarQube on Ubuntu 24 requires the right server configuration, Java dependencies, database tuning, firewall setup, and performance optimization to ensure smooth code analysis and long-term stability. Even small misconfigurations can impact performance, security, or CI/CD integration.
If you’re unsure about any step or prefer expert assistance, our certified engineers are here to help. With years of experience in DevOps Support Services and enterprise-grade Server Management Services, we ensure secure deployment, seamless CI/CD integration, ongoing monitoring, and performance optimization tailored to your infrastructure.
Whether you need help with initial installation, production hardening, scaling SonarQube for large development teams, or integrating it into your DevOps pipeline, our team provides reliable 24/7 support to keep your environment stable and efficient.
Get in touch today and let our experts handle your SonarQube deployment with precision and confidence.