{"id":476,"date":"2013-03-27T22:59:38","date_gmt":"2013-03-27T22:59:38","guid":{"rendered":"http:\/\/z303.org\/?p=476"},"modified":"2025-03-17T22:03:14","modified_gmt":"2025-03-17T22:03:14","slug":"running-a-minecraft-server","status":"publish","type":"post","link":"https:\/\/www.z303.org\/?p=476","title":{"rendered":"Running a Minecraft Server"},"content":{"rendered":"<p>I used to run a small <a href=\"https:\/\/minecraft.net\/\">Minecraft<\/a> server with some friends, these are my notes on how I setup the machine.<br \/>\n<!--more--><br \/>\nSo for server specification required I looked on the <a href=\"http:\/\/www.minecraftforum.net\/viewtopic.php?f=1012&amp;t=43163\">forums<\/a> (but the <a href=\"http:\/\/www.minecraftwiki.net\/wiki\/Server\/Requirements\/Dedicated\">wiki has a better page now<\/a>). For the machine I went with <a href=\"http:\/\/buyvm.net\/\">BuyVM<\/a> after finding them on <a href=\"http:\/\/www.lowendbox.com\/\">low end box<\/a>. For the OS, I used Ubuntu 10.04 32 bit server. Mostly because I&#8217;ve been using Ubuntu for years. First adding some extra repos.<\/p>\n<p><code>sudo nano \/etc\/apt\/sources.list<br \/>\ndeb http:\/\/uk.archive.ubuntu.com\/ubuntu\/ lucid main restricted universe multiverse<br \/>\ndeb http:\/\/uk.archive.ubuntu.com\/ubuntu\/ lucid-security main restricted universe multiverse<br \/>\ndeb http:\/\/uk.archive.ubuntu.com\/ubuntu\/ lucid-updates main restricted universe multiverse<br \/>\ndeb http:\/\/archive.canonical.com\/ubuntu lucid partner<\/code><\/p>\n<p>Then install Java<\/p>\n<p><code>sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-fonts<\/code><\/p>\n<p><a href=\"http:\/\/www.howtogeek.com\/howto\/ubuntu\/add-a-user-on-ubuntu-server\/\">Added an account<\/a> for the minecraft server to run as, to keep things nice and separate. Then followed mostly following <a href=\"http:\/\/www.minecraftforum.net\/viewtopic.php?f=10&amp;t=628\">some good instructions<\/a> from the forums. First logging into the server with the minecraft account, then sftp&#8217;d the latest server jar over and ran it with <\/p>\n<p><code>java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui <\/code><\/p>\n<p>which is fine for testing but means you need to be logged into a terminal all the time. <a href=\"http:\/\/www.minecraftforum.net\/topic\/33616-running-minecraft-in-a-screen-session\/\">Running using screen<\/a> is much more useful.<\/p>\n<p><code>screen -dmS minecraft java -Xms768M -Xmx768M -jar minecraft_server.jar nogui<\/code><\/p>\n<p>xms is the size of the memory the server starts with. xmx is the size of the memory the server can expand upon. I took the <a href=\"http:\/\/www.minecraftforum.net\/topic\/25574-rattys-linux-server-admin-tricks\/\">directory structure from another forum post<\/a>. One other thing to watch out for is IP6 vs. IP4<\/p>\n<p><code>screen -dS $SCREEN_NAME java -Xmx${MEMORY}M -Xms${MEMORY}M -Djava.net.preferIPv4Stack=true  -jar $SERVER_PATH\/minecraft_server.jar nogui<\/code><\/p>\n<p>screen is great but no use if the server crashes when you are away from an ssh client, so I used a <a href=\"http:\/\/www.minecraftforum.net\/topic\/33319-minecraft-server-autobackup-for-linux\/\">auto backup script<\/a> called from cron. With another copy used to restart the Minecraft server if it was not already running.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I used to run a small Minecraft server with some friends, these are my notes on how I setup the machine.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_block_theme_hide_title":false,"footnotes":""},"categories":[8,10,12,22],"tags":[],"class_list":["post-476","post","type-post","status-publish","format-standard","hentry","category-games","category-linux","category-minecraft","category-technology","without-featured-image"],"featured_image_src":null,"featured_image_src_square":null,"author_info":{"display_name":"Zoe","author_link":"https:\/\/www.z303.org\/?author=1"},"_links":{"self":[{"href":"https:\/\/www.z303.org\/index.php?rest_route=\/wp\/v2\/posts\/476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.z303.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.z303.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.z303.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.z303.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=476"}],"version-history":[{"count":0,"href":"https:\/\/www.z303.org\/index.php?rest_route=\/wp\/v2\/posts\/476\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.z303.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.z303.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.z303.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}