Enterprise Java

Make running your Spring Boot application in the cloud super easy with Boxfuse

A few days ago I started building an iOS app that would be using a REST API to retrieve and store data. This REST API would be a server application that I also have to build. Since I am familiair with Java and Spring I decided to use Spring Boot as framework. To be able to use it with my iPhone it would be nice if I could run it on a server instead of my own development PC, so for this I choose AWS since I know how to use that. The only thing I hadn’t figured out yet was what would be the easiest way to get my Spring Boot application running on an AWS EC2 instance…

Well, that appeared to be Boxfuse! I never heard of this platform before but it turned out to be so easy to use that I cannot imagine there could be an easier way to get your (SpringBoot) application running in the cloud on AWS. You can choose to download the client and configure it or use the Maven plugin. Either way it just takes a simple command to get your application running on AWS (or a local VirtualBox). I haven’t looked into the more advanced options like database access and load balancing but as stated in their blog this should all be possible and just as easy to set up. I will definitely dig further into this and let you know my findings.

If you want to check this out it is as easy as the following steps:

  • Create your Spring Boot REST application
  • Set up your AWS account
  • Set up your Boxfuse account
  • Modify the pom.xml and get it running

Create your Spring Boot REST application
Just follow the steps as described here. I chose the Maven option since I know that best. After following these steps you should have a REST API running on your localhost.

Set up your AWS account
If you don’t have an account yet get one. It will be free for the first year if your consumption stays within certain boundaries, read more about it here. After setting this up you should be able to see the AWS Management Console.

Set up your Boxfuse account
When signing up for Boxfuse you will need a GitHub account. If you are one of the few developers that doesn’t have such account yet you can sign up here (also free). Now you are able to get a Boxfuse account and set it up. When that is done you are ready for the last step.

Modify the pom.xml and get it running
Go back to your Spring Boot application and open the pom file. Add the following to it:

<pluginRepository>
    <id>boxfuse-repo</id>
    <url>https://files.boxfuse.com</url>
</pluginRepository>

<plugin>
    <groupId>com.boxfuse.client</groupId>
    <artifactId>boxfuse-maven-plugin</artifactId>
    <version>1.18.7.938</version>
    <configuration>
        <user>your-boxfuse-client-user</user>
        <secret>your-boxfuse-client-secret</secret>
    </configuration>
</plugin>

Now in your Terminal simply run the Maven command: mvn boxfuse:run -Dboxfuse.env=test

Within a minute you will see that there is an EC2 instance added to your AWS Console and you can access the API in your browser:screenshot-at-apr-24-14-35-25 So with having this process as easy as this you can completely focus yourself on developing functionality instead of investigating how to get thing deployed and running!

Pascal Alma

Pascal is a senior JEE Developer and Architect at 4Synergy in The Netherlands. Pascal has been designing and building J2EE applications since 2001. He is particularly interested in Open Source toolstack (Mule, Spring Framework, JBoss) and technologies like Web Services, SOA and Cloud technologies. Specialties: JEE, SOA, Mule ESB, Maven, Cloud Technology, Amazon AWS.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Anirudh Mathad
Anirudh Mathad
7 years ago

Do you how to get number of visitors statistics on a site deployed from boxfuse ?

Back to top button