Minecraft Wiki
Advertisement
警告

自分が何を行おうとしているか正しく理解せずにサーバーソフトウェアを実行すると、システムを重大なセキュリティリスクにさらす恐れがあります。 以下の手順をたどるまえに注意してください[1] 

Book and Quill
このページは翻訳途中です。 
あなたが内容を翻訳してみませんか?
Clock JE3
この記事は内容の更新を必要とします。 
この記事を更新して、最近のアップデートや新たな情報を反映してください。

このチュートリアルでは、サーバーのセットアップの手順を、Mojangが無料で提供している標準のサーバー(ソフトウェア)を用いて説明する。
サーバー(ソフトウェア)は、Windows、macOS、Linuxなど多くのOS(オペレーティングシステム)上で実行できる。
また、Mojangが提供しているサーバー(ソフトウェア)のことを、公式サーバーやバニラサーバーと呼ぶ。

  • MojangではMinecraft Realmsという有料サーバーのホスティングを行っている。こちらを利用することもできる。

備考: 公式サーバーを拡張したサーバー(カスタムサーバー)も存在しているが、そちらはMojangのサポート対象外である。
代表的なカスタムサーバーである、CraftBukkit・Spigotに関する日本語情報は、非公式サイトであるがBukkitSpigotJapanWikiを確認すると良い。

警告

独自のサーバーを実行しようとするなら、起こり得る危険性について注意すべきである。サーバーの実行とそれがもたらすリスクはすべて自己責任であるが、自分が何をしているか理解せずに行うことはすべきではないと忠告しよう。以下の手順をそのまま実行しても大丈夫なようにすべきではあるが、誰もが編集できるウィキである以上、そしてあなた個人のシステム設定についてはこちらは関知しないので、安全性についての保証はしかねる。 サーバーを実行して問題が起きないようにするには、最低限以下の知識について学ぶことを強く薦める。

  • コンピューターネットワーク全般 (IP、DHCP、ポートなど)
  • 自分のシステム設定
  • 自分のネットワーク設定
  • 自分のルーターの設定 (インターネット経由で他のプレイヤーに利用してほしいサーバー、公開サーバーとする場合)

サーバーをセットアップしないと決めたなら、代わりに他のインターネット上で公開されているサーバー(公開サーバー)への参加するのもいいだろう。 公開サーバーについては、[1]を参照して欲しい。

Windowsでの手順

Javaの状態の確認

  1. Javaの状態を確認するために、コンソールウィンドウ(CMD)を開く。
    Windows XP以降のOSでは、⊞ Winキーを押しつつRを押して「ファイル名を指定して実行」ウィンドウを開き、 cmd と入力することで開ける。
    • コンソールウィンドウで、次のコマンドを入力し↵ Enterを押す。
      java -version
    • この操作でJavaのバージョンを得られる。以下は例である。
      java version "1.8.0_112"
      Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
  2. もし「 'Java' は、内部コマンドまたは外部コマンド、操作可能なプログラムまたはバッチ ファイルとして認識されてない。 」というエラーメッセージが表示されたら、
    古いバージョンのJava(1.6以前)であったり、Javaの環境変数が正しく設定されていない可能性がある。Javaの環境変数の設定方法は、下記の#Javaの環境変数の設定を確認する。
    その場合は次の#Javaのインストールへ進む。

Javaのインストール

  1. 最新版の32bit版Java(32bitOSで基本的に使用するが、64bitOSで使用することもあるもの)は、
    無料Javaのダウンロードから入手できる。また、こちらは32bit版・オンラインインストーラーとなる。
    最新版の64bit版Java(64bitOSでなければ使用できない、64bitOSではこちらは必ず入れなくてはならない)は、
    全オペレーティング・システム用のJavaのダウンロードの「Windows オフライン (64ビット)」よりダウンロードする。
    • 最新版のJavaをインストールしたら、再びコンソールウィンドウで次のコマンドを入力し↵ Enterを押す。
      java -version
    • エラーが起きるようなら、Javaの環境変数を設定しなくてはならない。
      設定方法は、下記の#Javaの環境変数の設定を確認する。

Windows 7でこの手順が上手くいかなければ、スタートメニューを開き、「Java」を検索して、出てきたものを右クリックして、「プロパティ」をクリックする。
詳細タブの製品名にバージョン番号が、「Java(TM) Platform SE 8 U??」のように含まれている(この場合はJava8)。

Javaの環境変数の設定

  1. スタートメニューの「コンピューター」を右クリックする。
  2. 「プロパティ」をクリックする。
  3. 「システムの詳細設定」をクリックする。
  4. 「環境変数(N)...」をクリックする。
  5. システム環境変数の、「Path」という変数を探す。
  6. 「編集(I)...」をクリックして、変数値の末尾に次の文章を追加する: ;"C:\Program Files\Java\jre8\bin"
    64bit版OSで32bit版Javaを用いるなら、次の文章へで追加する: ;"C:\Program Files (x86)\Java\jre8\bin"
    なお、 jre8 の部分はJavaのバージョンによって異なる。
  7. コンピューターを再起動する。
  8. コンソールウィンドウ(CMD)を再び開いてやり直す。

サーバーの準備および配置

  1. jarファイルを実行するためにはJavaをインストールし、環境変数が正しく設定されている必要がある。
    上記の#Javaの状態の確認でそれらを確認する。
  2. 公式サーバーをダウンロードすると、以下の規約に同意したこととなるため、必ず先に目を通さなくてはならない
  3. 上記の規約に目を通し、確認したら、PC/MAC用のMINECRAFTサーバーをダウンロードするの「minecraft_server.x.x.x.jar」より、サーバーをダウンロードする。
    なお、このページからは最新版のサーバーしかダウンロードできない。
    旧バージョンのサーバーのダウンロードについては#旧バージョン・指定したバージョンの公式サーバーのダウンロードを確認する。
  4. もし、拡張子がzip等のjarでないものになってしまった場合は、拡張子を jar へ書き換える。
    拡張子が表示されていない(見えない)場合は、各自で「拡張子 表示」等で調べて対応する。
    Windows7の場合、コントロールパネル→デスクトップのカスタマイズ→フォルダーオプション→表示→詳細設定の中から、「登録されている拡張子は表示しない」という項目のチェックを外すことで、拡張子が表示される。
  5. サーバーをダウンロードできたら、サーバーを適当なフォルダに配置する。
    念の為に日本語などの2バイト文字がパスに入らないようにすることを推薦する(例: C:\Server)。

これで公式サーバーの準備および配置が完了する。
次の#初めての起動およびEULAの同意へ進む。

旧バージョン・指定したバージョンの公式サーバーのダウンロード

旧バージョンもしくは指定したバージョンを入手するには、以下のURLを利用してアクセスするとダウンロードできる。(このURLは公式のファイル置き場のもののため、二次配布入手とはならない)
https://s3.amazonaws.com/Minecraft.Download/versions/x.x.x/minecraft_server.x.x.x.jar
x.x.x部分にダウンロードをしたいバージョンを入れる(例:1.2.5→1.2.5)ことでできる。

起動用スクリプトの作成

一般的にjarファイルを実行するためには、スクリプト(ファイル)を作成してそのスクリプト(ファイル)をダブルクリックして実行する必要がある。
そこで、ここではそのスクリプト(ファイル)の作成方法を説明する。起動用スクリプトとは、サーバーを起動するためのスクリプトである。
なお、より詳しいスクリプトの記述方法は~を確認すると良い。

CUI(コンソール)での方法

この方法では、サーバーをCUI(コンソールを利用)で起動する。

  1. ダウンロードしたサーバーのあるフォルダへ行く。
  2. エクスプローラーのウインドウのフォルダ表示上で、右クリックをして、「新規作成」、「テキスト文書」をクリックし、拡張子がtxtのファイルを作成する。
  3. そのファイルの拡張子を bat へ変更する(この拡張子がbatのフォルダを一般に、「batファイル」と呼びます)。
    また名称はなんでも良い。「start.bat」等にすると良い。
    拡張子が表示されていない(見えない)場合は、各自で「拡張子 表示」等で調べて対応する。
    Windows7の場合、コントロールパネル→デスクトップのカスタマイズ→フォルダーオプション→表示→詳細設定の中から、「登録されている拡張子は表示しない」という項目のチェックを外すことで、拡張子が表示される。
  4. batファイル(拡張子がbatのファイル)を選択しその上で、右クリックをして、「編集」をクリックする。クリックすると、メモ帳が起動する。
  5. メモ帳が起動したら、以下の文章を書き込み、保存する。
    @echo off
    java -Xms1024M -Xmx1024M -jar <サーバーのjar> nogui
    pause
    ※<サーバーのjar>は起動したいjar(例:minecraft_server.1.11.2.jar)によって変わるので、各自で書き換える。

これで起動用スクリプトの作成が完了する。
次の#起動用スクリプトの作成へ進む。

GUI(ウインドウ)での方法

上記の#CUI(コンソール)での方法を確認してから行うことを推薦する。

  • サーバーはGUI(ウインドウ)でも起動することができる。
    その方法は、起動用スクリプトに記述するスクリプトのサーバーの引数に nogui を入れるかで選択できる。以下のようにすると良い。
    @echo off
    java -Xms1024M -Xmx1024M -jar <サーバーのjar>
    pause
    ※<サーバーのjar>は起動したいjar(例:minecraft_server.1.11.2.jar)によって変わるので、各自で書き換える。

なお、サーバーをCUI、GUIで起動しても差はあまりないので、自由に選択すれば良い。

環境変数を設定しない場合の方法

上記の#CUI(コンソール)での方法を確認してから行うことを推薦する。

  • 環境変数を設定しないでサーバーを起動する方法は、起動用スクリプトにJavaのパスを記述する必要がある。
    以前は、これはJavaのパスが変わる毎に環境変数の変更を行わず、標準の環境変数のままで良いため楽であると考えられたが、現在はJavaのインストーラーによって書き換えられるためあまり差がないといえる。
    しかし、複数のバージョンのJavaを切り替えて使用できることができるため、その場合には良い方法である。


環境変数を設定しないで行うには、#CUI(コンソール)での方法のスクリプト内の java をJavaのパスに置き換えれば良い。
そもそも環境変数がそのファイルのパスを示しているためである。
置き換えるパスは以下のようにすれば良い。
"C:\Program Files\Java\jre8\bin\java.exe"
64bitOSで32bit版を使うのならば以下のようにすれば良い。
"C:\Program Files(x86)\Java\jre8\bin\java.exe"
なお、 jre8 の部分はJavaのバージョンによって異なる。

結果的に以下のようになるはずである。

@echo off
"C:\Program Files\Java\jre8\bin\java.exe"-Xms1024M -Xmx1024M -jar <サーバーのjar> nogui
pause

初めての起動およびEULAの同意

  1. 作成した起動用スクリプト(start.bat)をダブルクリックで実行する。
  2. コンソール(CMD)という黒いウインドウが出てくるが、数秒するとそのウインドウが閉じる。
    初回起動時(初めての起動の時)は、MinecraftのEULA(エンドユーザーライセンス条項)に同意する必要があるため、自動的に終了するためである。
  3. EULAに同意する。
    MINECRAFT エンドユーザーライセンス条項に目を通した上で同意する場合は、
    サーバーがあるディレクトリのeula.txtを、メモ帳などのテキストエディタで開き、その中の eula=falseeula=true へ変更し、保存する(必ずEULAには目を通して下さい)。

これで初めての起動およびEULAの同意が完了する。
次の#サーバーの起動へ進む。

サーバーの起動

  1. 再度、起動用スクリプト(start.bat)をダブルクリックして実行する。
    コンソール(CMD)のウィンドウが表示され、様々なファイル・フォルダが生成される。
  2. ファイル・フォルダの生成を確認したら、コンソールのウィンドウに stop と入力して終了する。
    コンソール(CMD)の右上の×ボタンから(stopを入力せずに)閉じるとデータが保存されない場合がある。留意しなくてはならない。

以降、起動用スクリプト(start.bat)を使うことでサーバーの起動コンソール(CMD)に stop と入力することでサーバーが終了する。
これでサーバーの起動が完了する。
次の#接続の確認へ進む。

接続の確認

  1. ゲームを起動し、サーバーを起動した状態にする。
  2. 「Multiplayer」から「Direct Connect」か「Add server」を選択して「Server Address」次のアドレスのどちらかを入力する。
    localhost もしくは127.0.0.1(どちらのアドレスもそのPC自身のことを指す)
  3. そして、接続。
    接続できれば、サーバーの起動・セットアップに成功している。

これでサーバーのセットアップが完了する。

ただし、ここまではあくまでセットアップであるため、ここからサーバーの設定を変更したり、ワールドを開拓したりする必要がある。
そのことについては、Server.propertiesなどを確認すると良いだろう。

Windows・exe版での手順(旧バージョン)

exe版サーバー(ソフトウェア)は1.9よりなくなったため、最新バージョンでは使用できません。

サーバーの準備および配置

  • ダウンロードしたサーバーをサーバーをダウンロードできたら、サーバーを適当なフォルダに配置する。
    念の為に日本語などの2バイト文字がパスに入らないようにすることを推薦する(例: C:\Server)。

サーバーの起動

サーバーを起動する際は、jar版のように起動用スクリプトを作成する必要がない。
サーバーを起動は、サーバーをダブルクリックで実行すれば良い。
なお、1.7.10以降はEULAに同意する必要がある。その方法は#初めての起動およびEULAの同意を確認して欲しい。
EULA同意後の初回起動時に、エラーメッセージ「File not found」(ファイルがみつかりません) が幾つか表示されるかもしれない。しかし、これらファイルは新たに作成される。
サーバー起動後は、#接続の確認を確認して欲しい。

macOSでの手順

Mac OS Xでのサーバーのセットアップの詳細な手順のステップのチュートリアル動画があるので確認して下さい。
Mac OS X 10.4ではサーバーは正常に動作せず、コンピューターをクラッシュさせることに注意して欲しい。

ダウンロード

最新版のサーバーアプリケーションをダウンロードしておこう。

Javaのインストール

Mac OS Xは既に独自のバージョンのJavaがあり、ソフトウェア・アップデートで自動的に更新される (アップルメニュー→ソフトウェア・アップデート)。

Minecraftサーバーのセットアップ

まず最初に以下のダウンロード手順を確実に行おう。

  • もし無ければサーバーのフォルダーを作り、そこに minecraft.jar を置く。例えばデスクトップに minecraft_server というフォルダーをつくり、そこにjarファイルをドラッグして入れる。
  • TextEditを開き、フォーマットをプレインテキスト (フォーマット→プレインテキストの作成) として、次の内容を貼り付ける。
#!/bin/bash
cd "$(dirname "$0")"
exec java -Xmx1G -Xms1G -jar minecraft_server.jar
  • ファイル名 start.command として、minecraft_server.jarと 同じフォルダーに 保存する。
    • こうすることで充分なメモリーをサーバーに割り与えることが出来る。メモリー容量は 1G を変更すれば変えることが出来る。例えば 2G とすることで2GBに出来る。
  • ターミナルを開く (/Applications/Utilities/Terminal)。
  • 実行パーミッションをファイル start.command に実行パーミッションをオーナー、グループ、その他に与える。chmod a+x として、空白の後にファイル start.command をターミナルのウィンドウにドロップし、↵ Enterを押せばよい (こうすることでstart.commandスクリプトに対して 実行 パーミッションを与える)。
  • ファイル start.command をダブルクリックしてサーバーを起動する。
  • 新しいターミナルのウィンドウが開くだろう。スクリプトを初めて実行したなら、ファイルやディレクトリーが不足しているというエラーメッセージが幾つか表示されるだろう。これは普通の事である。これでサーバーを設定できるようになった。

Time Capsuleを使用する

AirPort Time Capsuleをワイヤレス・ルーターとして用いることがある。この節ではファイルサーバーに影響を与えずに設定する方法を解説する。

注意:管理者のユーザー名とパスワードを準備しておくこと。

  • システム設定→ネットワークを開く。
  • 詳細ボタンをクリックしてTCP/IPへと行く。
  • IPv4の設定があるので、DHCPをアドレス手動指定へと変更する。
  • IPアドレスを 10.0.1.x へと変更する。この際 x には1から100までの数値であれば何でもよい。
  • 共有セクションを開き、インターネット共有が有効であることを確認する。
  • 次に、AirPortユーティリティを開き、Time Capsule設定を編集する。
  • ネットワークを開き、ルーターモード設定がDHCPとNATであることを確認する。そして + ボタンを押してポート設定を開く。
  • 次のように入力する。
    • 説明:Minecraftサーバー (もしくは付けたい名前なら何でも)
    • プライベートIPアドレス:上の4番目の手順で指定したアドレス
  • ポート番号となっている所を全て 25565 へと変更する。
  • 保存をクリックしてTime Capsuleを更新する。

以上で完了だ! これでサーバーを設定できるようになった。

デーモンとして実行する

代わりに、Minecraft サーバーの起動を自動化することも出来る。

Tutorials/Create a Mac OS X startup daemon

Linuxでの手順

以下はLinuxへの造詣が深くないユーザーに向けた、Minecraft サーバーのセットアップのチュートリアルである。フォーラムにはより高度なチュートリアルが (英語ではあるが) 存在する。 このチュートリアルはUbuntu 9.10 32ビット版でテストされたものであるが、Debian系列であればうまくいくだろう。

ダウンロード

最新版のサーバーアプリケーションをダウンロードしておこう。

Javaのインストール

java: command not found (「java というコマンドが見つかりません」の意。もっとメッセージが表示されるかもしれない) というエラーメッセージが表示されたり、Java 7 (Java 1.7) 以外のバージョンのJavaをインストールしているなら、Javaのインストールか更新が必要となる。 オラクル公式のJavaが推奨される。OpenJDKで問題が発生したユーザーが数名存在しているからだ。ただしOpenJDKでも問題ないユーザーも多い。

Debian

aptコマンドがnon-freeリポジトリーを検索するようにする。ファイル /etc/apt/sources.listnon-freeを次のように追加すればよい。

deb http://ftp.uk.debian.org/debian/ squeeze main contrib non-free

ソースパッケージのリポジトリーを更新する (要root権限)。

apt-get update

その後Javaをインストールする。ターミナルに次のように入力して↵ Enterを押す (要root権限)。

apt-get install oracle-java7-jre

Ubuntu

残念ながら、ライセンス上の問題からオラクルのJavaはカノニカル社のリポジトリーには入っていない。Javaをインストールするには、オラクルから直接ダウンロードしてパッケージを作成しインストールするか、webupd8が提供するPPAを用いる必要がある。以下はwebupd8からのインストールの手順を説明する。

このガイドはUbuntu Server 12.10で試したものである。

注意: apt-add-repository コマンドを利用するには、パッケージ "software-properties-common" を apt-get install software-properties-common を実行してインストールする必要があるだろう。

PPAを追加してソースの一覧を更新しJavaをインストールするために、以下のコマンドを実行する。

sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

そして次のコマンドを実行してインストールしたバージョンを確認する。

java -version

出力は次のようになるだろう。

java version "1.7.0_10"
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

この手順の詳細と問題解決方法についてはwebupd8公式のブログ記事を参照して欲しい。

openSUSE

古いバージョンのopenSUSEでは、ターミナルに zypper in java-1_6_0-sun と入力しさえすればよい。

最近のバージョンではJavaのインストール法を解説するチュートリアルがあるので参照して欲しい。

Arch Linux

root権限を持つユーザーでターミナルを開き pacman -S openjdk6 を実行する。

Gentoo

次のコマンドを利用する。

emerge virtual/jre

その他ディストリビューション

代わりに直接Javaのウェブサイトを訪れ、Linux向けのJavaパッケージをダウンロードしてもよいだろう。ほとんどのディストリビューションはこれでうまくいく (32ビットであっても64ビットであっても)。様々なパッケージのインストール手順についてはリンク先にある。

インストール中にパスワードを尋ねることがあるので入力する。"Is this OK [Y/N]" のように表示されたら、Yを押し↵ Enterを押す。Javaがインストールされるだろう。

Minecraftサーバーを起動する

再びターミナルを アプリケーション→アクセサリー→ターミナル から開く。次のコマンドを入力する。ディレクトリー名の部分はサーバーファイルを置いたフォルダー名に置き換える。

cd minecraft_server
java -Xms1G -Xmx1G -jar minecraft_server.jar nogui

メモリー空き容量が1GBに満たない場合

メインメモリーの残量が1024MBに満たないとき、上のようにして実行するとスワッピングとメモリー不足の問題が発生し、ゲームのプレイが難しくなってしまう。


cd minecraft_server 
java -Xms1G -Xmx1G -jar minecraft_server.jar nogui
free -m

It may look like this:

Ram left

You are interested in the last number in the third line, 2163 in this case. Subtract some RAM as safety. On this computer, the server may use up to 1536 MB RAM. Now, replace the 1024 in the above example with the calculated number:

java -Xms1536M -Xmx1536M -jar minecraft_server.jar nogui 

Voila, it should run smoothly now

Tip: If you want to spare more memory, you may set the -Xms parameter even lower, say:

java -Xms32M -Xmx512M -jar minecraft_server.jar nogui 

The parameter controls how much memory is reserved on startup Your server will start with 32MB RAM and whenever it needs more memory it will allocate some until it reaches the maximum of 512 MB. However, this will result in a little slowdown whenever the allocation is done.

起動・メンテナンススクリプト

以下に挙げるもののようなスクリプトを用いて、Minecraft サーバーの起動と停止を管理・自動化することも出来る。

  • Minecraft Server ManagerMinecraft およびBukkitサーバーの包括的な起動スクリプト (DebianやUbuntuに対応)。
    • WorldEdit互換のバックアップの定期的な作成を行うことが出来る。
    • 設定可能なゲーム内メッセージでプレイヤーに情報提供をし続ける。例えば「Shutting down in 10 seconds!」など。
    • ゲーム内コマンド (say、op、whitelistなど) をターミナルへと出力する。
    • 全てのコマンドでTab ↹による補完ができ、覚えるのが簡単になる。
    • Minecraft Server ManagerのGitHubページに全機能の一覧がある。
  • サーバー起動スクリプト
  • ユーザー M3tal Warrior のサーバー起動スクリプト(英語)
    • Debian (おそらくUbuntuでも動作するだろう) 向け。Bukkitおよび無改造の Minecraft 互換。
    • バックアップおよびロールバックルーチン完備。
    • 全てのゲーム内コマンドが実行可能。
    • サーバーのルートファイルシステムにRAMを利用可能。
    • Multiple cron invocations to ease administration
    • Easy autoupdater
    • Easy installer for first timers
  • FreeBSDの起動スクリプト
  • OpenBSDの起動スクリプト
  • Ubuntuの起動スクリプト
  • rfwadminの起動スクリプト (ウェブインタフェース付き。Linuxサーバー向け)。便利なウェブインタフェースで、マップの保存と読み込みを素早く行うことが出来る。

Plan 9での手順

次のコマンドを実行する。

alien-convert <JREのパス>.deb 
chmod ~/~ rwx for <現在のユーザー名>

次に snarf java -jar <.jarファイルのパス> xvmf in acme とする。

ポートフォワーディング

Port forwarding」も参照

ポートフォワーディングは、プレイヤーに対してルーター越しに接続して欲しい場合に用いられる。ローカルな理由でサーバーをホストしたいならこれは必要ではない。ポートフォワーディングによりセキュリティ上の危険性が発生しうることを覚えておくこと。

ポートフォワーディングを行うとき、ルーターが求める情報により様々に変わる。ルーターに指定すべき情報について理解していないなら、PortForward.comへと行きチュートリアルを受けてみよう。更に助けが必要なら、Minecraft Forumsへと行きスレッドを立てて助けを求めよう (要登録)

Once you have managed to locate your router's admin page, and find the Port Forwarding page; hit add new service (may not work) or custom service. When you get a page asking to setup the new rule, it should prompt you on what you want to call it. You may name it as you wish but for simplicity, name it "minecraft". Then you want to look for "type". Select TCP. For the ports (internal and external), enter 25565. If it asks for anything else other than output IP (or internal IP, server IP), leave it alone and continue.

For the out put IP address, use the following steps.

Windows
Locate to your desktop and hit start. From there, either search for cmd, or on previous versions of windows press "run" and type in cmd and hit enter. Once you have completed those steps, a console window should open. From there, enter "ipconfig /all" and press ENTER. From there, you should be given a list of text. Scroll up to Wireless LAN, and look at IPv4 address. On the right should be a couple of numbers, (xxx.xxx.xxx.xxx) copy this down by right clicking the window, and pressing mark; Highlight the area and hit enter. Don't copy any parenthesis or letters.
Mac
Ip-address-mac-610x206

The IP location on Mac OS X

Locate your way to your desktop. Pull up the apple menu under the logo and scroll down to System Preferences; then select "Network" your IP should be on the lower right as "IP address (xxx.xxx.xxx.xxx). Once you have your IP, copy it down.
Linux
Either you use the network diagnose center (depending on distribution), or the terminal with ifconfig. The output should return all your interfaces. Search for inet addr:xxx.xxx.xxx.xxx, copy the xxx.xxx.xxx.xxx numbers down.

Once you have this IP, enter it in the "Output IP / Server IP" or what ever way it asks for where the service points to.

Once you have completed it, find where it says to save/continue/apply. And you have successfully port forwarded. When you run your minecraft server, you have to leave the Server IP field empty in the server properties.

For people to connect to your server, they must use your external IP, which you can find at websites such as IP Chicken. If you don't want to use such IPs, use DynDNS services.

Configure and connect

Now it is time to configure and connect.

VPNを設定する

Paper
この節の内容は、Mojang StudiosまたはMinecraft Wikiのサポート対象外です。

あなたとそのフレンドのためにサーバーをセットアップするもう一つの方法にVPN (Virtual Private Network)がある。この方法は少し不便なため推奨されていないように思われる。 なぜなら、この方法によって作成されたサーバーに接続するためにはMinecraftとは別にソフトウェアをインストールする必要があるからである。そのため通常はポートフォワーディング を使用すべきである。VPNを使うのはルーターの仕様などでポートフォワーディングが使えない時だけにしておこう。VPNをセットアップするソフトウェアの例に、LogMeIn社が提供する Hamachiがある。Hamachiの無料版は最大5ユーザー(プレイヤー)まで1つのサーバーに接続できる。

Hamachiを使用してサーバーをセットアップする手順

  1. サーバーとなるコンピュータを含め、1つのサーバーに参加する全てのコンピュータに自分のコンピュータに対応したHamachiを以下のリンクよりダウンロードし、インストールする。
    Windows / Mac
    Linux (32Bit版と64Bit版の両方がダウンロード可能。.debパッケージと.rpmパッケージが利用可能。また、Gentoo Linuxでは、emergeコマンドで"net-misc/logmein-hamachi"を使うことでインストールできる。)
  2. Logmein website に管理者としてサインアップする。
  3. これでサーバーとなるコンピュータに新しいHamachiのネットワークが作成された。
  4. サーバーにMinecraftのサーバーソフトウェアをインストールし、設定する。このとき、IPアドレスの欄は空欄にしておく。
  5. 全てのプレイヤーに新しくHamachiによって作成されたネットワークの資格情報を伝える。
  6. この時点でプレイヤーはサーバーが作成したHamachiのネットワークに接続することができる。
  7. プレイヤーがHamachiのネットワークに接続できたところで、サーバー作成者はHamachiのIPv4アドレス(電源マークの右側に表示)をプレイヤーに伝える。
  8. 7で伝えられたIPアドレスを使用してプレイヤーはMinecraftのマルチプレイの画面からサーバーに参加する。

Configuring the Minecraft server

  1. Configure the server by editing the server.properties file, the format for which is explained here. Be certain to edit the file with a text editor that does not add formatting (e.g., for italics). Additional configuration may not be necessary as many servers run fine from the default values.
  2. Add your username to the admin.txt and/or ops.txt (newer Minecraft versions may not have an admin.txt file).
    • Ops.txt and admin.txt determine who may execute server commands. In other words, operator ("op") privileges allow you to control certain aspects of the game (e.g., teleporting players).
    • Op privileges may also be granted from the server GUI: type "op <username>" and it will automatically add <username> to the ops.txt file. Being an op will not let you fly and/or have a creative inventory, but you can use /gamemode 1 to do so.

Connect to the Minecraft server

  • If you are playing on the same machine on which the server is running, select the "Multiplayer" option in the game client, click direct connect, and then type in "localhost" instead of an IP address.
    • Both hosting and playing on the same machine is not a recommended practice unless you have a powerful computer (e.g. more than 6 gigabytes of ram (5 for the server, 1 for the client, and remainder for system).
  • Users within your local network (i.e. that are accessing the same router) can connect using your internal IP address - port forwarding is not required for such local connections. The internal IP address of a specific network adapter can be found by typing "ipconfig" into command prompt and looking for the ipv4 address.
  • People connecting from the Internet (i.e., outside of your local network) must connect using your external IP address. You must port forward for someone outside your network to connect to the server.

IP address notes

  • Unless you set a static IP for the computer that is hosting the game, the internal IP address can change. This affects port forwarding rules, and can make them invalid. Each modem or router has a different way of setting a static IP address. You should refer to the manual for your device(s) or online documentation for further instruction.
  • If you are having players connect to your external IP, your external IP can change if you do not have a static IP from your internet service provider. Use a tool such as MyWANIP to periodically check on the external IP address. You may also search "my ip address" on Google and it will show your IP address. Alternatively, you can look into a DNS service that will allow you to have a name, rather than an IP address, that will remain the same. The name will point to your external IP address, regardless of whether or not it changes (the DNS is updated when changes occur).

Firewalling, NATs and external IP addresses

  • You must open the TCP port (default is 25565) on the firewall.
    • If the server in question is not reachable via a globally routable IP address, you will need to add appropriate address and/or port number translation rules to the gateway — usually your router has the global IP address.
  • For help with address translation, opening the firewall and routing (these three make up what people call port mapping/forwarding), portforward.com is a good source. Select your router from that list, skip the ad that comes after selecting the device, and you will see instructions for setting up port forwarding. Alternatively, you can read the documentation supplied with your router, modem, or other ISP related hardware.
  • Verify the port is open, and note your external IP by using a port checker tool, such as You Get Signal. The default port you should test is 25565, unless you specified something else. Have the Minecraft server running when you test the port.
  • You can obtain your external IP address from YouGetSignal.

Local network dedicated servers

This only applies to Classic (v0.30) servers.

A common problem for server administrators is the inability to connect to your own server via another machine on your local network. A typical scenario for this is that you have a Classic server running on a dedicated machine, and you have your own machine which you play on. They're both connected to the same router/switch, and have internal IP's with the octets '192.168.x.x'. Normally, connecting via the URL generated for your server will result in an error message claiming that the server is offline.

To correct this, you must add a function to the end of your URL, bookmarks, or whatever else you connect by. The function is: ?override=true
Example: http://www.minecraft.net/classic/play/4c3bebb1a01816acbe31c5ece1570da5?override=true

Previously, (before the 1.8 beta and website update) this was &override=true. This caused much confusion since the change was not announced by Mojang, and wasn't announced on the website applet pages either. Before the update, connecting to your own URL via the website resulted in red text under the applet window saying "If you can't connect, try this link instead." The link returned the same thing, with the &override=true affixed to the end.

Note: This situation does not effect Beta servers, and you should be able to connect via an internal or external IP.

FAQ (frequently asked questions)

Q: I have a problem which is not answered in here! What should I do to?

A: Go to the Minecraft Forums and post your problem there. To help you, they need the following information:

  • Operating system
  • Version of Java
  • One machine or multiple computers
  • Exact description of the problem
  • Steps you have taken to solve the problem
  • Any errors you encountered
  • Screenshots of the problem (if possible)
  • Anything else that might help us to solve your problem - there almost never is too much information (passwords would be too much information!)

And please, if we were able to help you, post where the problem was exactly and what the fix was for that. Other people will appreciate that (and we will be able to get a grip on the common problems)!


Q: On a Windows computer, when I double click the batch file it opens a command prompt window, but quickly disappears and the server does not start.

A: Right-click your .bat program and hit edit; add a new line and type pause save and run the file. If it says invalid path, it is probably due to an incorrect path for javaw.exe or your server software. You may just need to change /jre7/ to /jre6/ . Or search your system for javaw.exe and adjust the path accordingly. (It's probably under c:\program files or c:\program files (x86).) Also, you must have the offline version of Java installed—not just the Java plug-in for your browser.

You can also try replacing the contents of the .bat file with: START "minecraft" "C:\Program Files (x86)\Java\jre7\bin\javaw.exe" -Xms1024m -Xmx1024m -jar "Minecraft_Server.exe" amending name values/locations as required


Q: Whenever I try to get the server up, it says "Failed to bind to port!".

A: This usually means that you have tried to use a port that is already in use or that you do not have permission to use (ports < 1024 are privileged and require root to bind to). You can try a different port by changing it in your server.properties file in this line: server-port=25565.

Note: You should avoid using the following ports for your server as some ISPs may block these ports for security reasons and you shouldn't be running the Minecraft server as root (in the case of a Linux type OS and ports < 1024):

  • 21 (Used by most FTP Servers)
  • 22 (Used by Secure Shell daemon)
  • 25 (Used by Mail Servers for SMTP)
  • 53 (Used by DNS Servers)
  • 80 (Used by most Web Servers)
  • 110 (Used by most Mail Servers for POP3)
  • 115 (Used by Simple File Transfer Protocol)
  • 143 (Used by Mail Servers for IMAP)
  • 443 (SSL port for Web Servers)
  • 3306 (Used by most MySQL Servers)

Generally avoid any port below number 1024, since those ports are generally referred as well-known ports and are registered with the IANA for important services.


Q: I tried to run the server with Solaris/OpenSolaris and got the following error:

java.io.InterruptedIOException: Operation interrupted 
at java.net.SocketInputStream.socketRead0(Native Method) 
at java.net.SocketInputStream.read(SocketInputStream.java:129) 
at java.net.SocketInputStream.read(SocketInputStream.java:182) 
at java.io.FilterInputStream.read(FilterInputStream.java:66) 
at gq.a(SourceFile:131) 
at ji.g(SourceFile:197) 
at ji.c(SourceFile:17) 
at oq.run(SourceFile:84) 
2011-05-31 16:57:26 [INFO] /:44673 lost connection

A: For whatever reason, out of all of the operating systems, only Solaris throws that exception when a thread interrupts a connection. A workaround is to change the default behavior on the command line:

java -Xmx1G -Xms32M -XX:-UseVMInterruptibleIO -XX:+UseConcMarkSweepGC \
 -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=$CPU_COUNT -XX:+AggressiveOpts\
 -jar minecraft.jar nogui

This instructs Java to use an interruptible IO stack instead of the default IO that is sensitive to interrupted threads.


Q: When I try to connect to my server this is what it says:

               Connection lost 
 
The server responded with an invalid server key

A: This error is usually caused when the server sends an unrecognized function to the client, which may be caused by using unrecognized server software, unbalanced client / server versions or modifications to the client.


Q: I cannot break/place any blocks!?

A: This is most usually caused by interacting with blocks in a protected area. If you are trying to interact near spawn, most likely it has been protected, by the minecraft server software; either build away from it or get operator status.


Q: My server runs fine but I cannot connect to it!

A: This could be caused by a series of issues. Please post a thread using the template provided above.


Q: How do you give a .jar server more ram?

A: Change the numbers in the server launch command "-Xmx1G -Xms1G". The -Xms part specifies how much memory the server starts with, and the -Xmx part is the maximum amount of memory the server can use. -Xmx1G -Xms2G = 1GB -Xmx2G -Xms1G = 2GB And so on.


Q: How do I play on a LAN without access to the internet?

A: Set up an ad-hoc server—instructions for that are available elsewhere, and vary by your platform. In server.properties, change online-mode to false. Each player that wishes to join must use one of the following:

Windows batch:

@ECHO OFF
java -Xms512M -Xmx1024M -cp "%APPDATA%\.minecraft\bin\*"; ^
-Djava.library.path="%APPDATA%\.minecraft\bin\natives" ^
net.minecraft.client.Minecraft "USERNAME"
PAUSE

Linux Bash (typical):

java -Xmx1024M -Xms512M -cp $HOME/.minecraft/bin/minecraft.jar:\
$HOME/.minecraft/bin/lwjgl.jar:\
$HOME/.minecraft/bin/lwjgl_util.jar:\
$HOME/.minecraft/bin/jinput.jar:\
-Djava.library.path=$HOME/.minecraft/bin/natives \
net.minecraft.client.Minecraft "USERNAME"

Don't be tempted to substitute "~" for "$HOME". It doesn't seem to interpolate as expected.

OS X:

java -Xmx1024M -Xms512M -cp \
$HOME/Library/Application\ Support/minecraft/bin/minecraft.jar:\
$HOME/Library/Application\ Support/minecraft/bin/lwjgl.jar:\
$HOME/Library/Application\ Support/minecraft/bin/lwjgl_util.jar:\
$HOME/Library/Application\ Support/minecraft/bin/jinput.jar:\
-Djava.library.path=\
$HOME/Library/Application\ Support/minecraft/bin/natives \
net.minecraft.client.Minecraft "USERNAME"

Find your local IP, and other clients connect to that. If you run the client on the same computer that is acting as the server, connect to the IP 127.0.0.1 or "localhost".

Note that if you run your server in offline mode, there is no authentication. This means that anyone who can access the server can connect with any username they want—including yours—without needing a password. When they do this, it will disconnect anyone using that same username. Ensure you're on a trusted network with appropriate isolation from the Internet.


Q: Help! How do you find out your server's IP address?

A: Read #Connect to the Minecraft server

Video/Alternative Tutorials

Here are some other tutorials on how to set up a Minecraft server:


Advertisement