# Deploy to remotes computers

**URL:** <https://community.jenkins.io/t/deploy-to-remotes-computers/580>\
**Category:** Ask a question\
**Created:** [October 19, 2021, 10:24am UTC](https://community.jenkins.io/t/deploy-to-remotes-computers/580 "2021-10-19T10:24:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anersantana](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@anersantana](https://community.jenkins.io/u/anersantana)\
**Post date:** [October 19, 2021, 10:24am UTC](https://community.jenkins.io/t/deploy-to-remotes-computers/580/1 "2021-10-19T10:24:49Z")

</div>

Hello.

Im new on jenkins. And im facing this situation.

I already create a jenkins pipeline script to create a war file to deploy on Tomcat. I want to know if there is a way to build project on my controller who already creates a war and after war is build sent to my agent. Because i dont want to sent project to 3 agents and build everyting on then.

I have different enviroments, windows and linux and sent to agents will led me to configure all deployment perrequisites on every server (npm to build react, gradle to build war, etc).

My wish is to create and generate war file on controller and sent this war file to agents. This agent only will need to sent war file to tomcat on their side.

Any help apreciated, thanks.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [October 21, 2021, 4:27am UTC](https://community.jenkins.io/t/deploy-to-remotes-computers/580/2 "2021-10-21T04:27:27Z")

</div>

I’ve never deployed a war file from Jenkins to Tomcat, but here are several links that Google search found:

[https://www.theserverside.com/video/Step-by-step-Jenkins-Tomcat-deploy-of-a-WAR-file](https://www.theserverside.com/video/Step-by-step-Jenkins-Tomcat-deploy-of-a-WAR-file)

> **[Jenkins Tomcat Deploy - Deploying Application to Tomcat using Jenkins](https://www.middlewareinventory.com/blog/jenkins-tomcat-deploy-deploying-application-tomcat-using-jenkins/)**
>
> Jenkins Tomcat Deploy, Deploying Application to Tomcat using Jenkins, How to deploy the application code from Github to Tomcat using Jenkins. Jenkins Continuous Integration and Jenkins Continuous Deployment example with Tomcat. Jenkins and Tomcat...

> **[Deploy Application Using Jenkins, Tomcat Server, and PollSCM](https://appfleet.com/blog/deploy-application-using-jenkins-tomcat-server-and-pollscm/)**
>
> In this guide, we are going to use Docker to configure Jenkins and Tomcat to achieve Continuous Integration/Continuous Deployment. We will install and set up Tomcat and Jenkins using Docker, and thereafter we are going to create a Jenkins Job to...

[https://www.jdev.it/deploying-your-war-file-from-jenkins-to-tomcat/](https://www.jdev.it/deploying-your-war-file-from-jenkins-to-tomcat/)

---

<div class="post-metadata">

**Author:** ![Ian\_W](https://avatars.discourse-cdn.com/v4/letter/i/cab0a1/32.png) [@Ian\_W](https://community.jenkins.io/u/Ian_W)\
**Post date:** [October 22, 2021, 7:29am UTC](https://community.jenkins.io/t/deploy-to-remotes-computers/580/3 "2021-10-22T07:29:56Z")

</div>

Building on the controller is considered a security risk. Building the same artifact over and over is also a bad practice; you could end up with slightly different artifacts depending on environment.

You could set up an agent co-located on the controller server, running as a different user (isolating from controller data)  
Build on that agent and then deploy to the targets. Could be in a single pipeline or a build job, then a deploy job that either called once/target or deploys at once to all 3 (matrix job style - eg:[Welcome to the Matrix](https://www.jenkins.io/blog/2019/11/22/welcome-to-the-matrix/))
