Before refering to this jenkins installation, we must have a ECS provisioned in Huawei Cloud.
Prequisites before installing Jenkins :
1. Create VPC
On the HUAWEI CLOUD management console, choose Products > Network > Virtual Private Cloud.
Click Access Console.
Click the Region area in the upper left corner to switch to CN AP-Singapore.
Click Create VPC.
Configure related parameters and click Create Now.
Note: To prevent VPC name conflicts, you are advised to set the VPC name to vpc-name, where name indicates the trainee's name, for example, vpc-wq.
Step 6 Return to the console and verify that the creation is successful.
2. Create and Configure Security Groups
On the HUAWEI CLOUD management console, choose Products > Network > Virtual Private Cloud.
Choose Access Control > Security Groups. Then click Create Security Group.
In the Create Security Group dialog box, enter a security group name and click OK
Click the security group name. The page for configuring security group rules is displayed.
3. Buy ECSs
On the HUAWEI CLOUD management console, choose Products > Compute > Elastic Cloud Server.
Click Buy Now.
Configure related parameters and click Next: Confirm.
Confirm the configurations and click Next.
Return to the console and wait until the ECS status changes to Running.
note: In my case i have used Linux Ununtu Distro for creating my ECS.
Step 1 — Installing Jenkins
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins
Step 2 — Starting Jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins
Step 3 — Opening the Firewall
sudo ufw allow 8080
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status
Step 4 — Setting Up Jenkins
To set up your installation, visit Jenkins on its default port, 8080, using your server domain name or IP address: http://your_server_ip_or_domain:8080
You should receive the Unlock Jenkins screen, which displays the location of the initial password:
In the terminal window, use the cat command to display the password:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Copy the 32-character alphanumeric password from the terminal and paste it into the Administrator password field, then click Continue.
The next screen presents the option of installing suggested plugins or selecting specific plugins:
We’ll click the Install suggested plugins option, which will immediately begin the installation process.
When the installation is complete, you’ll be prompted to set up the first administrative user. It’s possible to skip this step and continue as admin using the initial password we used above, but we’ll take a moment to create the user.
Enter the name and password for your user:
You’ll receive an Instance Configuration page that will ask you to confirm the preferred URL for your Jenkins instance. Confirm either the domain name for your server or your server’s IP address:
After confirming the appropriate information, click Save and Finish. You’ll receive a confirmation page confirming that “Jenkins is Ready!”:
Click Start using Jenkins to visit the main Jenkins dashboard:
Hope this jenkins server setup on Huawei Cloud ECS instance help. Note: If you have any query or doubt regarding the jenkins installation and server setup feel free to message me or drop a comment here. Happy to help!!!