How to install Jetty on Ubuntu 22.04

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Hello, friends. In this post, you will learn how to install Jetty on Ubuntu 22.04

Introduction

According to the project website

Jetty provides a web server and servlet container, additionally providing support for HTTP/2, WebSocket, OSGi, JMX, JNDI, JAAS and many other integrations. These components are open source and are freely available for commercial use and distribution.

Some of Jetty’s main features are:

  • Full-featured and standards-based
  • Open source and commercially usable
  • Flexible and extensible
  • Small footprint
  • Embeddable
  • Asynchronous
  • Enterprise scalable

In addition to this, Jetty has a dual license, so you won’t have problems using it in different kinds of projects.

Let’s go for it.

Install Jetty on Ubuntu 22.04

The version included in the official repositories of Ubuntu 22.04 is an older version but is still getting good reviews for being very stable.

Before you start, update the whole system

sudo apt update
sudo apt upgrade

Then, you can install Java on Ubuntu 22.04, which is one of the fundamental requirements.

Thereafter, you can simply run

sudo apt install jetty9
Install Jetty on Ubuntu 22.04
Install Jetty on Ubuntu 22.04

This will install everything necessary for it to run.

Since Jetty is run as a service, then you have to make it start up with the system

sudo systemctl enable jetty9
sudo systemctl start jetty9

If you want to verify that everything is going well, then you should run

sudo systemctl status jetty9

Sample output

● jetty9.service - Jetty 9 Web Application Server
     Loaded: loaded (/lib/systemd/system/jetty9.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-03-25 01:19:20 UTC; 10min ago
       Docs: https://www.eclipse.org/jetty/documentation/current/
   Main PID: 2184 (java)
      Tasks: 30 (limit: 2257)
     Memory: 79.8M
        CPU: 3.844s
     CGroup: /system.slice/jetty9.service
             └─2184 /usr/bin/java -Djetty.home=/usr/share/jetty9 -Djetty.base=/usr/share/jetty9 -Djava.io.tmpdir=/tmp -jar /usr/share/>

Mar 25 01:19:21 unixcop jetty9[2184]: 2023-03-25 01:19:21.866:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:///usr/sha>
Mar 25 01:19:22 unixcop jetty9[2184]: 2023-03-25 01:19:22.162:INFO:oeja.AnnotationConfiguration:main: Scanning elapsed time=0ms
Mar 25 01:19:22 unixcop jetty9[2184]: 2023-03-25 01:19:22.257:INFO:oejshC.root:main: Warning: No org.apache.tomcat.JarScanner set in S>
Mar 25 01:19:22 unixcop jetty9[2184]: 2023-03-25 01:19:22.448:INFO:oajs.TldScanner:main: At least one JAR was scanned for TLDs yet con>
Mar 25 01:19:22 unixcop jetty9[2184]: 2023-03-25 01:19:22.564:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
Mar 25 01:19:22 unixcop jetty9[2184]: 2023-03-25 01:19:22.564:INFO:oejs.session:main: No SessionScavenger set, using defaults
Mar 25 01:19:22 unixcop jetty9[2184]: 2023-03-25 01:19:22.564:INFO:oejs.session:main: node0 Scavenging every 660000ms
Mar 25 01:19:22 unixcop jetty9[2184]: 2023-03-25 01:19:22.637:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@24269709{r>
Mar 25 01:19:22 unixcop jetty9[2184]: 2023-03-25 01:19:22.666:INFO:oejs.AbstractConnector:main: Started ServerConnector@43f82e78{HTTP/>
Mar 25 01:19:22 unixcop jetty9[2184]: 2023-03-25 01:19:22.672:INFO:oejs.Server:main: Started @2122ms

Now access the Jetty interface from a web browser at the address http://your-server:8080.

Jetty running on Ubuntu
Jetty running on Ubuntu

Now all that remains is to use it.

Conclusion

Jetty is one of the best web servers for JAVA, and with the support of Eclipse it is even more valuable. Now you know how to install it in Ubuntu 22.04, so you can try it.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Angelo
Angelo
I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook