Java Applications
Containerized Java applications can be created and managed in OpenPanel Enterprise Edition.
Create an Applicationβ
To create a new Java application, navigate to OpenPanel > AutoInstaller and click Setup Java Application.
On the next page, you can configure the following settings:
- Name β The name of the application and container as displayed in OpenPanel.
- Port β Set a custom port if your app uses one. Otherwise, port 80 is used by default.
- Domain Name / Subfolder β The domain (and optional subfolder) where the application will be publicly accessible.
- Startup File β The file executed at startup with the
javacommand. Defaults toMain.java. - Custom Startup Command β Use a custom startup command instead of the default
java(for examplejava -jar target/app.jarfor a Maven build). - Type β Fixed to Java.
- Version β Select a JDK version from Docker Hub's official
eclipse-temurinLTS tags. - Run Install β Run
mvn installusing the project'spom.xmlbefore starting the application. Skip this for a single-file app or one that's already built. - CPU Cores β Number of CPU cores allocated to the application.
- Memory β Amount of memory (in GB) allocated to the application.
After completing the form, click Start Installation. The installation process will be displayed below the form. Once complete, youβll be redirected to the management page where you can view all your applications.
Since Java 11 (JEP 330), java SomeFile.java runs a single source file directly β it's compiled in memory with no separate javac step and no build tool required. That's the default here, matching the "just run one file" model of the Node.js, Python, and Ruby application types for a quick app. Projects that do have a pom.xml can enable Run Install to run mvn install first, then use a custom startup command to run the resulting build.
Example Appβ
A minimal HTTP server using only the JDK standard library β no build step or dependencies required.
Example Main.java file:
import com.sun.net.httpserver.HttpServer;
import java.net.InetSocketAddress;
public class Main {
public static void main(String[] args) throws Exception {
HttpServer server = HttpServer.create(new InetSocketAddress(3000), 0);
server.createContext("/", exchange -> {
byte[] response = "Hello World from Java on port 3000!".getBytes();
exchange.sendResponseHeaders(200, response.length);
exchange.getResponseBody().write(response);
exchange.getResponseBody().close();
});
server.start();
}
}
No Run Install step is needed for this example β leave it disabled and set the startup file to Main.java.
Manage Applicationsβ
Once your application is created, you can manage it from OpenPanel > Site Manager.
Click Manage next to the application name to open its management page.
On this page, you can view important details such as:
- Screenshot β Preview of the applicationβs domain.
- Status β Current container status.
- Version β JDK version in use.
- CPU Limit β Configured CPU allocation.
- Memory Limit β Configured memory allocation.
- Speed β Google PageSpeed Insights data for the website.
- Files β Current folder path and size.
- Firewall β WAF (Web Application Firewall) status for the domain (if enabled).
You also have several management options:
- Actions β Start, stop, or restart the container.
- Overview β Modify startup file or command, working directory, package installation settings (Maven), version, and resource limits (CPU, Memory, PIDs).
- Install Packages β View and manage the
pom.xml, and runmvn install. - Logs β View container logs for troubleshooting.
- Remove β Delete the application.