It can not be truly easier to build your own Java server with Tomcat and expose it to public IP address.
You will get facility to host you Java apps with zero cost for hosting plus users will able to use it at public IP. Ideal for hobby-coders.
I will use Raspberry Pi 2 Model B 1GB. Whole process will take less than 20 minutes.
Step 1 : obviously – get Raspberry 🙂
Step 2 : install its default OS Raspbian – download image at https://www.raspberrypi.org/downloads/raspbian/
Step 3 : create SD card using Win32Diskimager – get it at https://sourceforge.net/projects/win32diskimager/
Step 4 : insert SD card into Raspberry (power off)
Step 5 : connect Raspberry to power, TV (or monitor), USB mouse and LAN
Step 7 : at your PC – download putty at http://www.putty.org/
Step 11 : trigger system update :
sudo apt-get update
Step 12 : confirm java version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)
Step 13 : install Tomcat8
sudo apt-get install Tomcat8
sudo apt-get install tomcat8-admin
Step 15 : configure Tomcat – add user to access app-management
sudo service tomcat8 stop
sudo nano tomcat-users.xml
add below 2 lines after <tomcat-users>
<user username=“anyuser“ password=“anypsw“ roles=“manager-gui“/>
Step 16 : start Tomcat
sudo service tomcat8 start
Step 17 : access Tomcat´s console again at http://192.168.1.103:8080/manager/html (replace IP yours)
for login use credentials you configured in step 15 (anyuser/anypsw)
now you can see typical Tomcat´s Application console. Cool.
Step 18 : deploy your Java project compiled into war file
scroll down to „WAR file to deploy“, browse war file and press Deploy.
Step 19 : once deployed, you will see your app in list of apps with status Running, click to app name and Wualla – app is up and running at your Rapsberry. Anyway – only accessible at localhost.
Step 20 : expose your app server using public IP.
Note : if you dont have public IP already – please consult your internet provider how to get it.
Open your router console – go to Port Forwarding and add your Rapsberry´s IP and Tomcat default port 8080.
Below example is for my Netgear router