title: How to install tomcat use it in intellij. Ubuntu
body: <p><strong>What I try to do</strong></p>
  
  <p>I try to install tomcat on Ubuntu 18.4. Then I want to create simple <code>JavaEnterprise</code> app in <code>InteliJ Ultimate</code> with <code>RESTfulWebService</code> and <code>WebApplication</code>. </p>
  
  <p><strong>Ubuntu installation</strong></p>
  
  <p>I ran <code>sudo apt-get install tomcat9</code> and installation went sussessfully.</p>
  
  <p><strong>InteliJ configuration</strong></p>
  
  <p>However I don't know what to write in InteliJ configuration in <code>Tomcat Home</code> empty box. All the time I am getting error <code>'The selected directory is not valid Tomcat home'</code> .</p>
  
  <p><a href="https://i.stack.imgur.com/5LJQ6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5LJQ6.png" alt="enter image description here"></a></p>
  
  <p><strong>Possible solution, but I don't want to install tomcat manually</strong> </p>
  
  <p>It may be caused with a fact that it is recommended to install tomcat manually? <a href="https://www.javahelps.com/2015/03/install-apache-tomcat-on-ubuntu.html" rel="nofollow noreferrer">https://www.javahelps.com/2015/03/install-apache-tomcat-on-ubuntu.html</a></p>
  
  <p>I dont want to install it like that because uninstalling it later will be to hard for me and I will have mess in my system.</p>
  
  <p><strong>Docker installation</strong></p>
  
  <p>I gave up <code>apt-get</code> solution and I installed tomcat in docker with command:
      sudo docker run  tomcat:9.0</p>
  
  <p>I opened Docker tab in InteliJ:</p>
  
  <p><a href="https://i.stack.imgur.com/4sByK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4sByK.png" alt="Ubuntu 18.4, InteliJ IDEA Ultimate, docker,"></a></p>
  
  <p>I don't know how to inform InteliJ that in Docker Container called <code>recursing_haibt</code>
  is a tomcat server which will handle simple HelloWorld app and open it in browser</p>
  
  <p><a href="https://i.stack.imgur.com/Rc2H1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rc2H1.png" alt="enter image description here"></a></p>
  
  <p>I don't know what to do.</p>