WebSphere Tutorial · WebSphere Basics · Lesson 3 of 23

Your First Liberty Server

Creating, starting and stopping a Liberty server, its directory layout, and Liberty's development mode.

Members can save this page, take notes and track progress. See membership · Sign in

Create and run a server

# unzip an Open Liberty download, then:
bin/server create orders          # creates usr/servers/orders/server.xml
bin/server start orders           # background; 'server run' keeps it in the foreground
tail -f usr/servers/orders/logs/messages.log
bin/server stop orders

The log shows messages with IDs such as CWWKF0011I: The orders server is ready to run a smarter planet. and CWWKZ0001I: Application orders started. Default ports are 9080 (HTTP) and 9443 (HTTPS).

Directory layout

usr/servers/orders/
├── server.xml          # features and configuration
├── server.env          # environment variables for the server
├── jvm.options         # JVM arguments (heap size, GC)
├── bootstrap.properties
├── apps/               # applications referenced from server.xml
├── dropins/            # applications deployed just by copying them here
├── configDropins/      # extra config files (defaults/ and overrides/)
└── logs/               # messages.log, trace.log, ffdc/

Development mode

With the Liberty Maven or Gradle plug-in, mvn liberty:dev starts the server, redeploys on every code change and runs tests on demand: the fastest inner loop for Liberty development.

Reading Liberty message IDs (the last letter is the severity)Try it yourself
log = """\
[11/23/26 10:00:01:120 UTC] 00000001 FrameworkMa A CWWKE0001I: The server orders has been launched.
[11/23/26 10:00:03:880 UTC] 0000002a AppMessageHe A CWWKZ0001I: Application orders started in 1.214 seconds.
[11/23/26 10:00:03:902 UTC] 0000002a TCPPort      I CWWKO0219I: TCP Channel defaultHttpEndpoint has been started and is now listening for requests on host *  (IPv6) port 9080.
[11/23/26 10:00:03:910 UTC] 0000002a FeatureManag A CWWKF0011I: The orders server is ready to run a smarter planet."""

import re
for line in log.splitlines():
    code = re.search(r"\b(CWW[A-Z]{2}\d{4}[IWE])\b", line)
    if code:
        level = {"I": "info", "W": "warning", "E": "error"}[code.group(1)[-1]]
        print(f"{code.group(1)} ({level}): {line.split(code.group(1) + ': ')[1][:60]}")

Output

CWWKE0001I (info): The server orders has been launched.
CWWKZ0001I (info): Application orders started in 1.214 seconds.
CWWKO0219I (info): TCP Channel defaultHttpEndpoint has been started and is now 
CWWKF0011I (info): The orders server is ready to run a smarter planet.

Test yourself

Which Liberty file lists the features a server enables?

  1. jvm.options
  2. server.xml
  3. bootstrap.properties
  4. messages.log
Show answer

Answer: server.xml

server.xml holds the featureManager and the configuration.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake