Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.
SOLVED

Curl command to upload .jar from local to /system/console/bundle

Avatar

Level 1

Hi Everyone,
Using curl command to upload .jar to http://localhost:4502/system/console/bundles.  Tried multiple commands none of them worked for me. I don't see any command on adobe official documentation also for the same. Is even possible or I need to try any other way. Please provide if there is any other command.
curl -u admin:admin -F "bundleFile=@/path/to/your/my-bundle.jar" http://<AEM_HOST>:<PORT>/system/console/bundles/.json


Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @tejaswini_c ,

 

I checked UI of system console and found that UI uploads bundle via form. You can send the following request to upload your .jar file (bundle).

 

HTTP method: POST

HTTP url: /system/console/bundles

HTTP header: Content-type: multipart/form-data

Body (form data):

  • action=install
  • refreshPackages=true
  • bundlestartlevel=20
  • file=<your jar file>

cURL command:

curl -X POST "http://localhost:4502/system/console/bundles" \
     -u admin:admin \
     -H "Content-Type: multipart/form-data" \
     -F "action=install" \
     -F "refreshPackages=true" \
     -F "bundlestartlevel=20" \
     -F "file=@/path/to/your-bundle.jar"

 

Best regards,

Kostiantyn Diachenko.

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi @tejaswini_c ,

 

I checked UI of system console and found that UI uploads bundle via form. You can send the following request to upload your .jar file (bundle).

 

HTTP method: POST

HTTP url: /system/console/bundles

HTTP header: Content-type: multipart/form-data

Body (form data):

  • action=install
  • refreshPackages=true
  • bundlestartlevel=20
  • file=<your jar file>

cURL command:

curl -X POST "http://localhost:4502/system/console/bundles" \
     -u admin:admin \
     -H "Content-Type: multipart/form-data" \
     -F "action=install" \
     -F "refreshPackages=true" \
     -F "bundlestartlevel=20" \
     -F "file=@/path/to/your-bundle.jar"

 

Best regards,

Kostiantyn Diachenko.

Avatar

Community Advisor

Hi @tejaswini_c ,

To upload a .jar file (OSGi bundle) to the AEM console, you need to send a POST request with the correct form data. The following curl command will allow you to upload and install your bundle:

Correct curl Command:

curl -X POST "http://localhost:4502/system/console/bundles" \
     -u admin:admin \
     -H "Content-Type: multipart/form-data" \
     -F "action=install" \
     -F "refreshPackages=true" \
     -F "bundlestartlevel=20" \
     -F "file=@/path/to/your/my-bundle.jar"

Explanation of the Command:

1. URL: http://localhost:4502/system/console/bundles

Replace localhost:4502 with the appropriate host and port if your AEM instance is running on a different configuration.

2. Authentication:

-u admin:admin is for basic authentication. Make sure to replace admin:admin with your actual AEM username and password.


3. Form Data:

action=install: This tells AEM to install the bundle.
refreshPackages=true: This ensures AEM refreshes the packages after installation.
bundlestartlevel=20: Adjust the start level of the bundle according to your needs.
file=@/path/to/your/my-bundle.jar: Replace /path/to/your/my-bundle.jar with the full path to your .jar file.

Steps to Follow:

1. Replace the file path: Ensure that the path to your .jar file is correct. Example: -F "file=@/Users/yourname/Downloads/my-bundle.jar"

2. Run the Command: After running the curl command, AEM will accept the bundle and install it automatically.

3. Confirm the Installation: Check the AEM console for any installation messages or errors. If successful, your bundle will be listed under the /system/console/bundles page.

Important Notes:

Ensure that the AEM instance is up and running.
Verify that the user you're authenticating with has the necessary permissions to upload bundles.
If your AEM instance is behind a proxy or firewall, make sure the required ports are open.

Best Regards,

Amit Vishwakarma

Avatar

Administrator

@tejaswini_c Did you find the suggestions helpful? Please let us know if you need more information. If a response worked, kindly mark it as correct for posterity; alternatively, if you found a solution yourself, we’d appreciate it if you could share it with the community. Thank you!



Kautuk Sahni