{"id":607,"date":"2017-01-28T16:57:18","date_gmt":"2017-01-28T08:57:18","guid":{"rendered":"http:\/\/52duanzi.cn\/wordpress\/?p=85"},"modified":"2017-11-24T15:16:13","modified_gmt":"2017-11-24T07:16:13","slug":"how-to-install-a-minecraft-server-on-ubuntu","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/607","title":{"rendered":"How to Install a Minecraft Server on Ubuntu"},"content":{"rendered":"<div class=\"doc_header\">\n<h1><\/h1>\n<div>Modified on: Tue, Nov 29, 2016 at 6:49 pm EST<\/div>\n<div><a class=\"doc_tag\" href=\"https:\/\/www.vultr.com\/docs\/category\/game-servers\/\">Game Servers<\/a> <a class=\"doc_tag\" href=\"https:\/\/www.vultr.com\/docs\/category\/linux-guides\/\">Linux Guides<\/a> <a class=\"doc_tag\" href=\"https:\/\/www.vultr.com\/docs\/category\/minecraft\/\">Minecraft<\/a> <a class=\"doc_tag\" href=\"https:\/\/www.vultr.com\/docs\/category\/ubuntu\/\">Ubuntu<\/a><\/div>\n<\/div>\n<div class=\"doc_content\">\n<p>In this article, we are going to install a Minecraft server on an Ubuntu. Make sure that you are logged in under a user that isn&#8217;t the root user, as running this server as root can be unsafe.<\/p>\n<p>In order to run a Minecraft server, we need Java 1.7 to be installed on the server. To install Java 1.7, run the following commands:<\/p>\n<pre><code>sudo apt-get update\nsudo apt-get install openjdk-7-jdk\n<\/code><\/pre>\n<p>Now, we are going to download the Minecraft server via <code>wget<\/code>. If you don&#8217;t have <code>wget<\/code> installed, then you can install it via <code>sudo apt-get install wget<\/code>.<\/p>\n<pre><code>wget https:\/\/s3.amazonaws.com\/Minecraft.Download\/versions\/1.10.2\/minecraft_server.1.10.2.jar\nchmod +x minecraft_server.jar\n<\/code><\/pre>\n<p>The Minecraft install is complete. You can now start your Minecraft server via the following command:<\/p>\n<pre><code>java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui\n<\/code><\/pre>\n<p>This command starts the Minecraft server with 1024MB RAM allocated. How to allocate more RAM to Minecraft server is easy. Simply change the <code>-Xmx<\/code> and <code>-Xms<\/code> attributes in the command.<\/p>\n<p>In case you want the server to run in the background, you can install screen:<\/p>\n<pre><code>apt-get install screen\n<\/code><\/pre>\n<p>To start the Minecraft server in screen, open a screen instance, then run the Java command again.<\/p>\n<pre><code>screen\njava -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui\n<\/code><\/pre>\n<p>To exit out of the screen window, press <strong>CTRL + A<\/strong>, then <strong>d<\/strong>. If you want to open the window again, use the command <code>screen -r<\/code>.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Modified on: Tue, No<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[117,41,42],"class_list":["post-607","post","type-post","status-publish","format-standard","hentry","tag-01-linux","tag-minecraft","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=607"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/607\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}