and give them a payment method. There is no fixed charge for EC2 servers: you pay for what you use.
Notes:
Or, you can pay up front for a 'Reserved instance' which works out way cheaper.
2. Navigate to the Amazon EC2 tab. This may take a minute or two to become active if you've just signed up. You will see that you have no instances, and the page will prompt you to Launch Instance.
3. Hit the Launch Instance button to see a list of the possible server types. We're going to choose the Quick Start option
Basic 32-bit Amazon Linux AMI 1.0
, which is probably the first one on the list.
Notes:
1. We use 32bit as it's cheaper than 64bit. 2. This image uses EBS, which is independent storage. The alternative is 'Instance Store' which is less flexible.
4. Now it's Instance Details. Keep the defaults: we want 1 instance, with no zone preference, and the 'Small' memory type. Just hit Continue here.
Notes:
If you have a small player base (say <10 players), Micro (which gives 613MB memory) is an option. If you choose Micro, remember to configure Minecraft to use less max memory: 512MB rather than 1024.
Update:
Unfortunately, Micro instances have some pretty crazy CPU throttling, so you'll have to jump through some hoops - read the rest of the thread for more on this.
5. Advanced Instance Options. The only thing you might want to check here is CloudWatch Monitoring. This gives you nice graphs of your CPU and memory usage, but costs extra :smile.gif: (1.5c per hour, or about $11 per month). You probably don't need it. Hit Continue.
6. Next is 'tags' for your instance. You can ignore this for now, we only have one server to worry about. Hit Continue.
7. Key Pairs. Create a new Key Pair. Give it any name (e.g. 'myamazonkey'). Now, download the key file to your computer. It should have the extension
.pem
, e.g.
myamazonkey.pem
. This is what you'll use to log in later. Hit Continue.
Notes:
This is important, because EC2 servers
do not use passwords to log in
. Instead you have a 'private key file' stored on your local computer, which is used to authenticate.
8. Security Groups. This is your firewall policy - we will need to open a Minecraft port. Unfortunately Amazon does not let you enter a custom rule yet. We can name the policy itself though, so call it
minecraft-security
, accept the default rules (SSH access only on port 22) and Continue.
9. Review your settings and Launch the instance. You should now see '1 Running Instance' in the Dashboard. For now, we're going to add a firewall rule.
10. Click Security Groups on the left panel. Edit our group (minecraft-security) and add: Method 'Custom', Protocol 'TCP', Port 25565, Source '0.0.0.0/0'.
Notes:
If you want a non-default port, make sure and set it here! The 'Source' just means anyone on the internet can see this open port (which is fine).
11. Now just hit Instances in the left panel to see your server listed - congratulations, you just created a server! Click on it to get details in the lower pane. Observe your new public hostname, listed as
Public DNS
. It will look like
ec2-123-456-789-123.compute-1.amazonaws.com
.
Notes:
To connect to this hostname
in Minecraft
you need to convert it into an IP number: try a service like
1. Open PuttyGen. We're going to convert the private key that Amazon gave us (.pem) into a Putty key (.ppk). Hit Load, select the .pem key (you might need to see 'All Files' in the dialog), and then hit 'Save private key' to save it as a .ppk file.
2. Open Putty - we're going to configure a new Session. In the Host Name, enter
3. Next look in SSH -> Auth. Use the Browse button to select your new .ppk file.
4. Now back to the Session tab - give your session a name in the 'Saved Sessions' text area (e.g. 'EC2 minecraft') and hit Save.
5. Finally hit Open to try and connect. Putty will automatically try to log in as ec2-user (because you put the user prefix on the URL). Then it will present the key file which means no password is needed. You should be in!
Notes:
If the automatic login doesn't work for some reason just enter your username as
ec2-user
.
At this point you have everything you need - a working server and shell access.
What now?
You should be logged into the ec2-user home directory, with 10GB to play with. Personally I just installed all the Minecraft stuff here.
To verify java is working, try java -version.
There are other great guides to tell you how to install Minecraft itself:
- A great shell script that helps with start, stop, backups, parsing logs and generating map images: http://www.minecraftforum.net/viewtopic.php?f=10&t=40202 - note, you will need to 'sudo yum install screen' to make this work.
Very nice. I played around with it and got to the shell. One correction, where you said
3. Next look in SSL -> Auth. Use the Browse button to select your new .ppk file.
That should read "SSH -> Auth" in putty, or it does on my screen.
Also putty didn't automatically try to login as ec2-user, it just gave me the login prompt - I had to enter ec2-user, but got right in after that. I'm not sure if I did something wrong, but that was my experience.
Thanks, I'll play around with it. Do you have a server running? What costs are you experiencing? If it's just a few bucks a month, it could be fun to play with - but if it runs up a 40-50$ /month bill, then it was fun to try, but not a long term solution...
I will update as costs become more clear - I've been running for a few days and my bill is around $7, so it seems quite likely to end up in the $50-100 range per month.
Update: Micro worked out about $16 per month, on demand running 24/7.
Cool, keep updating us on the price. Any game server on a CDN can mean anyone in the world could connect to your server. Think about that for a sec... I'm waiting for minecraft to come out with a server sort list by latency so we can see who comes up front.
Either way it goes, good job. I'm really surprised someone tried it and it was hard to believe your post when I saw it! lol
Rollback Post to RevisionRollBack
Minecraft Addicts - Longest running server with the highest recorded up time.
Huge thanks to A1r for setting up a fabulous guide. Not being familiar with Linux, I was able to set up a Minecraft server last night with no problems whatsoever.
That said, I'm not so sure about the service. I feel like I may be getting nickle and dimed by Amazon. After only one day, on top of the flat $0.085/hour charge, I've already paid $0.03 for bandwidth usage, $0.01 for using a PUT, COPY, POST, LIST or command, $0.02 for I/O requests, and $0.03 for get requests. I'm wondering how this is going to stack up after a month.
I did a cost estimate of EC2 a while back, even for minimal usage you will definitely be looking at about $70-80 at the end of the month.
I suggest looking at Linode instead; $40/mth will get you 1 gig of RAM, 32 gigs disk, 400 gigs transfer. This is enough for a single server, if you shut off unnecessary processes and don't mind using some swap.
I'm running a small Alpha server on the $20/mth plan (which I have used for a couple years for my MUDs). I have enough unused RAM to comfortably run the server with a 256M max alloc, and so far it's been fine.
I'm running a small Alpha server on the $20/mth plan (which I have used for a couple years for my MUDs). I have enough unused RAM to comfortably run the server with a 256M max alloc, and so far it's been fine.
How many users do you have connecting? I'm surprised it works well with so little memory.
I'm running a small Alpha server on the $20/mth plan (which I have used for a couple years for my MUDs). I have enough unused RAM to comfortably run the server with a 256M max alloc, and so far it's been fine.
How many users do you have connecting? I'm surprised it works well with so little memory.
Right now only 2, and it's running fine, uses 100-200 megs of RAM.
In theory the RAM usage should be based on actual chunks loaded - 10 players spread out throughout the world may would use far more memory than 10 players packed in tight, for example.
Update: after looking at my GC logs, it seems I am not using anywhere near the memory I have allocated. If like me you only have 2-4 players max, your server is probably only using 100-300MB heap.
(You can check memory usage by adding -XX:+PrintGCDetails to your java command at startup.)
Hence I downgraded my server from SMALL (1.7GB memory) to MICRO (613MB), which was amazingly easy. MICRO is half the price of SMALL, maybe less.
I signed up for EC2 but when I navigate to the Amazon EC2 tab, it "Looks like I don't have an EC2 account" however I signed up for one 6 hours ago. If i click "sign up for Amazon EC2" it tells me I am signed up and can start using it :tongue.gif:
Looking forward to how this service works out, lucky me i'm the first one to hit a snag in this process it seams. I'm going to contact amazon support if its not fixed in the morning.
I would love to see more comments on what plan you went with, your player base, and how things are going.
EDIT:
So i got it working! few questions... can anyone point me to a good command reference for... bash? i think...? also it seems if I close my putty session, the server shuts down... any way to run the server as a service? I basically just need to be pointed to some good reading material to figure this out. Im not sure on the terminology of what to look up :tongue.gif:
The script will launch Minecraft in a detached 'screen' session which survives your logout.
If the Minecraft console is in the foreground (for example if you used DISPLAY=1 in the script) then remember to hit Ctrl-A followed by 'd' to detach and put it back in the background.
Yep got that script! It has helped me immensely although I am still working on getting c10t working, though thats for another thread!
So a bit about EC2, and my experience, my solutions, and me wondering if there is a better way (If I need to learn something to do it, I will learn).
Firstly, my player base (people at my university) are all in the same time zone, so at night I turn off the server to save costs. Every restart causes my external IP to change so I gave everyone a dyndns host name and then I update that IP manually every time it restarts. I could probably get an automatic updater for that... but thats low priority at the moment. Is there a better way?
Secondly, once every two weeks we all get together and play. I found it was too much for the mini server so I moved it up to a small server. The way I did it was by creating a zip archive of the server, moving it off, terminating, starting a new server, loading, decompressing and I'm done. Is there a better way? I read your changing from a small to mini server, but did not understand it sadly. Does that retain data? Is switching the server type something I can do often? (like say twice a week) without issue? During the week I barely cap over 4 users. On the weekend I hit maybe 16...
One thing I would love is something like a wake on lan feature... I have another web server, and I would love If i could have my users click a button to turn on the server, and then the server could turn itself off after Xtime inactive.... again to mitigate some of the cost. A 24/7 available server without being on 24/7.
Changing your server size (Small -> Micro -> Small) does not affect your EBS storage. So after downgrading I just booted the new instance and all my /minecraft stuff was still there. So yes, it's retained, no rezipping needed.
Rather than change size maybe you could have two instances (Micro and Small) attached to the same EBS volume. And just have one running at a time (i.e. the other Stopped).
The web GUI gives you very basic functions only. If you want to do more clever stuff (like starting server on demand), you're probably going to have to get the command line tools I mentioned above and try running them. It means executing commands on your home PC/Mac to control your EC2 stuff. Step 3 above is something you type in on the Windows command line, for example.
This is an easy way to get a Minecraft multiplayer instance up and running 24 hours a day without having to worry about the physical server.
You will need some basic Linux/Unix ability for this guide.
Facts
- The basic server we'll use has 1.7GB memory
- You get 10GB disk on Elastic Block Storage (EBS)
- The OS is 'Amazon Linux' (their own distro)
- Comes with Java 6 ready to go
Steps: Creating a server
This is really straightforward.
1. Sign up for an account at
and give them a payment method. There is no fixed charge for EC2 servers: you pay for what you use.
Notes:
Or, you can pay up front for a 'Reserved instance' which works out way cheaper.
2. Navigate to the Amazon EC2 tab. This may take a minute or two to become active if you've just signed up. You will see that you have no instances, and the page will prompt you to Launch Instance.
3. Hit the Launch Instance button to see a list of the possible server types. We're going to choose the Quick Start option
, which is probably the first one on the list.
Notes:
1. We use 32bit as it's cheaper than 64bit. 2. This image uses EBS, which is independent storage. The alternative is 'Instance Store' which is less flexible.
4. Now it's Instance Details. Keep the defaults: we want 1 instance, with no zone preference, and the 'Small' memory type. Just hit Continue here.
Notes:
If you have a small player base (say <10 players), Micro (which gives 613MB memory) is an option. If you choose Micro, remember to configure Minecraft to use less max memory: 512MB rather than 1024.
Unfortunately, Micro instances have some pretty crazy CPU throttling, so you'll have to jump through some hoops - read the rest of the thread for more on this.
5. Advanced Instance Options. The only thing you might want to check here is CloudWatch Monitoring. This gives you nice graphs of your CPU and memory usage, but costs extra :smile.gif: (1.5c per hour, or about $11 per month). You probably don't need it. Hit Continue.
6. Next is 'tags' for your instance. You can ignore this for now, we only have one server to worry about. Hit Continue.
7. Key Pairs. Create a new Key Pair. Give it any name (e.g. 'myamazonkey'). Now, download the key file to your computer. It should have the extension
, e.g.
. This is what you'll use to log in later. Hit Continue.
Notes:
This is important, because EC2 servers
. Instead you have a 'private key file' stored on your local computer, which is used to authenticate.
8. Security Groups. This is your firewall policy - we will need to open a Minecraft port. Unfortunately Amazon does not let you enter a custom rule yet. We can name the policy itself though, so call it
, accept the default rules (SSH access only on port 22) and Continue.
9. Review your settings and Launch the instance. You should now see '1 Running Instance' in the Dashboard. For now, we're going to add a firewall rule.
10. Click Security Groups on the left panel. Edit our group (minecraft-security) and add: Method 'Custom', Protocol 'TCP', Port 25565, Source '0.0.0.0/0'.
Notes:
If you want a non-default port, make sure and set it here! The 'Source' just means anyone on the internet can see this open port (which is fine).
11. Now just hit Instances in the left panel to see your server listed - congratulations, you just created a server! Click on it to get details in the lower pane. Observe your new public hostname, listed as
. It will look like
.
Notes:
To connect to this hostname
you need to convert it into an IP number: try a service like
to find this. Amazon tells you the 'Private IP Address' but this isn't visible to the outside world.
Steps: Logging in
I'm going to assume you're using PuTTY on Windows - http://www.chiark.greenend.org.uk/~sgtatham/putty/
1. Open PuttyGen. We're going to convert the private key that Amazon gave us (.pem) into a Putty key (.ppk). Hit Load, select the .pem key (you might need to see 'All Files' in the dialog), and then hit 'Save private key' to save it as a .ppk file.
2. Open Putty - we're going to configure a new Session. In the Host Name, enter
. e.g. [email protected]
3. Next look in SSH -> Auth. Use the Browse button to select your new .ppk file.
4. Now back to the Session tab - give your session a name in the 'Saved Sessions' text area (e.g. 'EC2 minecraft') and hit Save.
5. Finally hit Open to try and connect. Putty will automatically try to log in as ec2-user (because you put the user prefix on the URL). Then it will present the key file which means no password is needed. You should be in!
Notes:
If the automatic login doesn't work for some reason just enter your username as
.
At this point you have everything you need - a working server and shell access.
What now?
You should be logged into the ec2-user home directory, with 10GB to play with. Personally I just installed all the Minecraft stuff here.
To verify java is working, try java -version.
There are other great guides to tell you how to install Minecraft itself:
- Absolute basics on getting Minecraft running:
- A great shell script that helps with start, stop, backups, parsing logs and generating map images: http://www.minecraftforum.net/viewtopic.php?f=10&t=40202 - note, you will need to 'sudo yum install screen' to make this work.
- The server mod I use is hey0's: http://www.minecraftforum.net/viewtopic.php?f=1012&t=23340 - note, this is no longer supported I think
Miscellaneous
- You never log in as root, always
. If you need to run something as root, prefix the command with 'sudo'. e.g.
to install the 'screen' utility.
3. Next look in SSL -> Auth. Use the Browse button to select your new .ppk file.
That should read "SSH -> Auth" in putty, or it does on my screen.
Also putty didn't automatically try to login as ec2-user, it just gave me the login prompt - I had to enter ec2-user, but got right in after that. I'm not sure if I did something wrong, but that was my experience.
Thanks, I'll play around with it. Do you have a server running? What costs are you experiencing? If it's just a few bucks a month, it could be fun to play with - but if it runs up a 40-50$ /month bill, then it was fun to try, but not a long term solution...
I had a SQL server doing major bandwidth, I scaled up 5 more on EC2. $750 for 1 week was enough for me but that was a different story.
Check out my Let's Play Series:
I will update as costs become more clear - I've been running for a few days and my bill is around $7, so it seems quite likely to end up in the $50-100 range per month.
Update: Micro worked out about $16 per month, on demand running 24/7.
Either way it goes, good job. I'm really surprised someone tried it and it was hard to believe your post when I saw it! lol
That said, I'm not so sure about the service. I feel like I may be getting nickle and dimed by Amazon. After only one day, on top of the flat $0.085/hour charge, I've already paid $0.03 for bandwidth usage, $0.01 for using a PUT, COPY, POST, LIST or command, $0.02 for I/O requests, and $0.03 for get requests. I'm wondering how this is going to stack up after a month.
I suggest looking at Linode instead; $40/mth will get you 1 gig of RAM, 32 gigs disk, 400 gigs transfer. This is enough for a single server, if you shut off unnecessary processes and don't mind using some swap.
I'm running a small Alpha server on the $20/mth plan (which I have used for a couple years for my MUDs). I have enough unused RAM to comfortably run the server with a 256M max alloc, and so far it's been fine.
How many users do you have connecting? I'm surprised it works well with so little memory.
Right now only 2, and it's running fine, uses 100-200 megs of RAM.
In theory the RAM usage should be based on actual chunks loaded - 10 players spread out throughout the world may would use far more memory than 10 players packed in tight, for example.
(You can check memory usage by adding -XX:+PrintGCDetails to your java command at startup.)
Hence I downgraded my server from SMALL (1.7GB memory) to MICRO (613MB), which was amazingly easy. MICRO is half the price of SMALL, maybe less.
How to downgrade an EC2 server
1. Get the Amazon command line tools installed and working - http://developer.amazonwebservices.com/ ... rnalID=351
2. Stop your instance. Stop, do NOT Terminate. Terminate will delete your storage!
3. Modify the instance type:
ec2-modify-instance-attribute -C cert-ABCD1234blahblah.pem -K pk-ABCD1234blahblah.pem <instance-id> -t t1.micro
4. Start the instance. Note the new public hostname! This means an IP change as well.
5. Change your Minecraft to use say 512MB max heap.
I wouldn't have had the guts to try what you did. Awesome.
Looking forward to how this service works out, lucky me i'm the first one to hit a snag in this process it seams. I'm going to contact amazon support if its not fixed in the morning.
I would love to see more comments on what plan you went with, your player base, and how things are going.
EDIT:
So i got it working! few questions... can anyone point me to a good command reference for... bash? i think...? also it seems if I close my putty session, the server shuts down... any way to run the server as a service? I basically just need to be pointed to some good reading material to figure this out. Im not sure on the terminology of what to look up :tongue.gif:
[ec2-user@domU-12-31-39-0F-7C-25 ~]$ screen
-bash: screen: command not found
[ec2-user@domU-12-31-39-0F-7C-25 ~]$
viewtopic.php?f=10&t=40202
The script will launch Minecraft in a detached 'screen' session which survives your logout.
If the Minecraft console is in the foreground (for example if you used DISPLAY=1 in the script) then remember to hit Ctrl-A followed by 'd' to detach and put it back in the background.
So a bit about EC2, and my experience, my solutions, and me wondering if there is a better way (If I need to learn something to do it, I will learn).
Firstly, my player base (people at my university) are all in the same time zone, so at night I turn off the server to save costs. Every restart causes my external IP to change so I gave everyone a dyndns host name and then I update that IP manually every time it restarts. I could probably get an automatic updater for that... but thats low priority at the moment. Is there a better way?
Secondly, once every two weeks we all get together and play. I found it was too much for the mini server so I moved it up to a small server. The way I did it was by creating a zip archive of the server, moving it off, terminating, starting a new server, loading, decompressing and I'm done. Is there a better way? I read your changing from a small to mini server, but did not understand it sadly. Does that retain data? Is switching the server type something I can do often? (like say twice a week) without issue? During the week I barely cap over 4 users. On the weekend I hit maybe 16...
One thing I would love is something like a wake on lan feature... I have another web server, and I would love If i could have my users click a button to turn on the server, and then the server could turn itself off after Xtime inactive.... again to mitigate some of the cost. A 24/7 available server without being on 24/7.
Back to my research! Thank you all for your help!
Rather than change size maybe you could have two instances (Micro and Small) attached to the same EBS volume. And just have one running at a time (i.e. the other Stopped).
The web GUI gives you very basic functions only. If you want to do more clever stuff (like starting server on demand), you're probably going to have to get the command line tools I mentioned above and try running them. It means executing commands on your home PC/Mac to control your EC2 stuff. Step 3 above is something you type in on the Windows command line, for example.
http://techcrunch.com/2010/10/21/aws-free-amazon/