The Jenkins master server needs specific software installed. In this video, learn how to install Java, NGINX, and Jenkins from the Ubuntu command line interface.
- [Instructor] Now that we have an EC2 Instance up and running, we need to install the software for our Jenkins master server. Since Jenkins is a Java-based application we'll need to install a Java development kit, or JDK. For Jenkins we'll add a link to the official application repository. And for NGINX we'll install from the default Ubuntu application repository. First, we need to get connected to the server. To connect to the server, we need the name which we can get from the AWS console.
On the EC2 page if we select our Instance and look on the description tab, we can find the public DNS which is the information we need to connect. There's also an icon here which we can click to copy the name to the clipboard. With the Instance name, we can connect to it via secure shell, also known as SSH. I'll be using a Mac terminal. In the terminal I'll start with the SSH command. And then -i followed by the path to the secret key to the server.
Now I'll add Ubuntu, the at sign, and I'll paste in the host name from the EC2 console. Ubuntu is the name of the default user for Ubuntu images. This is also the account that our public key was attached to when the Instance was created. Now if I press enter I'll get connected. Because I haven't connected to this Instance before I need to confirm that I do want to connect, so I'll type yes.
Now that we're logged in, we can change to the root user and start installing software. I'll do that by running sudo su - Now that our session has elevated privileges, we can start installing things. First we need to add the aptitude key for the Jenkins application. This allows us to verify packages from the Jenkins repository. We'll download the key from jenkins-ci.org and use the apt-key add command to add the key to the system.
We also need to add the Jenkins Debian repo to the aptitude sources list, and we can do that with an echo command that creates a jenkins.list file under the sources.list.d directory on our system.
Now our package system will know to connect to the Jenkins repository when we want to install Jenkins or check for updates. Speaking of updates, now we can update our sources list and upgrade any out of date packages. We'll do that by running apt update and apt upgrade.
We're prompted to continue, so we can just type enter here to continue. After all the currently installed packages are up to date, we can install the software for the Jenkins master. We need to install open.jdk-8-jdk, NGINX, and Jenkins. For best results, let's install these one at a time starting with the JDK.
And now let's install NGINX. And last but not least, let's install Jenkins. After everything is installed, to get a quick confirmation that Jenkins and NGINX are up and running, we can use the systemctl status command and pipe the output to grep for the word active.
This will give the status for each application and focus in on the details that we want to see. And indeed, both applications show that they are active. NGINX also shows running, which is just what we need.
Jenkins shows active exited, which in this case, is okay as well. The Jenkins service is running but the process that started Jenkins has exited. At this point we're almost done getting our server up and running. The next steps are configuring NGINX and Jenkins.
- Creating a Jenkins master instance
- Installing Java, Jenkins, and NGINX
- Creating SMTP credentials for SES
- Planning a build environment
- Creating roles, groups, and key pairs
- Creating a build server
- Connecting a master instance to a build server
- Planning a CI/CD pipeline
- Creating a GitHub repository for application code
- Deploying to Elastic Beanstalk from GitHub
- Adding email notifications
- Removing AWS resources