This is a simple Quarkus REST application that demonstrates how to build a lightweight Java application with Quarkus and deploy it to Clever Cloud using GraalVM native image compilation.
This application provides a simple REST endpoint:
/hello- Returns a greeting message "Hello from Quarkus REST"
- Quarkus - A Kubernetes Native Java framework tailored for GraalVM & OpenJDK HotSpot
- Java 21
- Maven
- GraalVM (for native compilation)
- JDK 21+
- Maven 3.8.1+
./mvnw compile quarkus:devThis command starts the application in development mode with live coding enabled. The application will be accessible at http://localhost:8080.
./mvnw package
java -jar target/quarkus-example-1.0.0-SNAPSHOT-runner.jarYou have two options to deploy your Quarkus application on Clever Cloud: using the Web Console or using the Clever Tools CLI.
If you don't already have an account, go to the Clever Cloud console and follow the registration instructions.
- Log in to the Clever Cloud console
- Click on "Create" and select "An application"
- Choose "Java + Maven" as the runtime environment
- Configure your application settings (name, region, etc.)
Add the following environment variables in the Clever Cloud console:
| Variable | Value | Description |
|---|---|---|
CC_JAVA_VERSION |
21 |
Specifies to use Java 21 |
CC_RUN_COMMAND |
java -jar target/quarkus-example-1.0.0-SNAPSHOT.jar |
Specifies the executable to run |
You can deploy your application using Git:
# Add Clever Cloud as a remote repository
git remote add clever git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/app_<your-app-id>.git
# Push your code to deploy
git push clever masterInstall the Clever Tools CLI following the official documentation:
# Using npm
npm install -g clever-tools
# Or using Homebrew (macOS)
brew install clever-toolsclever login# Step 1: Initialize the current directory as a Clever Cloud application
clever create --type maven <YOUR_APP_NAME>
# Step 2: Add your domain (optional but recommended)
clever domain add <YOUR_DOMAIN_NAME>
# Step 3: Set the required environment variables
clever env set CC_JAVA_VERSION 21
clever env set CC_RUN_COMMAND java -jar target/quarkus-example-1.0.0-SNAPSHOT.jarclever deployOnce deployed, you can access your application at https://<YOUR_DOMAIN_NAME>/hello.
Once deployed, you can monitor your application through:
- Web Console: The Clever Cloud console provides logs, metrics, and other tools to help you manage your application.
- CLI: Use
clever logsto view application logs andclever statusto check the status of your application.

