Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.3k views
in Technique[技术] by (71.8m points)

java - How can I properly self-host my Spring Boot app on my computer?

I can't connect remotely to my SB app that I want to self-host

Introduction

I made a Spring Boot app with a 'my-sql' container that I want to share outside my home network to test it with some friends. The app works locally but I want to use it outside my network.

I have never, ever, deployed an app and I have little knowledge on this matter and I want to do it properly to avoid problems that I won't be able to handle myself.

What have I done so far

  • I tried opening the 8080 port on the firewall for any connection
  • I added my public ip in the application.properties with port 8080
  • Used 0.0.0.0 to listen to any connection to 8080 as in this solution
  • Load the app to Heroku (success) and self-host the 'my-sql' (that one is another question)

Problem

None of these solutions above worked for me


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is a network-related question. However, you need to have a static IP provided by your ISP first. Then you need to configure your network gateway to forward requests to your application.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...