-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsonarquebe-setup-in-lrhell
More file actions
53 lines (37 loc) · 1.29 KB
/
sonarquebe-setup-in-lrhell
File metadata and controls
53 lines (37 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# SonarQube installation script for RHEL
set -e
# Update system
yum update -y
# Install prerequisites
yum install -y wget unzip java-17-openjdk firewalld
# Start and enable firewalld
systemctl enable firewalld
systemctl start firewalld
# Download SonarQube (LTS version 8.9.6)
cd /opt
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-8.9.6.50800.zip
unzip sonarqube-8.9.6.50800.zip
# Create sonar user
id -u sonar &>/dev/null || useradd sonar
# Set ownership and permissions
chown -R sonar:sonar sonarqube-8.9.6.50800
chmod -R 755 sonarqube-8.9.6.50800
# Create symlink for convenience
ln -sfn sonarqube-8.9.6.50800 sonarqube
# Open firewall port 9000
firewall-cmd --permanent --add-port=9000/tcp
firewall-cmd --reload
echo "✅ SonarQube installed. Switch to 'sonar' user and start manually:"
echo "su - sonar"
echo "sh /opt/sonarqube/bin/linux-x86-64/sonar.sh start"
echo "Then access SonarQube at http://<RHEL_VM_IP>:9000"
echo "Default login: admin / admin"
run after this
[root@rhel-vm ~]# su - sonar
Last login: Sat Jan 3 16:37:12 UTC 2026 on pts/0
[sonar@rhel-vm ~]$ sh /opt/sonarqube/bin/linux-x86-64/sonar.sh start
Starting SonarQube...
Started SonarQube.
[sonar@rhel-vm ~]$ sh /opt/sonarqube/bin/linux-x86-64/sonar.sh status
SonarQube is running (235350).