# Setting up Jenkins Server

Steps:

1. Launch an EC2 instance: First, launch an Ubuntu instance on AWS EC2.
    
2. Install Java: Jenkins requires Java to run, so install the latest version of Java using the following command:
    
    ```bash
    sudo apt-get update
    sudo apt-get install fontconfig openjdk-11-jre
    ```
    
3. Install Jenkins: Add the Jenkins repository key to the system, add the Jenkins repository to the package sources, update the package list, and install Jenkins using the following commands:
    
    ```bash
    curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key|sudo tee \
        /usr/share/keyrings/jenkins-keyring.asc > /dev/null
    ```
    
    ```bash
    echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
        https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
        /etc/apt/sources.list.d/jenkins.list > /dev/null
    ```
    
    ```bash
    sudo apt-get update
    sudo apt-get install jenkins -y
    ```
    
4. Start Jenkins: Once the installation is complete, start the Jenkins service using the following command:
    
    ```bash
    sudo systemctl start jenkins
    sudo systemctl enable jenkins
    sudo systemctl status jenkins
    ```
    
5. Open a web browser and go to `http://<your-server-public-ip>:8080`.
    
6. Unlock the Jenkins by entering the Administrator password which is stored in `var/lib/jenkins/secrets/initialAdminPassword`
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677395041353/8be72ca5-c04c-411d-a575-466c6f210471.png align="center")
    
7. Click on suggested plugins. It is going to install all the suggested plugins.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677395178229/6aae3a24-2b16-4f49-af46-486d12e6892e.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677395270597/393e1346-374e-4ffd-9212-9a009918ee32.png align="center")
    
8. Create First Admin User and click on Save and Continue.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677395329571/a07e7a36-a435-4629-9165-53672113e244.png align="center")
    
9. Click on Start using Jenkins to log into Jenkins Dashboard.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1677395504121/6b855795-4b4f-4ffc-96cf-f4cc41aff37c.png align="center")
    

---

I hope this article will help you.

**\-K NIRANJANA**  

Follow on: [**LinkedIn**](https://www.linkedin.com/in/niranjana-koni/) [**GitHub**](https://github.com/niranjanakoni) [**HashNode**](https://hashnode.com/@NiranjanaKoni)
