Curl command to upload .jar from local to /system/console/bundle | Community
Skip to main content
March 13, 2025
Solved

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

  • March 13, 2025
  • 3 replies
  • 658 views

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


This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by konstantyn_diachenko

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.

3 replies

konstantyn_diachenko
Community Advisor
konstantyn_diachenkoCommunity AdvisorAccepted solution
Community Advisor
March 14, 2025

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.

Kostiantyn Diachenko, Community Advisor, Certified Senior AEM Developer, creator of free AEM VLT Tool, maintainer of AEM Tools plugin.
AmitVishwakarma
Community Advisor
Community Advisor
March 14, 2025

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

kautuk_sahni
Community Manager
Community Manager
April 11, 2025

@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