Create Jenkins on Oracle Cloud Compute OL8

Create Jenkins on Oracle Cloud Compute OL8

Follow the installation steps to configure your own Jenkins on Oracle Cloud Compute always FREE shape

  1. Create a compute instance using either
    VM.Standard.E2.1.Micro - if you do not intend to run CI/CD with 23c Free, since this shape does not provide sufficient resources to mount the DB.
    or
    If you are following my APEX CI/CD guide, your choice of...
    a. (Recommended) VM.Standard.E2.1 shape, provides more memory over the VM.Standard.E2.1.Micro and get run 23c Free, however, it is not an always-free instance.
    b. As Mohamad Subhi Bouchi suggests, a more expensive VM.Standard.E3.Flex with 15GB memory & 1 Gbps bandwidth.

  2. Download the Private & Public Keys

  3. Create the compute instance which will take about 5 mins to create

  4. Once provisioned, Right-click the VCN hyperlink and open the link in a new tab

  5. Click on Security Lists

  6. Click on Default Security List

  7. Click Add Ingress Rule using the following details

  8. Click Add Ingress Rule at the bottom

  9. Close the Browser Tab & Return to the Instance. You'll see this information:

  10. Copy the IP to the clipboard

  11. Install/Open Putty

    NOTE: If you're using a Windows machine to connect to the OCI instance, you must use a tool like PuTTYgen to convert the private key file to a format that PuTTY can use.

  12. Paste in the IP address in to Host Name (or IP address)

  13. **Connection>SSH>AUTH>Private key>**Select the Private Key

  14. On Session, Enter Jenkins_0 to Saved Sessions and click Save

  15. Double Click the Jenkins_0 and open a Putty session

  16. Username is opc

  17. Install Java (5mins)

    sudo yum install java-11-openjdk -y
    
  18. Add the repo

    sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
    
  19. Import the 2023 key (you'll need to find the right key for future releases)

    sudo rpm --import https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
    
  20. Install Jenkins

    sudo yum install jenkins -y
    
  21. Enable & Start Jenkins

    sudo systemctl enable jenkins
    sudo systemctl start jenkins
    
  22. Add firewall rules

    YOURPORT=8080
    PERM="--permanent"
    SERV="$PERM --service=jenkins"
    
    sudo firewall-cmd $PERM --new-service=jenkins
    sudo firewall-cmd $SERV --set-short="Jenkins ports"
    sudo firewall-cmd $SERV --set-description="Jenkins port exceptions"
    sudo firewall-cmd $SERV --add-port=$YOURPORT/tcp
    sudo firewall-cmd $PERM --add-service=jenkins
    sudo firewall-cmd --zone=public --add-service=http --permanent
    sudo firewall-cmd --reload
    
  23. Check in the browser

    http://<your_ip_address>:8080
    
  24. Make a coffee

  25. Now it should be ready

  26. In Putty, fetch the admin password by typing

    sudo cat /var/lib/jenkins/secrets/initialAdminPassword
    
  27. Enter the password into the browser

  28. Install Suggested Plugins

  29. Follow the steps to Create First Admin User

  30. ENJOY!