SonarQube Installation on EC2
Install SonarQube in the /opt
directory on Ubuntu, follow these steps:
Update Package List and Install Dependencies:
sudo apt update -y sudo apt install openjdk-11-jdk wget unzip
Download SonarQube: Visit the SonarQube download page to get the latest version URL or use the command below for a specific version. For example:
wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.6.1.62043.zip
Extract the Downloaded File:
sudo unzip sonarqube-9.6.1.62043.zip -d /opt
Create a SonarQube User (Optional but recommended for security):
sudo useradd --system --home /opt/sonarqube --shell /bin/false sonarqube
Change Ownership of the SonarQube Directory:
sudo chown -R sonarqube:sonarqube /opt/sonarqube-9.6.1.62043
Configure SonarQube: Edit the
sonar.properties
file to set up SonarQube (e.g., database configuration, web server ports, user & passwd):
sudo vi /opt/sonarqube-9.6.1.62043/conf/sonar.properties
Create a Systemd Service File: Create a service file for SonarQube to manage it as a systemd service:
sudo vi /etc/systemd/system/sonarqube.service
Add the following content:
[Unit] Description=SonarQube After=syslog.target network.target [Service] Type=forking User=sonarqube Group=sonarqube ExecStart=/opt/sonarqube-9.6.1.62043/bin/linux-x86-64/sonar.sh start ExecStop=/opt/sonarqube-9.6.1.62043/bin/linux-x86-64/sonar.sh stop LimitNOFILE=65536 LimitNPROC=8192 Restart=always [Install] WantedBy=multi-user.target
Reload Systemd and Start SonarQube:
bashCopy codesudo systemctl daemon-reload sudo systemctl start sonarqube sudo systemctl enable sonarqube
Access SonarQube at
http://<public IP>:9000
Feel free to share and spread the knowledge! ๐๐ Enjoy Learning! ๐
Subscribe to my newsletter
Read articles from KALPESH MOHANTA directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
KALPESH MOHANTA
KALPESH MOHANTA
๐ Hi there! Welcome to my DevOps adventure! ๐ I'm Kalpesh, a DevOps Engineer, and I'm thrilled to share my journey in the dynamic world of DevOps and Cloud Technologies. ๐ ๐ง Tech Arsenal: CI/CD Automation: Streamlining workflows for seamless deployments. Containers & Orchestration: Docker & Kubernetes. Cloud Platforms: Azure, AWS. Version Control: Git. Configuration Management: YAML, Linux commands. ๐ My Journey: I've had the privilege to work on diverse projects, including a notable deployment for PepsiCo. My expertise spans CI/CD automation, containerization, cloud services, and scripting to enhance system performance and reliability. ๐ก Why Follow Me? Join me as I delve into: Cutting-edge DevOps practices. Automation techniques. Cloud innovations. Tips & tricks for aspiring DevOps professionals. ๐ค Connect & Collaborate: Let's build, learn, and innovate together. Whether you're a fellow tech enthusiast, a professional looking to share insights, or someone eager to learn, let's connect and grow in this vibrant community. ๐ข Follow my LinkedIn & Hashnode blog for insights, tutorials, and updates. Together, we'll embrace the ever-evolving DevOps landscape!