Can i deploy my Java Spring-Boot Application in my Synology NAS?

Viewed 6587

I have a Spring-Boot Application with REST API (Maven build and MongoDB Database). I will also make a UI with Angular 2 on top of that (npm build).

What i would like to do is, to host this site, with its backend & database on a server. Can i do that on my Synology NAS (DS216j)? Or should i better buy a small computer like Raspberry Pi 3?

I have heard somewhere that we can deploy our apps in Docker, and Synology has a docker app or sth? Will this help me reaching my goal? I would like to have a step by step guide from your similar setups.

1 Answers

As far as I understand, you only want to get your app running on your NAS, so using Docker would be an option, but no requirement.

According to the model-specific download page, your DS216j supports Java8. So what you have to do:

  1. Install Java on your NAS
  2. Package your application as standalone jar-file: If not yet done, you can do that in your pom.xml (see Spring Boot documentation for details; btw, this standalone mode is one of the best features of Spring Boot)
  3. Now you can upload the jar-file
  4. Run it via the command line with java -jar <jar-file-name>.jar

Just make sure that the port of your app does not conflict with the ports used by your NAS.

You could also create a Docker image from your app and run it on your NAS, it seems like your model supports Docker: https://www.synology.com/en-us/dsm/packages/Docker. But that would create some extra effort, but no added value, from my point of view.

Related