Editing
Tutorials/Setting up a server
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Configuring the environment == === Writing a script to launch the server === It's definitely boring to have to remember the command-line options for your server every time you launch it. Luckily, we can write it down in a file and just run that instead. ==== On Windows ==== The windows version of a script is called a batch file. Create a text file in the folder where you put the jar as "start.bat", and then right click it to edit using notepad. Paste the following in: <syntaxhighlight lang="bat"> @ECHO OFF java -Xms1024M -Xmx2048M -jar minecraft_server.jar --nogui pause </syntaxhighlight> Double click the file to start your server. You may get a "Class_Not_Found" and ServerGuiConcole error, just ignore these errors and you should see your "Server Thread/INFO" dialog start the server. The "pause" command is there to keep the window open so you can read what happened after the server stops. ==== On macOS, Linux, and FreeBSD ==== All these systems use a common scripting language called the "POSIX shell script" on the command line. Create a text file in the folder where you put the jar as "start.sh" and write the following in: <syntaxhighlight lang="sh"> #!/bin/sh cd "$(dirname "$0")" exec java -Xms1G -Xmx1G -jar server.jar --nogui </syntaxhighlight> Now save the file. Run {{code|chmod a+x start.sh}} (or path to wherever you put the script) to make it executable. You can now run the file by double-clicking or by running {{code|./start.sh}} in the folder (or using a whole path from outside there). If you want to add a pausing part like the Windows example, remove the {{code|exec}} word, and add a line of {{code|read -n 1 -p "Waiting..."}} to the end. This is useful if you are running the script by double-clicking on the GUI. ==== On Plan 9 ==== (I don't use Plan 9, so I have absolutely no idea how to use the rc, psh, acme, snarf magic. Someone please add it.) === Startup and maintenance script === Alternatively, you can manage/automate the startup and shutdown of the ''Minecraft'' server using a script such as the ones listed below: * [https://minecraftservercontrol.github.io/docs/mscs Minecraft Server Control Script (MSCS)] is a server-management script for UNIX and Linux powered ''Minecraft'' servers. Features include: ** Run multiple ''Minecraft'' worlds. ** Start, stop, and restart single or multiple worlds. ** Create, delete, disable, and enable worlds. ** Includes support for additional server types: Forge, BungeeCord, SpigotMC, etc. ** Automatically backup worlds, remove backups older than X days, and restart worlds. ** Visit the [https://minecraftservercontrol.github.io/docs/mscs Minecraft Server Control Script Github page] for more information. * [http://msmhq.com/ Minecraft Server Manager] A comprehensive startup script for ''Minecraft'' and Bukkit servers (support Debian, such as Ubuntu). ** MSM can also periodically create [http://wiki.sk89q.com/wiki/WorldEdit/Snapshots World Edit compatible] backups. ** Keeps players informed with configurable in-game messages, such as "Shutting down in 10 seconds!" ** Expose in-game commands (such as "say", "op" and "whitelist") to the terminal. ** Tab completion on all commands makes learning easy. ** Visit [http://msmhq.com/ Minecraft Server Manager's GitHub page] for the full list of features. * [[Tutorials/Server startup script|Server startup script]] * [[Tutorials/FreeBSD startup script|FreeBSD startup script]] * [[Tutorials/OpenBSD startup script|OpenBSD startup script]] * [[Tutorials/Ubuntu startup script|Ubuntu startup script]] * [https://github.com/Thue/rfwadmin rfwadmin] startup script with web interface (for Linux servers). Nice web interface for quickly saving and loading maps. * [https://teilgedanken.de/Blog/post/8/ Minecraft Systemd Service] A fully systemd-integrated ''Minecraft'' service: ** Working on CentOS and Fedora ** Protecting the server with various readonly and inaccessible jails ** Safe restart and stop operations using rcon ** Can be combined with a [https://teilgedanken.de/Blog/post/9/ Minecraft Command Center Script] for ease of administration * [https://wiki.archlinux.org/index.php/Minecraft#Java_Edition_Server Arch Linux systemd wrapper] === Port forwarding === {{see also|Wikipedia:Port forwarding}} Port forwarding is used when you have a router and you wish to let users connect to your server through it. If you wish to host your server for local reasons, it is not required that you do so. ''Keep in mind that port forwarding might cause security risks''. '''When port forwarding, it varies on how your router will ask you for the information. If you don't understand on how your router wants you to input the information, try visiting [http://portforward.com/ PortForward.com] for a tutorial.''' Once you have managed to locate your router's admin page, and find the Port Forwarding page; hit add new service ''(may not work)'' (if you use Belkin, this can be very difficult to perform) 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". If "TCP/UDP" or "Both" isn't an option you will have to create two rules for both protocols. 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. To find your computer's IP address, use the following steps: ;{{OS|Win}} Windows : Press {{key|Win+R}}; this should be up to the "Run" dialog box. Type {{kbd|cmd}} and hit {{key|Enter}}. This should open a command window with a black background. From there, type {{kbd|ipconfig}} and press {{key|Enter}}. You should be given a list of text. Scroll up to "Wireless LAN" (if using wireless) or "Ethernet" (if using a wired connection), and look at "IPv4 address". To the right of this should be a string of numbers (of the form xxx.xxx.xxx.xxx). Copy this down by right-clicking the window and selecting "Mark", then highlight the area and hit Enter. ''Don't copy any parentheses or letters''. [[File:Ip-address-mac-610x206.jpg|thumb|The IP location on OS X]] ;{{OS|Mac}}Mac : 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. ;{{OS|Linux}}Linux :Either you use the network diagnose center (depending on distribution), or the terminal with <code>ifconfig</code>. The output should return all your interfaces. Search for <code>inet addr:xxx.xxx.xxx.xxx</code>, copy the xxx.xxx.xxx.xxx numbers down. :Once you have this IP, enter it in the "Output IP / Server IP" or whatever 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 [http://www.ipchicken.com/ IP Chicken]. If you don't want to use such IPs, use DynDNS services such as [http://no-ip.com NoIP DynDNS] Now it is time to [[#Configuring the Minecraft server|configure and connect]]. === Setting up a VPN === {{msgbox |title=Note |text=VPN's can cause issues connecting to Mojang's servers, ''Minecraft'' servers, or to the internet. |bgcol=#FCC |linecol=#FAA }}{{disclaimer|section}} An alternate way to set up a server between you and your friends is to set up a VPN (virtual private network). This method may be deemed unrecommended, and an inconvenience for many users due to the fact that all users who wish to connect to the server must download external software in order to join or create server. An alternative to this method is to [[Tutorials/Setting up a server#Port forwarding|port forward]]. A free software utility that can be used to set up a VPN is [https://secure.logmein.com/products/hamachi/download.aspx Hamachi] by LogMeIn. [https://openvpn.net/ OpenVPN] is another (free, open source) alternative that supports most OSes, but is a bit more difficult to configure. Free [http://www.radmin-vpn.com/ Radmin VPN] is another software with no need to register on the website and no limits per the number of users. The free version of Hamachi allows up to 5 connections (i.e. players). ==== Setting up Hamachi ==== # Install Hamachi on each computer that wishes to participate in the server, including the host.<br> [https://www.vpn.net/ Windows / Mac]<br> [https://www.vpn.net/linux Linux] (32-bit and 64-bit <code>.deb</code> and <code>.rpm</code> packages are available, you can install it on Gentoo by emerging "net-misc/logmein-hamachi") # The host server signs up for admin via the [https://www.vpn.net/ Logmein website]. # On the host machine, a new Hamachi network is created. # The host installs and configures the ''Minecraft'' server software:<br> The server IP field in server.properties is left blank (as default). # The host passes the newly created Hamachi network credentials to each of the players. # The players connect to the host's Hamachi network. # Now that all the machines are connected within the same Hamachi network, the host gives their machine's Hamachi IPv4 address to the players. # Each player connects using this IP as per the usual ''Minecraft'' multiplayer screen. #'''Note that Hamachi has been squatting on an IANA-allocated IP block (25.0.0.0/8). As such, Hamachi fundamentally conflicts with the internet itself.''' ==== Setting up Radmin VPN ==== It is very similar to Hamachi installation. # Download free and install [http://www.radmin-vpn.com/ Radmin VPN] # Create a network: after Radmin VPN installation on the local computer press "Create network" button. Set a Network name and a Password β> Press "Create" button. # Now the new network will appear in the main window β> invite friends, send them the info to connect -> you are welcome to run ''Minecraft''. # Connection: after program launch press βJoin network" β> in the dialog box press enter Network name and Password received from the network administrator β> "Join" β> the new network and its nodes will be shown in the main window. β> Connect to the host in ''Minecraft''. *If the connection on Radmin VPN has been established, but you don`t see other players in the game, then it is required to adjust firewall for work of the game or just turn the firewall off. === Configuring the Minecraft server === #Configure the server by editing the [[server.properties]] file, the format for which is [[server.properties#Minecraft server properties|explained here]]. Be certain to edit the file with a text editor that does not add formatting (e.g., for italics), such as [[wikipedia:Microsoft Notepad|Windows Notepad]]. Additional configuration may not be necessary as many servers run fine from the default values. # To become or add an operator ([[op]]), type {{cmd|op ?}} into the server console or gui. This adds the specified user's username and [[wikipedia:UUID|UUID]] to the <code>ops.json</code> file. Operator status will not be changed if you change your username due to the use of UUID. #* Administrators and operators may execute [[commands]]. In other words, operator ([[op]]) privileges allow you to control certain aspects of the game (e.g., teleporting players). #* ops.json contents:<syntaxhighlight lang="json"> [ { "uuid": "", "name": "", "level": 4, "bypassesPlayerLimit": false } ]</syntaxhighlight> #If your [[server.properties]] is configured to enable whitelist, you can add a user to the <code>whitelist.json</code> by typing {{cmd|whitelist add <''player''>}} into the server console or gui. Due to the transition to the UUID system, it is not recommended to directly edit <code>whitelist.json</code>.
Summary:
Please note that all contributions to Kiiw may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Kiiw:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information