How I run a free Minecraft server on DeepNote

DeepNote is a new data science notebook platform that is still in beta. Its unique feature that improves collaboration shows great potential. To try out the platform, I decided to run a Minecraft server on it for fun.

For the code, I used MineColab, which does the same thing on Google Colaboratory. The code is modified so it fits the DeepNote environment.

This story will show you around DeepNote and get you started with the platform.

Before we start, please note that:

Notebooks are not designed to running servers like this. More importantly, it is not a good idea to exploit the free resource continuously. If you are serious about running a Minecraft server 24/7, please consider other alternatives.

What makes it work?

DeepNote pricing table
DeepNote pricing table (Feb 2021) from https://deepnote.com/#pricing

DeepNote provides a free standard machine that runs 750 hours per month. The free machines are de-scheduled every 24 hours but except for the time limit, the documentation states that machines are terminated only when all of the following conditions are met:

It has no user sessions — this means that you do not have Deepnote open and focused in your web-browser.

It has no running running computation — this means that there is no notebook currently executing code

There were no changes to the code for at least 15 minutes.

This is useful for long-running jobs, which happens a lot when processing large amount of data / training deep neural networks.

For our Minecraft server, this allows one to run a free Minecraft server for 24 hours. (Again, please think twice before using free resources this way.)

We need a dedicated software for running a Minecraft server. Since I haven’t played Minecraft for a long time, I just followed the author of MineColab to use PaperMC with OpenJDK 15.

ngrok is a service that helps to relay traffic securely from a public URL to the localhost. It is commonly used to create HTTPS endpoints easily for backend development.

Since there is no way to control the network configuration of the DeepNote machine instance, ngrok is needed for exposing the Minecraft server so it can receive traffic from the internet.

Running the notebook

Here is the notebook for you to duplicate and play along:

Launch in DeepNote
Press to launch the notebook on DeepNote

Press the Environment tab on the left menu to show this panel. The startup script init.ipynb is executed every time DeepNote spins up a machine.

Screenshot of the head of init.ipynb
Screenshot of the head of init.ipynb

This installs all dependencies required for the project. In our case, OpenJDK and ngrok. Just like other notebook platforms, IPython magics are also available in DeepNote.

You can also use other environments such as other Python versions and even build your own environment with a Dockerfile. For relatively stable dependencies, building a custom environment should save the startup time.

With an isolated environment for each project, we can install packages without having to worry about breaking the dependencies of other projects. Also, collaborators under the same project can share the environment and work smoothly together.

Navigating through files from the Notebook & Files menu
Navigating through files from the Notebook & Files menu
Opening notebooks the normal way

To navigate and open our main notebook the normal way, we can press Notebook & Files from the left menu.

The Command Palette
The Command Palette
Opening notebook the cool way with Command Palette

On the other hand, you can do it the cool way by making use of the Command Palette by pressing Ctrl + P on Windows or Cmd + P on Mac. Press Space and type the file to search for it.

Running the cells

After running the first cell, you can see that DeepNote shows all global variables on the bottom left corner, which is useful for debugging.

Screenshot of the global variables panel
Screenshot of the global variables panel

Continue with the setup cell and finally, we are about the run the server.

Just run the final cell with your ngrok authentication token (which can be found here), you will get a public ngrok URL. Just connect to the server with the provided address and this is how you create a free Minecraft server on DeepNote!

What made DeepNote unique is the collaboration features, enhanced data visualization, and other features useful for teams working in data projects. Unfortunately, these features can’t be demonstrated with my chosen topic.

Thank you for reading. Hope you had fun reading this story and try playing with DeepNote yourself!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store