How to Create a Minecraft Server on Paperspace in under 5 minutes


#1

With the power of Paperspace, it is now easy to spin up your own linux server in under 5 minutes without much knowledge of how to use linux operating systems. Below we’ve added some ways for you to install and run a Minecraft server for you and your friends to play on.

The Easy Way

  1. Create one of the Paperspace C-Linux machines. The more RAM the machine has, the more players you’ll be able to support. Be sure it has a Public IP Address.
  2. Log into your new Paperspace machine using the credentials sent to your email address
  3. We’ve created a script that automagically sets up your Minecraft server for you. To get it, run git clone https://github.com/ArtBears/mcsetup.git on the command line of your Paperspace virtual machine.
  4. Then change into the downloaded folder by running cd mcsetup
  5. Then run sudo ```./minecraft.sh` and put in your machine password when prompted
  6. The default arguments only take up 512M of RAM. If your virtual machine was made with more RAM, add the -max [size] and -min [size] flags to your command
    i. -max is the largest amount of RAM your server should use
    ii. -min is the starting amount of RAM your server will use
  7. For example, if your machine has 4GB of ram, you can set the limit at 4G or less like so:
    i. sudo ./minecraft.sh -max 4G -min 512M
  8. If you want to change the port that your server listens on, use the -p option like so:
    i. sudo ./minecraft.sh -p 25566 -max 4G -min 512M
  9. That’s it! Your Minecraft server should be running at the public IP address that was assigned to your machine.

The Hard but Flexible Way

  1. Create one of the Paperspace C-Linux machines. The more RAM the machines has, the more players you’ll be able to support. Make sure it has a Public IP Address
  2. Log into your new Paperspace machine using the credentials sent to your email address
  3. Download Minecraft Server Jar [ https://minecraft.net/en-us/download/server | minecraft server]
  4. Run the file with the command:
    java -Xmx1024M -Xms1024M -jar minecraft_server.1.12.2.jar nogui~
  5. This should fail but it should create a couple of files in the directory
    i. server.properties: This is where all of your server settings are. Edit this file as you please. Descriptions and values for each setting can be found here https://minecraft.gamepedia.com/Server.properties
    ii. whitelist.json: This file is useful if you are going to run a whitelist only server. You can declare the users that you want to allow on the server
    iii. ops.json: A json file where you can put the usernames of people that you want to be admins on your server. Be careful who you put on this list. With great power comes great responsibility
    iv. banned-players.json: Here is where you can put the usernames of players that you want to ban from the server.
    v. banned-ips.json: You can ban people’s IP address in case they have multiple accounts
    vi. eula.txt: This is the EULA agreement, we’ll need to edit this in order to start your server
  6. Change the last line of the eula.txt file to say “eula=true”
  7. Next we need to open up the port that people will connect to your server through. The default is 25565
    sudo iptables -A INPUT -p tcp --dport 25565 -m state --state NEW -j ACCEPT
  8. Now we’re ready to run your server. Run the command from step 4 again but modify it if you want to support more users.
    java -Xmx1024M -Xms1024M -jar minecraft_server.1.12.2.jar nogui
  • -Xmx[size] : This is the max amount of RAM your server can use (the larger, the more players you can support ). Make sure that your machine can support your max. I recommend 1 Gig less than your max ram or 740M if you have a 1G RAM instance.
  • -Xms[size] is the starting amount of RAM on your machine (This should be smaller or equal to your Xmx[size])
  • Make sure you include “nogui” in your command.
  1. Your server should now be up and running. You and your friends should be able to connect to it using your Public IP Address on your listed on your Paperspace Machine’s Settings Page