Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

My Guide at: Setting up a VPS for Minecraft on Ubuntu

#1 User is offline

  • Group: Members
  • Posts: 440
  • Joined: 26-November 10

Posted 14 January 2011 - 01:38 AM

VPS Server Setup Guide

By: Dewaffler
Welcome to my attempt at a VPS setup guide! I haven't done a lot of guides before, so bare with me, and let's begin!

Hello class! Today we will learn how to setup a Minecraft server on a VPS.

Things you'll need:
Putty (SSH client)
Download: http://www.chiark.greenend.org.uk/~sgta ... nload.html

WinSCP (File transfer)
Download: http://www.winscp.net

A VPS w/ Ubuntu or other Linux distros
Download: Yeah, you can't download a VPS. Try the Seeking and Offering forums



This should be all you need for now. Let's get started!

First, log into your VPS with Putty.
Username: root
Password: YourRootPassword

First, you'll want to install Java. As root, enter:
sudo apt-get install sun-java6-jre


If that works, continue with installation. If you get “E:Couldn't find package sun-java6-jre” follow the steps bellow:

You'll need to edit the sources.list file, so enter this:

vi  /etc/apt/sources.list

This will take you to the vi Ubuntu editor. To get started, use arrow keys to move down to a new line. Press “I” to start editing. Move down to your new line, and paste these sources:
(Paste in PuTTy with right-click)
deb http://us.archive.ubuntu.com/ubuntu/ maverick-backports restricted main multiverse universe
deb http://archive.canonical.com/ lucid partner
deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse
deb-src http://archive.canonical.com/ubuntu lucid partner


To save, press “:” and type “wq” press enter.

Now type:

sudo apt-get update

It will update the sources you just added, it will take a few minutes , so be patient. After this is done, type:
sudo apt-get install sun-java6-jre


You should now be able to install Java. To select “Ok” just press Tab and then press enter.

Java will take a while to install, but after it's done we can get to the Minecraft stuff.




So, you should now have Java installed correctly. To test type
java -version

If it says “java is an unknown command” either you or I have done something wrong.

If it does work, continue on.

Before we install Minecraft, we are going to need a new user. Running a Minecraft server on root is a bad idea, so ssssssstop it!

To make a new user:
sudo adduser UserName

It will then prompt you for information, and automatically setup the rest of it.


Finally, we will need to download the Minecraft server software.

Before you do this though, make sure you create a new Minecraft directory.
If you are still in /root do this:
cd /
cd home
cd UserName
mkdir Minecraft
cd Minecraft


In Putty type
wget http://www.minecraft.net/download/minecraft_server.jar
This will download the file you need.

You need to edit the permissions of the file so it is executable. Type:
chmod 777 minecraft_server.jar


You should now be able to run it. For the first run, just type
java -Xms1024M -Xmx1024M -jar minecraft_server.jar

After it says “Done loading”, type “stop”
Here is where WinSCP comes in. Log into your server and navigate to the Minecraft directory.
Click on your server.properties file.
Change this file to suit your needs, and make sure server-port=25565 (If this is the port you want to use)

Alternative: You can also do this directly in PuTTy, just type
vi server.properties


Your server should now be ready for players! To start with the ability to close PuTTy and keep your server up, type “screen” and then run
 java -Xms1024M -Xmx1024M -jar minecraft_server.jar


To run your server, and then close PuTTy, we need a package called "Screen"
sudo apt-get install screen


This will install Screen for your use. To first use it, just type "screen" and it should start a new session that will stick even when you quit Putty, just type in the command to start the server after typing screen.
After closing PuTTy, to get back on the screen type
screen -r


A way to increase server performance is to run the server command with some extra commands and such.
java -server -Xmx1024M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=2 -XX:+AggressiveOpts -jar minecraft_server.jar nogui


Your server should run happily ever after, or not. If it hasn't leave a reply below and I will try and help you with the problem.
This is my first guide, and I probably didn't do the best on it. Feedback is appreciated :Turquoise:
Also, if you notice I missed something, PM or reply and I will fix it.
Steam ID(s)
phaseout
doom3pwns817 (AKA TF-Phaseout)
My server's YouTube channel http://www.youtube.com/user/WaffleSMP
Need help with your server? Feel free to PM me!
0

Register or log in to remove.

#2 User is offline

  • Group: Members
  • Posts: 241
  • Joined: 06-November 10

Posted 03 February 2011 - 07:33 PM

Thanks for all your help. I am having a little problem though. I get to, "To save, press “:” and type “wq” press enter." After pasting

deb http://us.archive.ubuntu.com/ubuntu/ maverick-backports restricted main multiverse universe
deb http://archive.canonical.com/ lucid partner
deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse
deb-src http://archive.canonical.com/ubuntu lucid partner


Am I supposed to type I again after pasting? Am I supposed to go to a new line? When I type that nothing happens.

Thanks.
Im Doing a lets play! Here it is: http://www.youtube.c...h?v=z7pQ1M-IJyg Give me some feedback!
0

#3 User is offline

  • Group: Members
  • Posts: 440
  • Joined: 26-November 10

Posted 03 February 2011 - 08:50 PM

After pasting, you don't have to add anything else. Just press escape key to stop editing, and then press :
It should give you a place to type, just put "wq" and press enter
Steam ID(s)
phaseout
doom3pwns817 (AKA TF-Phaseout)
My server's YouTube channel http://www.youtube.com/user/WaffleSMP
Need help with your server? Feel free to PM me!
0

#4 User is offline

  • Group: Members
  • Posts: 241
  • Joined: 06-November 10

Posted 03 February 2011 - 09:15 PM

Quote

After pasting, you don't have to add anything else. Just press escape key to stop editing, and then press :
It should give you a place to type, just put "wq" and press enter


Ah thanks I wasnt pressing escape. Now im stuck at the "ok" at the java install screen. I press tab, but nothing happens. Im on a mac.
Im Doing a lets play! Here it is: http://www.youtube.c...h?v=z7pQ1M-IJyg Give me some feedback!
0

#5 User is offline

  • Group: Members
  • Posts: 440
  • Joined: 26-November 10

Posted 04 February 2011 - 01:00 AM

I keep forgetting minor details, sorry. Press TAB so it selects OK, and then press Enter.
Steam ID(s)
phaseout
doom3pwns817 (AKA TF-Phaseout)
My server's YouTube channel http://www.youtube.com/user/WaffleSMP
Need help with your server? Feel free to PM me!
0

#6 User is offline

  • Group: Members
  • Posts: 3
  • Joined: 21-January 11

Posted 04 February 2011 - 02:17 AM

Couple things:

-- Screen doesn't come preinstalled on Ubu stock distros
sudo apt-get install screen


It's also worth mentioning some basic screen usage, ie, how to get back to your attached session:
screen -r


-- It's a lot easier to edit server.properties with nano or any other bash text editor. CTRL + O, ENTER, to output your edited file:
nano server.properties


-- Put a password on your user a la:
passwd userName


-- Most VPS' have pretty baller CPUs that share the cloud load, but tend to not get used all that much -- beef up your server with some extra jazz!
java -server -Xmx1024M -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=2 -XX:+AggressiveOpts -jar minecraft_server.jar nogui


-- Odds are good that the VPS doesn't necessarily have a lot of RAM -- VPS ram tends to be expensive! Log into your hosting service and partition a larger SWAP.

-- It's a good idea to make most of your commands into shell scripts, so that you can save time entering them:
nano SCRIPT.sh
chmod +x SCRIPT.sh
./SCRIPT.sh


-- If you want to download a world using WinSCP, it's a good idea to compress it first to make the transfer faster:
zip -r world.zip world/

Posted Image
0

#7 User is offline

  • Group: Members
  • Posts: 440
  • Joined: 26-November 10

Posted 04 February 2011 - 08:54 PM

Thanks, geistanon. I suppose I should have been more in-depth. Would you mind if I added these to my guide?
Steam ID(s)
phaseout
doom3pwns817 (AKA TF-Phaseout)
My server's YouTube channel http://www.youtube.com/user/WaffleSMP
Need help with your server? Feel free to PM me!
0

#8 User is offline

  • Group: Members
  • Posts: 3
  • Joined: 21-January 11

Posted 05 February 2011 - 03:21 AM

Have at it mate!
Posted Image
0

#9 User is offline

  • Group: Members
  • Posts: 440
  • Joined: 26-November 10

Posted 05 February 2011 - 04:33 AM

Thanks,

New: added improved setup commands, thanks to geistanon
Steam ID(s)
phaseout
doom3pwns817 (AKA TF-Phaseout)
My server's YouTube channel http://www.youtube.com/user/WaffleSMP
Need help with your server? Feel free to PM me!
0

#10 User is offline

  • Group: Members
  • Posts: 369
  • Joined: 16-October 10

Posted 05 February 2011 - 02:55 PM

Couple of questions:

geistanon said:

-- If you want to download a world using WinSCP, it's a good idea to compress it first to make the transfer faster:
zip -r world/ world


- How do you unzip the world file?

- And is it possible to download the Hey0 (Unofficial Build 134) server instead of the normal minecraft_jar?

- If the above is possible can I also send my users.txt, plugins, etc.?

Quote

Before you do this though, make sure you create a new Minecraft directory.
If you are still in /root do this:


- If you are still in root? But we created a new account already.

A lot of questions, I'm a bit new to Ubuntu ;)
0

#11 User is offline

  • Group: Members
  • Posts: 440
  • Joined: 26-November 10

Posted 05 February 2011 - 03:43 PM

To first question,

Just use unzip command,
unzip World
World can be whatever you saved it as

Next question --- Yeah, just transfer the .jar file from Hey0 and run the command for the name of the .jar and it should be good.

Next--- You can just use WinSCP and put it in the folder.

Last--- When you make a new user I wasn't sure if you logged into it or not.
Steam ID(s)
phaseout
doom3pwns817 (AKA TF-Phaseout)
My server's YouTube channel http://www.youtube.com/user/WaffleSMP
Need help with your server? Feel free to PM me!
0

#12 User is offline

  • Group: Members
  • Posts: 369
  • Joined: 16-October 10

Posted 11 February 2011 - 08:16 AM

Prodfk hosts his server, then by the next day the server cannot be connected. It says:

Failed to Connect to server: Connection Refused

Which happens when the server is not up..

Why doesn't it go 24/7?
0

#13 User is offline

  • Group: Members
  • Posts: 440
  • Joined: 26-November 10

Posted 11 February 2011 - 03:34 PM

You have to run the screen command before you start the server. And sometimes Bukkit will crash so you have to restart the minecraft server
Steam ID(s)
phaseout
doom3pwns817 (AKA TF-Phaseout)
My server's YouTube channel http://www.youtube.com/user/WaffleSMP
Need help with your server? Feel free to PM me!
0

#14 User is offline

  • Group: Members
  • Posts: 151
  • Joined: 24-October 10

Posted 16 February 2011 - 06:12 PM

Thanks for this topic, perfect tutorial !
Posted Image
0

#15 User is offline

  • Group: Members
  • Posts: 440
  • Joined: 26-November 10

Posted 16 February 2011 - 10:03 PM

Thanks for the compliment!
Steam ID(s)
phaseout
doom3pwns817 (AKA TF-Phaseout)
My server's YouTube channel http://www.youtube.com/user/WaffleSMP
Need help with your server? Feel free to PM me!
0

#16 User is offline

  • Group: Members
  • Posts: 12
  • Joined: 28-December 10
  • Location: Orlando, FL

Posted 21 April 2011 - 03:29 AM

Hello. I have a VPN running Ubuntu 10.4 for Minecraft. Everything works fine, except I can't connect to it via WinSCP or FileZilla or anything of the like, but I can connect with PuTTY just fine. Any ideas?
Posted Image
0

#17 User is offline

  • rch
  • Minecraft.cm
  • Group: Approved Host
  • Posts: 4104
  • Joined: 17-November 10
  • Location: Florida
  • Minecraft: rch

Posted 21 April 2011 - 05:06 AM

Make sure you're connecting using the SFTP protocol, port 22 - not the FTP protocol, port 21.
0

#18 User is offline

  • Group: Members
  • Posts: 12
  • Joined: 28-December 10
  • Location: Orlando, FL

Posted 21 April 2011 - 05:17 AM

rch said:

Make sure you're connecting using the SFTP protocol, port 22 - not the FTP protocol, port 21.


If I do it via that method the error I get is-

"Cannot initialize SFTP protocol. Is the host running a SFTP server?"

Although at one point it said something about the packets being too large or something...? Please help.
Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users