How to launch Eclipse Theia

In this article series we provide an overview on how to get started with Eclipse Theia. More precisely, we will describe how to easily launch your own instance, how to use Theia as an IDE, how to customize which extensions and plugins your Eclipse Theia instance includes, and how to add your own extensions and plugins (including VS Code plugins). 

In case you wonder what Eclipse Theia is, please see here for an introduction. In this article, we start with a very simple question:

How to launch/run Eclipse Theia to use it as an IDE for development?

There are several ways to launch/run Theia, so when getting started this can already be a confusing question. As always it depends on your use case. We’ll describe four options below. Option 1 and 4 are the fastest in case you just want to try it out. We will highlight the benefits of every option in the respective section. Please note that this article is meant to be an overview, so we won’t go into too much detail, but will will link existing technical documentation for detailed instructions in the corresponding sections in case you want to explore even further. If you are a seasoned web developer who knows how to build and launch web applications, in particular node.js applications, many of the following steps will be pretty familiar to you. If you have not used node.js yet, and you are new to Theia, and would like to try it out, this blog post should help you in your first steps.

Option 1: Launch it from a package.json (plain and simple)

As Theia and its extensions are node.js packages and a Theia application is a collection of packages, one very simple way to launch Theia plus selected extensions is to create a package.json listing all extensions you want to include and launch this using CLI. The Theia documentation provides a blueprint for such a package.json (see here). After installing the dependencies, by simply running yarn in your Theia application package and building it by invoking the Theia CLI, you can directly launch Theia from the command line and access it in the browser. The advantage of this way of launching Theia is that it is very simple and does not require more than yarn and npm. It also allows you to very easily add and remove extensions (we will publish a follow up article on how to customize Eclipse Theia for the concrete commands and further details).

Option 2: Use the preconfigured docker image (’cause container are great)

Option 1 requires you to have npm and yarn installed on your local machine so that you can download all Theia extensions, including their dependencies, and build your Theia application. Certain Theia extensions, however, might have specific, additional system requirements, such as compilers or language servers, that need to be installed in your OS. While the system requirements of the example linked in option 1 are likely to be available on most developer machines, this might not be the case for more “exotic” extensions of Theia, such as Rust or Go support. Additionally, if you want to launch Theia on a server, you might prefer to have it encapsulated in a container.

To launch Theia using docker, you can find a list of preconfigured images here. As you can see, those preconfigured images target specific use cases, e.g. Python or Ruby development. Please note that there is a package.json for each of those images (browse into them on GitHub), which shows you the extensions that are included in the image and allow you to further customize the Theia version (we will publish a follow up article on how to customize Eclipse Theia). If you are unsure, which image to try, the most popular one at the moment is definitely the Theia IDE for web developers.

Option 3: Clone, build and run from the sources (for contributors)

This option is again very similar to option 1, but instead of getting the npm packages that Theia consists of from the package registry (npmjs.com), they will be directly built from the sources. All necessary steps to do so are described here. Please note that you still need a package.json, which defines which modules are in the launched product. There are two examples for such configurations provided within the Theia repository (see here): one for a browser application and a second one for a desktop application based on Electron. If you  have a look at Option 1, you will see that more modules are listed in this example package.json.

The required effort and complexity to launch Theia this way is very similar to option 1, as the sources and the build in Theia  are very well maintained. The benefit is that you can now modify the original sources of Theia and immediately see any changes you apply. So this option is interesting, if you want to have a deeper look at the internals of Theia and of course if you want to extend/fix and contribute something.

Option 4: Use Eclipse Che (to host runtimes and workspaces)

If you do not want to download, deploy or compile anything, but only want to try Eclipse Theia in a hosted way, you can use Eclipse Che to do so. In a nutshell, Eclipse Che provides a workspace server, meaning a server, which can host the development environment of one or several developers. If you move your development environment to the cloud, you will either need to set up those developer runtimes yourself, or use something like Eclipse Che. Please see here for more details on the relationship between Eclipse Theia and Eclipse Che.

Eclipse Theia is the default IDE (called “editor” in Che) for Che starting with version 7.

A simple way to use Theia in Che is to create an openshift.io account (see here on how to create an openshift Che test account), go to dashboard and either:

  • Select a preconfigured stack which mentions “Eclipse Theia”
  • Create any other stack, go to its configurations and select “Theia” as an editor (on the respective tab).

In case you want to try Eclipse Che and Eclipse Theia in combination running on your own premises or cloud services, please follow this guide on how to install Eclipse Che.

Conclusion and more

In this article, we have described four options on how to run Eclipse Theia, but this list is not complete. There are commercial offerings providing Theia hosting as a service. Furthermore, Eclipse Theia is used as a basis for implementing domain- and vendor-specific tools. So soon you might find a customized Theia version as a tool offering by any vendor which provides a custom tool. If you are interested in using Eclipse Theia to create your own tool or to migrate an existing tool to the cloud, have a look at our service offering for support around Eclipse Theia, web-based tools or tools in general and please get in contact with us!

Finally, if you are interested in a quick guide on how to use Eclipse Theia or how to customize and extend it, please follow us on Twitter, we will publish the next parts of this article series soon.

No Comments

Post a Comment

Comment
Name
Email
Website

By publishing a comment, you accept the Terms of Use and the Privacy Policy

This site uses Akismet to reduce spam. Learn how your comment data is processed.