Minecraft Blogs / Tutorial

Ubuntu Server Minecraft install/Port Forwarding

  • 5,463 views, 2 today
  • 2
  • 1
  • 7
qtpriest's Avatar qtpriest
Level 37 : Artisan System
12
Things You WIll Need:


1) An already installed version ofubuntuSERVER on a separate computer or a computer running theUbuntuOS desktop version if you plan to run a server on the same computer your playing it on.




2) Your router information. well just login/password for port forwarding




3)keep your local/internal IP noted and handy you will need it and you external ip as well




4) optional but nice i know most people love to have a fancy minecraft server adress ie; myawesomeserver.buildallday.net so if you havent already you may want to go tothis domain sitesimply login and fill it out select your stuff and youre ready to try to connect AFTER setup


5) server computers only! i know its a hassle to have 2 computers always hopping from one to go to the other but there is a simple solution get a remote SSH connector something likePuttythen you will be able to connect to your server from your main computer.




System Requirements:


The system requirements for minecraft is something that can be easily reached on almost any computer but in order to run a minecraft server you may want to make sure your meet these recommended stats.


My computer currently is running a minecraft server its quite small 6-8 people on dedicated server


i get probably 12 on my other computer but its much better so if you want plan to host more then just your friend or a small group of people you will need something better.
  • specs on dedicated server computer
  • CPU: AMD2.20 GHZ Dual core
  • RAM:3GB
  • HDD: 60GB
  • Speed Test: 15MB up 2MB down
  • Video: whatevers on the motherboard
  • supports 4-6 players




  • specs on main machine i run server + minecraft
  • CPU: AMD athlon II x4 3.1GHZ
  • RAM:4GB
  • HDD 1TB
  • speedtest doesnt change much its internet speed
  • Video: Ati Radeon HD 5450
  • supports 8-12 players




Getting Started:




This is a HOW TO MINECRAFTso im assuming you already have the core system installed or a server system already set up and done no further steps. if youre not logged in to your server do it now with the name and password you set up during installation if youre on the desktop version you will want to open your terminal. Follow the next steps in the command line you will want to type
  • sudo apt-get update
  • sudo apt-get install openssh-client
  • sudo apt-get install openssh-server
  • sudo apt-get install screen


What this does is it installs the openssh server so you can remotely connect to and manage your server. this will also install Screen which will hold the minecraft server process. it acts like you have more than one window open but within the server environment you just dont see them they are there though. there are tutorials for shortcuts and commands for screen by searching for it on google if you need more than what i will cover in this tutorial.




Now its time to install java first you can check and see if you have java installed by running the command


java -version


if you dont have java installed youll get an error something like cant find java in selected packages or java command not found.


if you dont have java installed its great that you can get it through apt get. youre going to have to type this


sudo apt-get install default-jdk


when youre done with that you can run java -version and see that its installed java






Installing Minecraft Server(almost there!)


the rest of these commands are done without root priveledges.NEVER! ever! run minecraft as root.




so if youve made it this far this means you have java installed and properly set up the next steps will get minecraftserver.jar on your system. the first step in getting your minecraft server on your system is you will need to create a new directory for it. that can be done by inputting this command.
  • mkdir server (i named it server you can name it whatever you want here)


Run this command to see the directory we just created
  • ls


now the next step is you will ned to get into that new directory that can be done by running
  • cd server (what you decided to name the directory replaces server)


Now THIS is where it gets fun.




within this directory download the minecraft server software. run this command here.


note that this was made with the reccommended build of bukkit version is in the command and the minecraft server version of minecraft.net if you want to get your preferred version or a later version you can do the same by following the command line with wget and the adress of the download. usually found in craft bukkit by going to the downloads section clicking it to make sure its a download and not a link the right clicking the link copying the url then you will paste the url somewhere. once you have the decired url that is what you will paste/type into the command line after wget in proper format
ok now when those files have installed all thats left is to run it and set up your server.

Running the server

USING SCREEN
there is a good site i seen which can be found here or hereit does deserver a read through two different sites about the same thing wish they were one site but meh im not wanting to do that right now.
enter the command
  • screen
that should bring up a prompt and it opens up a second "window" on your server.if youre not in your minecraft directory you can get there by following the steps above to get into your folder. then type these commands

  • ls (it brings up a list of whats in the folder you should have nothing there but your minecraft server install)
  • the pres and hold ctrl+a release and press c. that will open a new window for you to run the minecraft server in
  • Ctrl a c- Creates a newscreensession so that you can use more than onescreensession at once.
  • Ctrl a n- Switches to theextscreensession (if you use more than one).
  • Ctrl a p- Switches to thepreviousscreensession (if you use more than one).
  • Ctrl a d- Detaches ascreensession (without killing the processes in it - they continue).


To close a screen session where all tasks are finished you can type exit
For Bukkit

after doing the above command the file inside your minecraft directory should be named craftbukkit.jar if it isnt then with these next command we will rename it and then start the server with java.

to rename the file run the command
  • mv file.ext new_name.ext
  • java -Xmx1024M -Xms1024M -jar craftbukkit.jar
  • you can change the 1024 to 2048 if your want your server to run with more ram. 2GB from 1 GB pretty much. and now your server started
  • once the server is done loading type stop to stop it if your want or you can try connecting to it if you know how. but if your choose to type stop and from within your server directory type
  • nano server.properties then you can edit your server property file if you wish.
for regular minecraft server

its alot easier to do if you downloaded the server from minecraft.net :). all you have to do is run the server from java by running this command
  • java -Xmx1024M -Xms1024M -jar minecraft_server.jar
  • and that starts the server XD
Port forwarding

good job! all thats left is to let your friends be able to connect. forst off before i say anything about this subject it IS a very touchy one because everyones port forwardig is different but i will try my best to cover the most simplest and best explanation of how to port forward i can. its not hard its tedious also this port forward should work for ANY minecraft server not just for linux servers.


For this step you will need a second computer with access to your router if running just a server application. if youre running desktop you should be fine. lets see if we can do this by steps.
  • locate your routers ip adress usually found on your router next to all the other writings and markings. something like 192.xxx.xxx.x or even something like 10.0.0.1 thats the easiest way of finding it. if its not there and you can not see it on the router then there is some command lines you can do.
for linux open a terminal and type route -nand then you will see it return your network config. the one thats not 0.0.0.0 or 255.255.255 those arent your router ip adresses same goes for windows its the other one.

for windows navigate to start menu run and type in cmd press enter and in cmd type ipconfigthat will bring up your ip numbers across your network there will be one labeled default gateway thats your routers ip adress also depending on your router you may want to write down you computers ID on the network.which is your ipv4 number if you cant find it you can usually see it in your routers menu by navigating to your network and computers connected and finding which one is yours the ip will be there of your computer.
  • open your favorite web browser and enter your routers ip adress into the navigation bar that should take you to your routers interface. some routers may require you to log in before you can see it and every router will have a password you NEED those for the next steps if you do not have the password / username there isnt much you can do from here
  • in your browser ui i have no idea what router youre using but ill do my best to navigat e through it. some routers have a port forward tab you want that, some routers have a DMZ/firewall exceptions tab but no port forward tab or gaming tab , some routers have a gaming tab thats what you want . it is usually located under the firewall options or advanced in some routers get there in some cases there will be an option in DMZ/firewall exceptions to choose your computer you want to let the router know that , that will be the computer you will be running the server on so make sure you have your computer chosen as well.
  • once you get there its just a couple more step youll probably see something that will ask you if you want to add a service / exception or make a user defined definition choose anyone of those options to be lead to a screen that will have a form for you to fill out that will say service,type,start port,end port, or to and from this is what you want to enter.
  • service : minecraft tcp
  • type tcp
  • start port: 25565 or the port of your server minecraft defaults to 25565
  • end port 25565
  • ip adress (not everyone has this) but if you do i covered it earlier in findong your computer ip adress on your network that goes there
  • when thats done hit save and DO NOT EXIT OUT YOURE NOT DONE
  • depending on your router it may have exited out for you some routers will let you do the same keys under one profile so stay there
  • add new service and the instruction are close but not the exact same as above this will finish the port forwarding
  • service minecraft tcp
  • type TCP
  • start 25565
  • end 25565
  • ip adress same as above
  • youre done!
now to check if your port is open start your minecraft server again and find a port checker tool online it should tell you if its open which crsses fingers and hopes it got done right and should be open. Now people can connect to your server.

Thank you for reading pls diamond like subscribe it was fun and a loooong trip. congradulations on your new minecraft server
Tags

4 Update Logs

Update #4 : by qtpriest 11/04/2013 7:30:52 pmNov 4th, 2013

shameless bump
LOAD MORE LOGS

Create an account or sign in to comment.

1
06/02/2013 5:59 pm
Level 5 : Apprentice Miner
Addisoncugini12
Addisoncugini12's Avatar
Doesn't help a single bit........ Also (even though I am a VERY skilled programer and coder) why shouldn't you run minecraft as Root?
1
06/08/2013 7:15 am
Level 37 : Artisan System
qtpriest
qtpriest's Avatar
also if this doesnt help you at all then youre the one messing up. follow this to a T and youll have a server running in no time
1
06/11/2013 8:39 pm
Level 5 : Apprentice Miner
Addisoncugini12
Addisoncugini12's Avatar
Also How do I get into root? :/
1
06/13/2013 12:25 am
Level 37 : Artisan System
qtpriest
qtpriest's Avatar
you can also do bash commands which are the same thing as root and using sudo without needing to type sudo everytime. but i dont reccomend doing that. needing to type sudo everytime is a good thing since the things that need to be put in with sudo can be done the right way and things that dont need it will be ok when needing access to them as a regular user and not sudo. which is why you dont run the commands as root because then only a root user or sudo commands can read write or delete these files
1
06/13/2013 12:23 am
Level 37 : Artisan System
qtpriest
qtpriest's Avatar
lol . u dont really get "into" root. you complete actions as pretty much god mode. there are certain commands u cant do unless you do them either as logged in as a super user or if u dont want to do super user you put "sudo" without quotations before a command. like in the install instructions the commands that have sudo in them are regular commands without the suco but cant be done unless you put sudo in them because you need elevated permissions to use them
1
06/14/2013 7:30 pm
Level 5 : Apprentice Miner
Addisoncugini12
Addisoncugini12's Avatar
sigh..... ok
1
06/08/2013 7:14 am
Level 37 : Artisan System
qtpriest
qtpriest's Avatar
u dont run minecraft as root because if u do then youll not be able to write to any files that need to be written too like plugins or / and other .txt file. if u run it as root then u will need root privs to edit anything there. also its much safer to not run stuff as root as it can mess up your system completely.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome