Kryonet hosting? Where and how?

It’s kinda embarrassing how I’m littering this forum but ah well, it’s not like I wasn’t trying this on my own since this morning.

I have a game that consists of a java “Server” using kryonet. With the server on my laptop and router forwarding, everything works fine (client is an android phone, communicates with the server via mobile internet, not wlan/lan).

How do I get this thing online? I’ve looked at and tried a whole bunch of approaches, the closest I came was on heroku but there I’m seemingly unable to make up the correct Procfile (I got as far as deploying my application on there, but without the correct Procfile command it won’t even try to start).

I feel I’m conceptually missing something, obviously I’m not the brightest guy around but if it’s so easy to run locally, can it really be this hard to just upload my project as is (git is fine) and then it’ll simply run as if the host were my laptop? I basically only need a computer that has java installed, right?

Hosting doesn’t have to be free but I definitely only need whatever the lowest tier is anywhere as I’m only testing stuff.

AWS EC2 has a free tier: 750 CPU hours / month for the first year (months with 31 days have 744 hours).

Digital Ocean is nice for cheap but sturdy VPSes.

Linode is slightly higher end, has lots of scripts for you to configure your server with a few clicks.

Those are bare bones Linux boxes though. You’d have to do some sys-admin to get everything to work nicely.
I have no experiences with ‘push to deploy’ hosters especially for anything else than services running on web-containers (tomcat, jboss, etc) - that may be tricky.

EC2: Holy crap a free Tier. I missed that.

Linode: slightly higher end? lol first time i ever heard that. I have used them ages ago. I had problems, the upshot was that i got refunded all my money about 3 months later.

What ever hosting you find. You will need to do a bit of configuration. However it is not that hard.

So on a clean linux (a virtual thing, looks like you own computer but with really low ram and and HDD), all you need is java as you say, just install the JRE. I install my own JRE even if they provide one. Master of my own demise and all that. Typically you want to have an account that is very locked down that you server will run as. Then just run the server from that account. Put it in the background or use something like screen if you want to logging without proper login :D.

That suffices to get you off the ground. But for production with uptime requirements you will need to muck in and get dirty with many more details and how things fall over etc. But at this point just logging back on and checking the logs works fine.

Just be aware that you can burn through your bandwidth and cpu allocations much faster than you think.

I use Digital Ocean, you pay per hour + an hour rate for setup.
This is very useful for testing, since you don’t have to pay the 5/10/20€ up front if you just want to run some testing;
Instead you can do it for as low as a couple cents if you only need the server for a few hours.

You have to submit one 5€ payment tho before you can begin if i remember right.

There are also coupons online that give you ~10€ credit for free, this basically means ~3 months linux server for just 5€.

A one core solution for 5€/Month has roughly the single thread performance of my q9650. They do not like/allow maxing out the CPU all day tho.
Tested it with KryoNet, no problem at all! You need to manually install java 8 tho, it’s not in their package index last time i checked.
(They have OpenJDK 7 ready to use)

Running your server is as simple as uploading it via sftp and running it from command line like you do on linux.

Can recommend!

Wow this Forum is great! I’ll check out DO, paid them their $5 fee already, but couldn’t SSH in because the droplet wasn’t responding? Too tired to do more today, but am hopeful it will work tomorrow.

Compared to Digital Ocean :point:

It seems they all do hourly billing now. Interesting. Not that i would bother with that. The main reason i use these services is to have a 24/7 server somewhere else. Like run my company website from there and that sort of thing.

Got it working on digitalocean, couldn’t sleep and had to try it. Was way easier than the supposedly easier sites like heroku for sure.
Thanks and good night everyone, I have a feeling it won’t be long ;D

Got it working on digitalocean

Excellent… If / when you move toward production you might want to consider the container direction. Docker being the current solution folks are talking a lot about.

I’m looking at putting together a combination of Rkt (https://coreos.com/rkt/), Kubernetes (http://kubernetes.io/), and Rancher (http://rancher.com/) for server deployment for web and mobile apps primarily, but of course it’d be fine for desktop apps too. I’ll definitely make a post on JGO if I get all the tooling working well.

I use ramnode and have been impressed with how cheap it is at $5 per month with 2 cores.


Also, in the last few years I’ve never had to restart the server. I guess that’s Linux and Java stability.

Sounds like you’re using libgdx, but if you end up running tomcat for a website, Java melody is very handy
http://javamelody.googlecode.com/

Thanks again everyone for all the suggestions.

Catharsis,

Yes I will definitely look into it again at some point in the future, looking forward to your post.
For now I’m happy as everything is working, I’m confident future me will be better equipped to deal with this headache, somehow he always is.