I would like to use Jetty as a webserver.

I have edited the configuration file at /etc/default/jetty and set:

# change to 0 to allow Jetty start

# Listen to connections from this network host
# Use as host to accept all connections.

Now I can reach the Jetty webserver at but I would like to have Jetty listening on port 80.

I have tried this setting in the same configuration file:

# The network port used by Jetty

and then restart Jetty with sudo service jetty restart but it doesn't work.

How can I change so that the Jetty webserver is listening on port 80?

  • you can change it also from start.ini (jetty root), there you have --> jetty.port - line, uncomment and give it a value (default is 8080) – Rodislav Moldovan Dec 19 '13 at 8:21

You will need to edit the /etc/jetty/jetty.xml file. Look for a paragraph that says:

<Call name="addConnector">
          <New class="org.mortbay.jetty.nio.SelectChannelConnector">
            <Set name="host"><SystemProperty name="jetty.host" /></Set>
            <Set name="port"><SystemProperty name="jetty.port" default="8090"/></Set>
            <Set name="maxIdleTime">30000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
        <Set name="lowResourcesConnections">5000</Set>
        <Set name="lowResourcesMaxIdleTime">5000</Set>

Change the jetty.port Property to 80 as follows:

<Set name="port"><SystemProperty name="jetty.port" default="80"/></Set>

Restart jetty. That should do it.

Since the above method did not work for OP, and running as root is discouraged, there is an alternative method, as mentioned in this document.

  • This doesn't work. I also checked with sudo netstat -nlp but Jetty is not listed. – Jonas Mar 18 '11 at 13:41
  • It might be because jetty is not running as root. I am trying out a setting, and will post in a while. – theTuxRacer Mar 18 '11 at 13:55
  • I was able to get the default page by running sudo java -jar start.jar from /usr/share/jetty. I also configured the /etc/jetty/jetty-setuid.xml to start as privileged user. – theTuxRacer Mar 18 '11 at 14:05
  • Additionally take a look at: running jetty as non root user. – theTuxRacer Mar 18 '11 at 14:07
  • 1
    I run sudo /sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 and now it works fine. Thanks! – Jonas Mar 18 '11 at 14:09

Neatest way to do it is with xinetd (you may need to install it on your server first) see here: http://wiki.eclipse.org/Jetty/Howto/Port80


I am using Jetty 9. In the file start.ini you can find and modify the property jetty.port. Then you have to restart jetty.service.

  • It might be useful if you expand your answer by specifying the location of the start.ini file, the line in start.ini that has to be modified, and the modified text that has to be used. – CentaurusA Sep 10 '18 at 23:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.