Code Monkey home page Code Monkey logo

akash-minecraft-ssh's Introduction

This repository outlines how to launch your own highly optimised Minecraft server using the Akash decentralized cloud (DeCloud).

This repo will use our custom made Docker image that is a fork of the popular itzg/docker-minecraft-server but with added SSH support.

minecraft-server

Join our testing Minecraft server! It is running the recommeded deploy.yaml, come and see the performance with your own eyes.

cluster.provider-2.prod.ewr1.akash.pub:32366

Example Deploy.yaml

For our example, we have created an ultra-optimised deploy.yaml that can be modified to suit your needs. Below we will outline all the environment variables that we used to make this a performance beast.

TYPE=AIRPLANE Firstly, we start by running the server using an Airplane jar. Airplane is a very performant fork of PaperMC, you can read more about it here.

VIEW_DISTANCE=6 Reducing the servers player view distance helps to reduce the number of chunks loaded, especially with high player counts.

ENABLE_AUTOPAUSE=TRUE Adds an auto-pause feature to the server so that when there are no players on the server it enters a sleep mode to lower CPU usage. The two arguments AUTOPAUSE_TIMEOUT_EST=300 and AUTOPAUSE_TIMEOUT_INIT=300 reduce this wait time to 5 minutes. MAX_TICK_TIME=-1 is also needed for this to function correctly.

USE_AIKAR_FLAGS=TRUE Optimizes the JVM options to use the so-called Aikar Flags. These flags are an industry standard in JVM performance for Minecraft server and can significantly improve the performance of a server.

For our example deployment, using the recommended resource settings, we have found that this runs very smoothly and using Akashlytics we can see that the estimated monthly cost is ~3 AKT. At the time of writing this puts the monthly cost at just under $10.

Deploying the Server

You can deploy this script however you wish, through the CLI as shown in the Akash docs or other.

We recommend trying out Akashlytics UI as it very intuitive and very easy compared to using the CLI tool. Be warned though, Akashlytics is still in beta and may be prone to bugs, be sure to back up your wallet before using it.

Interacting with the Server

Getting Server IP

The server’s IP, along with the relevant ports can be retrieved by using following CLI command:

akash provider lease-status --node $AKASH_NODE --from $AKASH_KEY_NAME --dseq $AKASH_DSEQ --provider $AKASH_PROVIDER

It can also be found under the details section when using Akashlytics by clicking in the buttons which have the port mappings on them.

ss+(2021-09-30+at+07 01 03)

To connect to your Minecraft server, simply connect using the given provider followed by the external port.

Viewing Server Console

To view the server console using CLI please use the following command:

akash provider lease-logs --node $AKASH_NODE --from $AKASH_KEY_NAME --dseq $AKASH_DSEQ --provider $AKASH_PROVIDER

To view the console using Akashlyrics, simply view the Logs section under your deployment.

Using SSH and Accessing Admin Console

To access the console, you must connect to the server IP on the SSH port using your favourite SSH client. For windows, we recommend PuTTY.

After connecting, you will need to login using the SSH credentials you set in the environment variables. If you did not set any credentials, the default username and password will be user and pass.

You will now be in the Minecraft server directory, to access the admin console execute the following command:

rcon-cli --port 25575 --password minecraft

You can now run any Minecraft command as an admin.

If you cannot connect to SSH, ensure you set the SSH=TRUE environment variable, without this the SSH server will not run.

Accessing Files with SCP

To access the file structure of your deployment, you will need to connect using the SSH port with your favourite SCP client. For windows we recommend WinSCP. Ensure that you set the file as SCP and set the port as the external SSH port.

By default you should arrive in the Minecraft server directory, from here you can modify any file related to your deployment.

The primary use of this is to backup the world of the server to your local PC. This should be done regularly as if the container crashes, all world data will be lost.

To start the server with your own world, please see the relevant section on the Docker image repo.

Adjusting Minecraft Docker Image

Increasing Performance

If you find that your server is lagging too much or just lacking performance, try changing the resources section in the deploy.yaml.

We recommend first attempting to increase the RAM used by increasing memory: size: XGi in the resources section and the MEMORY=XGi environment variable. When increasing these, you should make the overall resource allocation a gigabyte or two more than overall resource allocation or your deployment might run out of RAM.

If you are still facing issues after attempting to increase the RAM, then increase the number of CPU units allocated to the deployment under cpu: units: X under the resources section.

Adding More Functionality

If you want to add more features to your deployment please see the respective repositories for explanations of their respective environment variables.

For SSH-related modifications please see our fork at markichu/docker-minecraft-server-ssh.

For adding mods, or anything else please see the upstream repo at itzg/docker-minecraft-server.

Useful Environment Variable Sections

Support itzg

This Akash deploy would not be possible without the work of itzg and all the other brilliant contributors that have worked on itzg/docker-minecraft-server. Itzg deserves plenty of credit for the original Docker image, consider buying them a coffee or donating to them on paypal.

akash-minecraft-ssh's People

Contributors

el-s avatar markichu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.