Skip to content

Instantly share code, notes, and snippets.

@vemacs
Created April 29, 2014 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vemacs/0a4abe94e20538e34de0 to your computer and use it in GitHub Desktop.
Save vemacs/0a4abe94e20538e34de0 to your computer and use it in GitHub Desktop.
Minecraft server on Debian/Ubuntu, the minimalist (and right*) way | *Does not cover pubkey-only auth

Basic security setup

  • Log in as root (default configured)
  • Run apt-get update && apt-get dist-upgrade
  • Create a user named minecraft with adduser minecraft, and skip everything except the password
  • Run usermod -a -G sudo minecraft
  • Log off, and log back in with the minecraft account
  • Run sudo passwd -dl root
  • Disable root login via SSH by running sudo sed -i -e "s/PermitRootLogin yes/PermitRootLogin no/g" /etc/ssh/sshd_config && sudo service ssh restart

Running your server

  • Run sudo apt-get install openjdk-7-jdk tmux
  • Start a new tmux session by running tmux
  • Run mkdir mcserver
  • Use wget to get your server JAR.
    • wget http://ci.md-5.net/job/spigot/lastSuccessfulBuild/artifact/Spigot-Server/target/spigot.jar for Spigot
    • wget http://www.minecraft.net/download/minecraft_server.jar for Vanilla
    • Or, copy the URL for your specific server JAR (e.g. CraftBukkit) and place it after wget
  • Run java -Xmx512M -jar <server JAR name> to start your server
  • To detach, do Ctrl+B-D(press Ctrl+B, and then hit D)
  • To reattach, run tmux attach
  • To update your server JAR, just wget -N <URL> in the mcserver directory.
@Sulent
Copy link

Sulent commented Jul 18, 2014

Me Likie :D

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