deploy spring boot jar fie

March 10, 2017 4.1k views
Applications

Greetings.

I am considering opting $5 plan with digitalOcean.

I would like to know the following.

  • I have a spring boot generated jar file (jdk 1.7). How easy is it to deploy this jar in the host space?
  • my app uses mysql. How can I create a mysql db in digitalOcean and set my app to connect to this db?

thanks
Balaji

1 comment
  • DigitalOcean offer a VPS, so it's essentially like your own server, where you can install one of the allowed operating systems (CentOS, Ubuntu, FreeBSD, among other).
    You have to setup everything yourself, that being Java runtime, MySQL server and whatever else you wish to use.
    And you have to maintain and update everything.

1 Answer

You can definitely host a Java app on a DigitalOcean. Make sure you follow the initial server setup tutorial after creating your Droplet.

See this tutorial on how to install MySQL. Once you've done that, you will want to create a MySQL user for your app. The hostname for the MySQL server will be localhost as it is running on the same server.

To run your app, install Java. You can transfer your .jar file using FileZilla or any other SFTP client. The login details will be the ones you created in the initial server setup tutorial. Run the jar using this command: java -jar file_name.jar.

To keep your app running after closing the SSH session, one option would be using the program screen.

MySQL is a powerful database management system used for organizing and retrieving data. This tutorial explains how to to create new MySQL users and how to grant them the appropriate permissions.
Have another answer? Share your knowledge.