<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Babis K</title>
    <description>The latest articles on DEV Community by Babis K (@babis).</description>
    <link>https://dev.to/babis</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F613878%2F20f456d7-3510-4f7a-930b-cd515a510caa.jpeg</url>
      <title>DEV Community: Babis K</title>
      <link>https://dev.to/babis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/babis"/>
    <language>en</language>
    <item>
      <title>How to run JetBrains IDEs with Projector and Docker</title>
      <dc:creator>Babis K</dc:creator>
      <pubDate>Tue, 13 Apr 2021 17:18:48 +0000</pubDate>
      <link>https://dev.to/babis/how-to-run-jetbrains-ides-with-projector-and-docker-1ph</link>
      <guid>https://dev.to/babis/how-to-run-jetbrains-ides-with-projector-and-docker-1ph</guid>
      <description>&lt;p&gt;As described in the &lt;a href="https://dev.to/babis/jetbrains-projector-docker-images-2j3e"&gt;previous post&lt;/a&gt;, the Projector is JetBrains’ solution to remote development. It’s not a perfect solution but it has it’s uses. In this post, we will see how to use Docker to run the IDEs with Projector and how to connect to them.&lt;/p&gt;

&lt;p&gt;Projector is a client server solution. We need to deploy the two components, client and server, manually and independently. Thankfully, Docker simplifies the server side deployment a lot. Especially if you use the images I maintain in DockerHub!&lt;/p&gt;

&lt;h3&gt;
  
  
  Projector server
&lt;/h3&gt;

&lt;p&gt;The projector server is to be deployed on the machine that will host the IDE, the code, the builds and maybe the execution of the application you will develop through the IDE. So it could be a cloud instance, a headless server at your workplace or something similar. The host should have Docker already installed. Follow the &lt;a href="https://docs.docker.com/engine/install/"&gt;official guide&lt;/a&gt; if you need help with that.&lt;/p&gt;

&lt;p&gt;To start the IDE of your choice with Projector, connect to the shell of the server (via SSH probably) and issue the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run --rm -p 8887:8887 --name &amp;lt;container-name&amp;gt; projectorimages/&amp;lt;Image-Name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;&amp;lt;Image-Name&amp;gt;&lt;/code&gt; with the name of the application you want and the &lt;code&gt;&amp;lt;container-name&amp;gt;&lt;/code&gt; with an identifier of your liking. This will download the latest stable version from DockerHub and start a container which will listen on port 8887 on the host. For example, to start IntelliJ IDEA Community in a container name idea-community:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run --rm -p 8887:8887 --name idea-community projectorimages/projector-idea-c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find the list of available images and their versions in &lt;a href="https://hub.docker.com/u/projectorimages"&gt;DockerHub&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Projector client
&lt;/h3&gt;

&lt;p&gt;There are two client options, you may use your browser in the client (which may be a tablet or a Chromebook), or you may download the Projector Client from JetBrains.&lt;/p&gt;

&lt;h4&gt;
  
  
  Browser
&lt;/h4&gt;

&lt;p&gt;Open a new tab in your browser and navigate to the address of the server you deployed above, at port 8887. So if your server is at IP 192.168.1.3, type in the browser address bar: &lt;code&gt;http://192.168.1.3:8887&lt;/code&gt;. This will connect to the Projector and show you your familiar IDEA interface.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bneZIFJm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/www.kaidos.me/wp-content/uploads/2021/04/projector-IDEA.png%3Fresize%3D750%252C422%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bneZIFJm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/www.kaidos.me/wp-content/uploads/2021/04/projector-IDEA.png%3Fresize%3D750%252C422%26ssl%3D1" alt=""&gt;&lt;/a&gt;IntelliJ IDEA in a browser&lt;/p&gt;

&lt;h4&gt;
  
  
  Projector Client
&lt;/h4&gt;

&lt;p&gt;JetBrains has developed a client for Projector based on &lt;a href="https://www.electronjs.org/"&gt;Electron&lt;/a&gt;. You may opt to install it on you client machine as according to a &lt;a href="https://blog.jetbrains.com/blog/2021/03/11/projector-is-out/"&gt;blog post&lt;/a&gt; by the creators, it supports shortcuts that are unavailable through a browser. You may download the latest version for Windows, Linux or Mac from &lt;a href="https://github.com/JetBrains/projector-client/releases"&gt;here&lt;/a&gt;, or though the JetBrains toolbox if you have it installed.&lt;/p&gt;

&lt;p&gt;When you start the Projector client you are greeted with an input field and a large “Connect” button. You are supposed to enter the HTTP address and port as you did in the browser to connect to the IDE.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8jkiqg0w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/www.kaidos.me/wp-content/uploads/2021/04/projector-client.png%3Fresize%3D750%252C422%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8jkiqg0w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/www.kaidos.me/wp-content/uploads/2021/04/projector-client.png%3Fresize%3D750%252C422%26ssl%3D1" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When connected, the experience is as close to natively running IntelliJ as it gets right now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--x1H7DGw_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/www.kaidos.me/wp-content/uploads/2021/04/projector-client-connected.png%3Fresize%3D750%252C422%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--x1H7DGw_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/www.kaidos.me/wp-content/uploads/2021/04/projector-client-connected.png%3Fresize%3D750%252C422%26ssl%3D1" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Saving state of Projector containers
&lt;/h3&gt;

&lt;p&gt;When you stop the container we started at the beginning of this post, all the data you created with your IDE (code, plugins downloaded, settings, licenses) will be lost. Of course this is not desirable as we want to quickly resume our work after the server is restarted or when we update our IDE. We can use a folder of the server to store all the data of the container and be able to mount it to future containers. So first create a directory (e.g. in your home folder) and then use it to mount at the &lt;code&gt;/home/projector-user&lt;/code&gt; location in the container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir ~/projector_data
docker run --rm -p 8887:8887 -v ~/projector_data:/home/projector-user --name idea-community projectorimages/projector-idea-c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Running multiple IDEs on the same server
&lt;/h3&gt;

&lt;p&gt;In many cases it is required to run multiple IDEs when developing. For example I frequently run PyCharm alongside WebStorm for my backend and frontend. You can do that with Projector too and you can even use the same directory to save data as the IDEs don’t work on the same files.&lt;/p&gt;

&lt;p&gt;There’s only one thing to take care, bind each IDE to a different host port, it is not possible to have two containers bound the same host port. So you may decide to bind PyCharm on 8887 and WebStorm on 8888. Here’s how to start the containers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run --rm -p 8887:8887 -v ~/projector_data:/home/projector-user --name pycharm-community projectorimages/projector-pycharm-c
docker run --rm -p 8888:8887 -v ~/projector_data:/home/projector-user --name webstorm projectorimages/projector-webstorm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Working with multiple projects on the same IDE
&lt;/h3&gt;

&lt;p&gt;This is the biggest problem with projector. When you want to work with two or more projects in one IDE, you are asked to open each one in its own window. The same thing happens with Projector, but both IDE windows open in the same browser tab or client instance. It is not possible to have a separate client for each IDE window. That means that you have to switch windows in the same tab using the Ctrl+Alt+[and Ctrl+Alt+] shortcuts. Not to mention that many times windows seem to get stuck one above the other. Or the fact that you cannot take advantage of your multi-screen setup.&lt;/p&gt;

&lt;p&gt;You may be tempted to start a new projector server for each project that you want to open, but this itself has its own drawbacks. You cannot use the same directory mount for both containers as the first one locks files and disallows access to the next ones. You may use a different mount point but then you need to re-enter all your IDE settings, licenses and plugins and also remember which mountpoint to use when you want to open the project again in the future. It’s really cumbersome.&lt;/p&gt;

&lt;h3&gt;
  
  
  Updating IDEs to a newer version
&lt;/h3&gt;

&lt;p&gt;If you used the commands above, it implied that you downloaded the latest docker images available as the default tag is “latest”. When a new version is available, you have to stop the running container, pull the latest image again and restart it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker stop pycharm-community
docker pull projectorimages/projector-pycharm-c
docker run --rm -p 8887:8887 -v ~/projector_data:/home/projector-user --name pycharm-community projectorimages/projector-pycharm-c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or you may use the tags available at DockerHub to have more control on the version you are running.&lt;/p&gt;

&lt;p&gt;One thing to note, you shouldn’t download new versions when prompted by the IDE as these updates will be lost the next time you restart the container.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Projector as a solution for remote development has left me with mixed feelings. It is usable if you can live with the shortcomings – no real multi-project support, occasional latency based on network condition, cumbersome and manual setup and maintenance. It’s miles behind the one-click wonder of VSCode. But if you have learned to live with the goodies JetBrains IDEs have over VSCode (Java support, automation of tasks, refactoring, plugins) it may be worth the effort until something better is available.&lt;/p&gt;

&lt;p&gt;If your remote server is not headless, I had much better experience running IntelliJ on the remote and using SSH X-Forwarding to get the UI in my thin client.&lt;/p&gt;

&lt;p&gt;Or if your client is strong enough to index and build your project and you need the remote server to only run/debug your application, consider using the new (in 2021.1) &lt;a href="https://blog.jetbrains.com/idea/2021/01/run-targets-run-and-debug-your-app-in-the-desired-environment/"&gt;Run Targets&lt;/a&gt; feature which is promising.&lt;/p&gt;

</description>
      <category>jetbrains</category>
      <category>projector</category>
      <category>docker</category>
      <category>ide</category>
    </item>
    <item>
      <title>JetBrains Projector Docker images</title>
      <dc:creator>Babis K</dc:creator>
      <pubDate>Tue, 13 Apr 2021 09:49:57 +0000</pubDate>
      <link>https://dev.to/babis/jetbrains-projector-docker-images-2j3e</link>
      <guid>https://dev.to/babis/jetbrains-projector-docker-images-2j3e</guid>
      <description>&lt;p&gt;In the world of IDEs JetBrains has some widely used solutions like IntelliJ IDEA and PyCharm. Microsoft with VSCode has been steadily gaining traction the last few years as it’s a really nice product, albeit much simpler and reduced in functionality compared to JetBrains’ products or Eclipse.&lt;/p&gt;

&lt;p&gt;The pandemic that changed our workspace and habbits the last year has seen VSCode exploding due to a killer feature; remote development. This feature allows the user of the IDE to have it automatically install a server instance in a remote server and use the local window as a frontend. This means that code development, indexing, builds and everything happens remotely (over SSH) and the user is not involved in setting up complex setups to do this; he just works with the IDE as if it was local development.&lt;/p&gt;

&lt;p&gt;The use cases for this kind of setup are varying. Some companies require employees to develop on remote servers and not check out code on their home computers for security reasons. Other people develop directly on cloud instances to replicate the production environment. And other people like me, want to use their power-horse headless server to develop because their measly laptop is not up to par.&lt;/p&gt;

&lt;p&gt;So JetBrains has been loosing clients to VSCode and has been working on a feature for &lt;a href="https://youtrack.jetbrains.com/issue/IDEA-226455"&gt;remote development&lt;/a&gt; for quite a few months now and has provided the Projector solution as an attempt to remedy the problem.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/JetBrains/projector-server"&gt;Projector&lt;/a&gt; is a server that can run any Java Swing application and “project” the UI over HTTP(S) to a remote client. All JetBrains IDEs happen to be Swing applications so there you have it. The remote client may be a browser or an Electron app developed by JetBrains called Projector Client.&lt;/p&gt;

&lt;p&gt;You can install the Projector server as a plugin to the IDE and connect to it, but this doesn’t cover most of the use cases where the server is headless (like an AWS instance). Projector can run headless of course but then the user needs to manually install it in the remote machine, connect it with the IDE and start it before connecting to it. It’s not very streamlined yet as you can understand.&lt;/p&gt;

&lt;p&gt;Thankfully JetBrains has created a project to package their IDEs and &lt;a href="https://github.com/JetBrains/projector-docker"&gt;projector as Docker containers&lt;/a&gt; which greatly eases the process. But for some strange reason they don’t upload the container images in DockerHub and they don’t even maintain their privately hosted images. The current IDEA image is several months old at version 2020.2.1 while the current latest is 2021.1. They have an &lt;a href="https://youtrack.jetbrains.com/issue/PRJ-284"&gt;issue&lt;/a&gt; about that, but no indication of resolution.&lt;/p&gt;

&lt;p&gt;Thus I decided to create a semi-automatic process that will use the projects created by JetBrains and will build and upload to DockerHub images for all their IDEs, the &lt;a href="https://github.com/projectorimages/jet-builder"&gt;Jet-Builder&lt;/a&gt;. This project uses git tags to trigger different build jobs in DockerHub. All the created images can be found &lt;a href="https://hub.docker.com/u/projectorimages"&gt;here&lt;/a&gt;. I believe I will be able to trigger the build job soon after new versions are released until I make a scrapper to collect their release announcements automatically.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-idea-c"&gt;IntelliJ IDEA Community&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-pycharm-c"&gt;PyCharm Community&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-idea-u"&gt;IntelliJ IDEA Ultimate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-pycharm-p"&gt;PyCharm Professional&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-webstorm"&gt;WebStorm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-rubymine"&gt;Rubymine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-phpstorm"&gt;PhpStorm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-rider"&gt;Rider&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-datagrip"&gt;Datagrip&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-goland"&gt;GoLand&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/r/projectorimages/projector-clion"&gt;CLion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can use the &lt;a href="https://github.com/JetBrains/projector-docker/blob/12ae87c11899a69b89b5fd5cb636d8e4ae2b18ad/README.md"&gt;instructions&lt;/a&gt; provided by JetBrains to run these projector images, replacing their images with the ones above. Or wait for my next blog post!&lt;/p&gt;

</description>
      <category>jetbrains</category>
      <category>projector</category>
      <category>docker</category>
      <category>images</category>
    </item>
  </channel>
</rss>
