Skip to content

Instantly share code, notes, and snippets.

@misaalanshori
Created February 22, 2023 14:22
Show Gist options
  • Save misaalanshori/fd59d0492bcc1f868e09a2de442993de to your computer and use it in GitHub Desktop.
Save misaalanshori/fd59d0492bcc1f868e09a2de442993de to your computer and use it in GitHub Desktop.
Minecraft server stuff

Make a quick Minecraft Paper Server

Notes for me to make a very quick Minecraft server on a VPS

Steps

1. Install Java

Install Java JRE (for example, for jre 17): sudo apt install openjdk-17-jre

2. Download Paper MC jar

Get the PaperMC jar from https://papermc.io/downloads, and rename it to just paper.jar

wget https://api.papermc.io/v2/projects/paper/versions/1.19.3/builds/413/downloads/paper-1.19.3-413.jar # GET THE LATEST FROM PAPERMC!
mv paper-1.19.3-413.jar paper.jar

3. Make the start up script

Make a new folder in the home directory and create a start.sh file, make sure its executable (chmod +x start.sh)

#/bin/bash
java -Xmx2048M -Xms1024M -jar paper.mc

4. Accept the EULA

Run the start.sh script, edit the eula.txt to accept it.

5. Configure the server.properties

Edit the server properties and change stuff like world seed, difficulty, motd, offline mode, port etc.

6. Download plugins

Plugin sites sometimes doesn't give direct file download to wget. So we need to use sftp. Download all the files and use sftp user@host to connect to the server and cd to move to the server plugins directory and put to upload the jar files. More info about plugins later

7. First run

Run ./start.sh to start the server. It will generate the world first.

8. Configure the plugins

To configure the plugins (and also for the next steps) stop the server first. Then configure the plugins. More on the plugin configuration later.

9. Install datapacks

To use datapacks, put the datapacks file in the datapacks folder in the world folder.

10. Setup a startup script

Now here is where the janky part comes. We're gonna use tmux (sudo apt install tmux) to keep the server running at all times. First create a startup.sh in the home directory and make sure its executable:

#/bin/bash
tmux new -d -s ServerTitle "cd /home/ubuntu/mcserver; /home/ubuntu/mcserver/start.sh"

then create a cronjob to run to run it at all times, run cronjob -e and add:

@reboot /home/ubuntu/startup.sh

11. Start and open the server console

Run the startup.sh script and attach the tmux terminal using tmux a. If there are other tmux windows open use ctrl+b w to list all windows and select the window with the ServerTitle.

12. Connecting

This one is easy, just get the server ip (try curl icanhazip.com -4) and put it into Minecraft (include the port if its not the default which is 25565).

Plugins & Datapacks

Some notes on what plugins to use

PL-Plugin DP-Datapack MOD-Changes the gameplay

Vanilla

  • Coreprotect (PL)
  • Dynmap (PL)
  • SpigotPing (PL)
  • VanillaTweaks (DP):
    • Track Raw Statistics
    • Track Statistics
    • Count Mob Deaths

Basic

  • VanillaTweaks (DP):
    • Coordinates HUD
    • Name Colors
    • Silence Mobs
    • Villager Death Messages

Advanced

  • Dynmap-essentials (PL)
  • EssentialsX (PL)
  • EssentialsXChat (PL)
  • EssentialsXSpawn (PL)
  • Vault (PL)
  • Luckperms (PL)
  • VanillaTweaks (DP, MOD):
    • Graves
    • Fast Leaf Decay
    • Armored Elytra

Advanced+

  • Colored EnderChests
  • DyedBackpacks
  • EcoPower
  • ExoticGarden
  • LuckyBlocks
  • SlimeFun

Plugin Configuration

Dynmap

For Dynmap, optionally an http proxy is used to proxy to the port 80 since the server doesn't run as root sudo apt install apache2 Proxy Steps TBA

Luckperms

Luckperms config TBA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment