minecraft-server-on-heroku-template
steps:
- Create a repo on github and clone it onto your computer.
- Download the .zip file and extract the contents into the local repo folder.
- Create a ngrok account on https://ngrok.com and paste the auth token in .ngrok2/ngrok.yml
- Commit and push.
- Create a heroku account on https://heroku.com and create an app. In the "Deploy" tab, connect to github and your repo.
- Go to the "Settings" tab, click on "add buildpack", and add the following: node.js, PHP, python, Java, and paste "https://github.com/jkutner/heroku-buildpack-ngrok.git" (without the quotation marks ofc) into the buildpack url.
- Go to the "Resouces" tab, and in the "add-ons" section, add Heroku Postgres.
- Head back on to the "Deploy" section, scroll down to the Manual Deploy section, and click "Deploy Branch".
- After the app deploys, head to the "Resources" tab and disable the "web python3 main.py" and enable "worker node setup.js".
- Deploy the app again. click on the "more" and then "view logs".
- Once you see "script: uploaded to db", head back to "Resources" and enable "web python3 main.py" and disable "worker node setup.js".
- Deploy again to start the server. In the logs, you will see "script: started ngrok tcp" when the server is ready. Click on "open app" and copy the first tunnel url(without the tcp://). x.ngrok.io.xxx will be the IP.
- To modify the world, you will have to manually delete the current world, launch the server locally to generate a new world, zip it, and upload to GitHub. Repeat steps 9 to 12 to set up the new world.
- To modify the server, directly change the server.properties on GitHub.
There is currently no way of accessing the server console, so you will have to execute them from the Minecraft Client.
Video instructions: https://youtu.be/EBzkSDBmaoU
If you want to use another server thats not vanilla or spigot, the process would be the same: rename the server to server.jar, run it locally to set it up, and then push and deploy.
To use jdk 11 or 15, refer to https://devcenter.heroku.com/changelog-items/1489 and https://devcenter.heroku.com/changelog-items/1887