How do I deploy my Jenkins build on a droplet?

I have Jenkins set up with nginx in a docker container on a droplet. I installed the plugin Deploy to Container on Jenkins. Now I need to set up a Tomcat server to deploy the Jenkins war file to.

So where does my Tomcat server go? And why do I need another server when I have a droplet already? Do I need a new docker container on my droplet for the tomcat server?

My Jenkinsfile deploy stage currently looks like this, but I need to context?

stage('Deploy') {
            steps {
                echo 'Deploying...'
                sh 'deploy contextPath: null, war: "/usr/share/jenkins/jenkins.war"'

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


It would not be a problem to run your Tomcat server on your existing Droplet. You can take a look at this tutorial here on how to install Tomcat on your Droplet:

Regarding the Pipeline itself, it would really depend on what setup you would like to have at the end, for example, if you like Jenkins to build your Java project and then containerize it and deploy it on the same server? If this is the case you could have a similar setup to this one:

That way your Jenkins container would have access to the Docker service on your host, and you can spin up containers from inside Jenkins and start them on your Droplet directly.

If you prefer not to run your app in a container, you could take another approach and share a volume between your Jenkins container and your Droplet, then with the copy command that you already have, you could copy the war file from your Jenkins container to the share volume so that the war file would be available on your Droplet where you could have your Tomcat running.

Regards, bobby