
Jenkins + Tomcat: How to Set It Up
Want to use Jenkins and Tomcat together? You're in the right spot.
Here, I'll break down everything you need to know to set up Jenkins, the open source automation server for CI/CD, with Tomcat, the open source Java HTTP web server environment. This is a step-by-step guide for you that you can easily follow to get yourself up and running.
Table of Contents
Why Use Jenkins + Tomcat?
Apache Tomcat is a powerful servlet Java container for running web applications. If you are running your apps in Tomcat, or wish to do so, you might also want to run Jenkins in it. This creates a unified experience, which is easier to manage.
Jenkins is an open source automation server, commonly used for CI/CD (continuous integration / continuous deployment). Jenkins’ hundreds of plugins enable developers to automate their software development lifecycle, including building and deploying of code and features.
Jenkins is also a great way achieve agile testing by leveraging continuous feedback and higher code quality — which translates to faster deliveries. That way you can beat competition to market.
If you are looking to install Jenkins in other ways, read how to install Jenkins on Windows and with a WAR file.
Now, let’s get started.
Back to topHow to Set Up Jenkins + Tomcat
Here's how you can set up Jenkins + Tomcat.
1. Install JDK
First, install JDK. Jenkins supports Java 8. If you need help with installing Java, go to this link.
2. Install the Tomcat Server
Next, we'l install Tomcat. If you have already installed Tomcat, jump to step 3 to install Jenkins.
a. Go to the Tomcat Site
Go to the official Tomcat website and choose the Tomcat version to download on your machine. In this example, I chose version 9.
📘 Related Resource: Learn more about Apache Tomcat Solutions
b. Choose Your Binary
Choose the appropriate binary for your machine. In this case, I chose the binary for Windows 64-bit, which you can see below.
c. Copy the Download Zip File
Copy the downloaded zip file to the location of your choice and unzip it. In this example, I copied it to the folder C:\Tomcat.
d. Go to the Subfolder
Go to the sub folder bin and click on the startup windows bat file.
The Tomcat server will start running.
e. Launch Tomcat
Browse to the url http://localhost:8080 to launch the Tomcat server.
Now that Tomcat is installed, it's time to move on to the next step: installing Jenkins.
Ready to revolutionize how you test with Jenkins + Tomcat? Start testing with BlazeMeter for FREE today!
3. Install Jenkins
We can now install Jenkins.
a. Download the Latest WAR File
Download the latest Jenkins WAR file here.
b. Copy the WAR File
Copy the jenkins.war file to the subfolder webapps in the Tomcat installation. It will auto generate a jenkins folder on your machine.
c. Launch Jenkins
Go to the url http://localhost:8080/jenkins to launch the initial Jenkins page.
d. Unlock Jenkins
To unlock Jenkins, paste the random password copied from the file C:\Users\\.jenkins\secrets\initialAdminPassword. Paste it in the Administrator password field and then click on the “Continue” button to proceed.
e. Install Suggested Plugins
Either click on “Install suggested plugins” to install the default plugins or “Select plugins to install” to install the plugins you want. In this case we will install the default suggested plugins.
f. Wait
The plugins will install, I promise! So please wait until this process is completed.
g. Create Admin User
Create your first admin user for Jenkins and click on the “Save and Continue” button.
h. Complete the Installation
Click “Save and Finish” to complete the installation.
i. Start Using Jenkins
This is the last step! Click in “Start using Jenkins” to open the default Jenkins page.
j. Get Started With Jenkins and Tomcat
You can now start your job with Jenkins and Tomcat.
Bottom Line
You now know how to create a more cohesive experience by using Jenkins and Tomcat together. But whatever you do with Jenkins, it is important to make sure that you add your performance and load tests to the CI cycle.
And the best way to do it? Using BlazeMeter.
BlazeMeter integrates seamlessly with Jenkins, allowing you to not just add performance testing, but to accelerate and scale your performance testing. With Jenkins and BlazeMeter, you can continuously run your tests. You can schedule them to run after every build, every night, quarterly or according to any other business and technological criteria you have.
See Jenkins and BlazeMeter in action. Start testing with BlazeMeter today.
This blog was originally published on August 1, 2018 and has since been updated for accuracy and relevance.
Related Resources
- BlazeMeter University
- How to Install Jenkins on Windows
- 2 Ways to Integrate JMeter Tests into Jenkins
- JMeter Tutorial
- Jenkins + Selenium: How to Setup and Run Tests
- How to Load Test Tomcat Servers