Install Jetty 9 on Ubuntu Server 18.04 LTS

Jetty 9 is a HTTP server just like Apache 2 or Nginx, and a Java servlet engine just like Apache Tomcat.

Jetty 9 has help for HTTP/2, WebSocket, OSGi, JMX, JNDI, JAAS and quite a few extra out of the box.

Jetty is open supply, versatile and extensible. Jetty performs asynchronously and due to its smaller sized footprint, it can be utilised in embedded devices as properly.

It is one particular of the finest enterprise grade net server for Java primarily based technologies.

In this short article, I am going to show you how to set up Jetty 9 on Ubuntu Server 18.04 LTS. Let’s get began.

Upgrading Packages:

It’s finest to upgrade all the packages of your Ubuntu Server 18.04 LTS ahead of installing new application packages. That way you can get all the bug fixes and safety updates.

Initially update the APT package repository cache with the following command:

$ sudo apt update

The APT package repository cache should really be updated. It says All the packages are up to date. If you have new package updates, you should really see it right here.

If you do have new package updates, then run the following command to update them:

$ sudo apt upgrade

As I do not have new package updates, none is upgraded.

Installing OpenJDK:

Jetty 9 depends on Java Improvement Kit (JDK). You can set up Oracle JDK or OpenJDK based on your decision.

As OpenJDK is accessible in the official package repository of Ubuntu Server 18.04 LTS, this is what I choose unless you have particular explanation to use Oracle JDK.

Run the following command to set up OpenJDK:

$ sudo apt set up openjdk-8-jdk

Now press y and then press to continue. OpenJDK should really be installed.

You can verify regardless of whether OpenJDK performs with the following command:

$ javac -version

It performs!

Installing Jetty 9:

Jetty 9 is accessible in the official package repository of Ubuntu Server 18.04 LTS.

To set up Jetty 9, run the following command:

$ sudo apt set up jetty9

Now press y and then press to continue. Jetty 9 should really be installed.

Beginning Jetty 9 and Adding Jetty 9 to the Program Startup:

Now you can verify regardless of whether jetty9 service is operating with the following command:

$ sudo systemctl status jetty9

As you can see, jetty9 service is operating.

If jetty9 service is not operating, run the following command to get started it:

$ sudo systemctl get started jetty9

If you want jetty9 service to get started when your pc boots, run the following command to add it to the method startup:

$ sudo systemctl allow jetty9

Testing Jetty 9:

Jetty 9 runs on port 8080 by default. You can take a look at http://localhost:8080 from your Ubuntu Server 18.04 LTS exactly where you installed Jetty 9 to see regardless of whether it performs.

I utilised CURL to request http://localhost:8080 from the command line.

$ curl http://localhost:8080

As you can see, it performs.

Install Jetty on Ubuntu

If you want to connect to your Jetty 9 server from yet another pc on the network, initially you have to come across out the IP address of your Ubuntu Server 18.04 LTS exactly where you installed Jetty 9 with the following command:

$ ip a

As you can see, the IP address is 192.168.199.129 in my case.

Now take a look at http://192.168.199.129:8080 from any net browser on the network and it should really operate.

Install Jetty 9 on Ubuntu 18

That’s how you can set up Jetty on your Ubuntu Server inside couple of minutes. I hope you like this tutorial, please share this short article with your colleagues.

If you want how to short article like this, please leave comment with the subject you want me to create.

Install Jetty 9 on Ubuntu Server 18.04 LTS

Jetty 9 is a HTTP server just like Apache 2 or Nginx, and a Java servlet engine just like Apache Tomcat.

Jetty 9 has support for HTTP/2, WebSocket, OSGi, JMX, JNDI, JAAS and many more out of the box.

Jetty is open source, flexible and extensible. Jetty works asynchronously and due to its smaller footprint, it can be used in embedded devices as well.

It is one of the best enterprise grade web server for Java based technologies.

In this article, I am going to show you how to install Jetty 9 on Ubuntu Server 18.04 LTS. Let’;s get started.

Upgrading Packages:

It’;s best to upgrade all the packages of your Ubuntu Server 18.04 LTS before installing new software packages. That way you can get all the bug fixes and security updates.

First update the APT package repository cache with the following command:

$ sudo apt update

The APT package repository cache should be updated. It says All the packages are up to date. If you have new package updates, you should see it here.

If you do have new package updates, then run the following command to update them:

$ sudo apt upgrade

As I don’t have new package updates, none is upgraded.

Installing OpenJDK:

Jetty 9 depends on Java Development Kit (JDK). You can install Oracle JDK or OpenJDK depending on your choice.

As OpenJDK is available in the official package repository of Ubuntu Server 18.04 LTS, this is what I prefer unless you have specific reason to use Oracle JDK.

Run the following command to install OpenJDK:

$ sudo apt install openjdk-8-jdk

Now press y and then press to continue. OpenJDK should be installed.

You can check whether OpenJDK works with the following command:

$ javac -version

It works!

Installing Jetty 9:

Jetty 9 is available in the official package repository of Ubuntu Server 18.04 LTS.

To install Jetty 9, run the following command:

$ sudo apt install jetty9

Now press y and then press to continue. Jetty 9 should be installed.

Starting Jetty 9 and Adding Jetty 9 to the System Startup:

Now you can check whether jetty9 service is running with the following command:

$ sudo systemctl status jetty9

As you can see, jetty9 service is running.

If jetty9 service is not running, run the following command to start it:

$ sudo systemctl start jetty9

If you want jetty9 service to start when your computer boots, run the following command to add it to the system startup:

$ sudo systemctl enable jetty9

Testing Jetty 9:

Jetty 9 runs on port 8080 by default. You can visit http://localhost:8080 from your Ubuntu Server 18.04 LTS where you installed Jetty 9 to see whether it works.

I used CURL to request http://localhost:8080 from the command line.

$ curl http://localhost:8080

As you can see, it works.

Install Jetty on Ubuntu

If you want to connect to your Jetty 9 server from another computer on the network, first you have to find out the IP address of your Ubuntu Server 18.04 LTS where you installed Jetty 9 with the following command:

$ ip a

As you can see, the IP address is 192.168.199.129 in my case.

Now visit http://192.168.199.129:8080 from any web browser on the network and it should work.

Install Jetty 9 on Ubuntu 18

That’;s how you can install Jetty on your Ubuntu Server within few minutes. I hope you like this tutorial, please share this article with your colleagues.

If you want how to article like this, please leave comment with the topic you want me to write.

Posted in: Uncategorized