Using Unity Asset Server on Amazon’s EC2

I recently set up Unity Asset Server (a version control repository server with a client built into Unity Pro) on Amazon’s EC2 — “a web service that provides resizable compute capacity in the cloud.” There were a few gotcha’s along the way so here’s a quick start guide for anyone else who wants to do the same. Most of what I cover here is also included in Amazon and Unity’s documentation but there are two “gotchas” that stumped me for a while which are solved in steps 7 and 9 below.

I decided to go with EC2 for a few reasons. First: you pay for your hourly usage (most other VPS will charge you a flat rate per month starting at around $20). Second: Amazon has pretty robust and flexible features that allow you to easily scale. Third: the first year is free for new customers, so there was no reason not to try it out.

The other services that I evaluated were:

1. Getting started

First of all you’ll need to have an Asset Server client license, it is a $500 add-on license to Unity Pro.

Next you’ll need to sign up for an Amazon Web Services account. This will require a valid credit card. If you are already an Amazon.com customer you can use the same login credentials.

2. Creating your EC2 Server

Once your AWS account is set up, you need to create your EC2 instance. Start by selecting the EC2 tab. Choose a region for your instance to be hosted in (Singapore, US East Coast, US West Coast) and then select Launch Instance.

3. Choose an AMI

You’ll then be presented with a list of different machine images. Choose Basic 32-bit Amazon AMI. This is both compatible with the version of Unity Asset Server that you are going to install and it supports the free Micro Instance.

3. Instance Details

3.1. Instance Type

Select the Micro Instance Type. It is also a good idea to make sure Termination Protection is selected.

3.2. Advanced Instance Options

Leave the Kernel and RAM IDs set to Default. Make sure Monitoring is not selected since that service isn’t free.

3.3. Tags

Create a Key called “Name” and set it to a value of your choosing. I’ve chosen to name my instance “UnityAssetServer“.

4. Create Key Pair

Choose to Create a new Key Pair. I named mine “UnityAssetServerKeyPair”. Download this file to your harddrive. If you’re on OS X, and you want to make things easier for you later on, you can save this file to your user directory (the one with a little house icon in finder).

5. Configure Firewall

Just select default for now.

6. Instance Setup Review

The instance is almost ready to launch, just double check everything one last time.

7. Configure Security Groups

This one is important — if you don’t do this step you will not be able to SSH into your shell to install Unity Asset Server, nor will you be able to connect to the asset server.

7.1. Unity Asset Server TCP Ports

  • In the yellow box, select “other” in the Connection Method dropdown.
  • For Protocol select tcp.
  • If you want to use the default port for Unity Asset Server (doesn’t require you to specify the port within Unity) enter 10733 for both the From Port and To Port.
  • Source (IP or group) should be set to 0.0.0.0/0
  • Save

7.2. SSH TCP Ports

  • In the yellow box, select “SSH” in the Connection Method dropdown.
  • For Protocol select tcp.
  • Enter 22 for both the From Port and To Port.
  • Source (IP or group) should be set to 0.0.0.0/0
  • Save

8. Elastic IPs

Now you want to Allocate and Associate an Elastic IP to your instance, this will allow you to enter just the IP address in Unity and not the long cumbersome AWS URL. It is important to note that this is a free service as long as the IP is associated with an instance. They don’t want you grabbing a lot of IP addresses and not using them.

9. SSH into Your EC2 Instance

If you go to Instance, and select your instance and then select Instance Actions, Connect you will see some instructions about how to ssh into you server.

Note, the command line text that they issue you is wrong.

ssh -i UnityAssetServerKeyPair.pem root@ec2-50-18-63-144.us-west-1.compute.amazonaws.com

should read

ssh -i UnityAssetServerKeyPair.pem ec2-user@ec2-50-18-63-144.us-west-1.compute.amazonaws.com

Of course your string will be different, the important thing to note is that root should actually read ec2-user. This one stumped me for some time!

So, if you’re running OS X, simply open up Terminal and type your corrected line in and hit enter. If you are running windows, you’ll need to download an SSH client such as Putty. If you set up an Elastic IP you should be able to use that instead of the full AWS url as well (everything after the @ mark). Also, if you didn’t save your key pair to your user directory, or if you are on windows, you’ll need to specify the filepath for your .pem key pair file.

10. Installing Unity Asset Server on Your Server

Now that you are logged into your EC2 instance via SSH you are ready to follow along with the Unity Asset Server installation instructions. Specifically we’ll be installing the Linux i386 rpm package. Here are the instructions as of today but note that if a new version of Asset Server is released you would want to reference the installation instructions for the file path of the latest release.

Run the following command on the server:

sudo rpm -Uvh http://download.unity3d.com/asset_server/unity_asset_server-2.0.1.i386.rpm

If this is a new installation, you will also have to supply an initial password for the admin user:

sudo /opt/unity_asset_server/bin/reset_admin_password

When prompted, please supply a new password for the admin user.

You should now be able to fire up Unity and use it to create projects and users on the newly installed Asset Server.

11. Configuring Unity Asset Server in Unity

From here on out you can read the Unity Asset Server Guide to figure out how to set up new projects, users, etc. It is pretty self explanatory and most people should be able to figure out it without even looking at the manual.

11.1 Quick Launch Cheat Sheet

  • Launch Unity
  • Open Unity Asset Server (Window/Asset Server)
  • Select Connection
  • For Server,
    • If you used the default port when setting up the security you can just type in your Elastic IP address. Ex: 50.18.63.144
    • If you specified a port other than the default 10733, lets say 10700, you’d need to enter the server like this: 50.18.63.144:10700
  • Initially log in with admin and the same password you set in the installation process with the “sudo” command.
  • Create a new User Name and Password for you and also create User Names and Passwords for your collaborators.
This entry was posted in Game Dev, Tutorial, Unity. Bookmark the permalink.

25 Responses to Using Unity Asset Server on Amazon’s EC2

  1. Dreamora says:

    Very interesting write up 🙂

    One point where I would like to hear more about is your conclusion that it is cheaper once you are out of free, when you have to pay the instance, traffic and the database that holds your project, as all these 3 things cost money on their own especially with 24/7 usage as I would consider it common for a VCS setup

  2. lion says:

    Thanks for the comment Dreamora!

    Well, the nice thing about EC2 is that you pay in hour blocks (as opposed to other services where you pay in 1 month blocks, regardless of your usage). The way I figure it, if my free year goes by, and no one’s prices have changed, I could sign up for a reserved micro instance, which even if I never turned it off would come to under $10 per month. Data transfer is $1.5 per 10 GB, $2.5 if you consider in and out. If you have a large team this could get a bit crazy but the price get cheaper per GB the more GB you use. The storage is nearly free at $1 per 10 GB-month. For my uses I don’t think EC2 would end up any more expensive than the cheapest of the other VPS which come in at around $20 per month.

  3. Boson says:

    Thanks for such a detailed writeup!

    Currently I’m trying to decide between setting up my own home server or paying for a cloud based server to host Unity Assets.

    I’m still tempted to go with the home server solution, if only because it seems much simpler.

    Since you have some experience with this, I’ll throw some questions your way. 🙂

    What happens when I want to move my data away from Amazon? Is Amazon speedy enough to host many GBs of art assets that have to be updated daily?

    And most importantly – Is Amazon safe enough to be our only asset server, with no other backups other than the local files on our machines? We are only a 3 person team right now, but I want to be sure all our data is as safe as can be in case our local machines go bad.

  4. lion says:

    If all of your teammates are working at your home, then I’d go with your own server since you’d have the fastest file transfers that way. If your team is remote and you plan on them transferring files over your cable modem then you’d be much better off going with Amazon’s servers. They are really fast and the only bottle neck is going to be your own internet connection. At any rate, you can set up the Amazon one for free and test it out for a month and see how it works for you.

    If you want to move your data away you can just set up an asset server project on another server and commit your project. Or you can SSH into Amazon and copy your database and transfer it to another server using unix commands or an ssh client.

    I think it will be plenty safe, I don’t know for sure but I assume they have redundancy built in. Also you have local copies of your data on all of your teams’ machines.

  5. lion says:

    By the way, I want to point out that Dreamhost is a pretty great deal, their VPS is $15 a month, and that comes with unlimited data storage, unlimited bandwidth, and great web hosting too. When my one free year with Amazon EC2 is up I may upgrade my $9 a month Dreamhost web hosting plan to a VPS.

  6. snowzer says:

    Thanks for the excellent write up! One question: What happens when you “stop” your EC2 instance? Does the data persist? Or did you have to set something else up to store/back-up your asset server data? Thanks!

  7. lion says:

    Good question. I don’t know the exact answer off the top of my head, and I’m too busy packing for my move to Vietnam to research it completely right now, but I think what you would do is have a mounted Elastic Block Storage that your instance uses. An EBS persists independently of an instance being on or off. To learn more try these links:

    http://aws.amazon.com/ebs/

    http://aws.amazon.com/ec2/faqs/#What_happens_to_my_data_when_a_system_terminates

    http://aws.amazon.com/ec2/faqs/#What_is_the_difference_between_using_the_local_instance_store_and_Amazon_Elastic_Block_storage_for_the_root_device

    http://support.rightscale.com/06-FAQs/FAQ_0149_-_What's_the_difference_between_Terminating_and_Stopping_an_EC2_Instance%3F

  8. samim says:

    excellent post, saved me hours of try and fail.
    the only part that seems to be new on the amazon side is the security groups gui which looks slightly different then your screenshoots/description now. Toke me a while but got it working in the end. Free AssetServer hosting rocks 😉

  9. Kjetil says:

    Samim, I just tried to install this as well. And I wonder if you could let me know what you did different in the setups. I did manage to create an instance at the and, and the installation of the asset server worked fine. However I’m not allowed to log into the server from within unity.
    It just times out, which makes me wonder if I setup something wrong in the security groups.

  10. Ilya Suzdalnitski says:

    Thanks a lot for sharing this awesome guide with us!

    I did some research and was able to encrypt the connection with an SSH-tunnel. Here’s how:
    1. If on Mac, open terminal (located in Applications/Utilities) and type in the following command: [CODE]ssh -L 10700:localhost:10733 -f ec2-user@[your_server_ip] -N -i UnityAssetServerKeyPair.pem[/CODE]
    Replace [your_server_ip] with the ip of your server hosted at Amazon.

    2. Open Asset Server in unity and type in the following server details (without quotes): Server: “localhost:10700”

    Hope this can help someone!

  11. Nitheesh says:

    Can i change the Data storage location

  12. lion says:

    Hmm, I don’t know. I assume you can launch various elastic block storages to copy and or store the data on. There may be other options too. I’m pretty sure you can find the answer to your question in their documentation.

  13. Rob Sandbach says:

    Great right up, we actually used this exact tutorial when we originally setup our asset server hosting service.

    Thank you for your advice and if you have any difficulties with asset server hosting, please feel free to give us a try 🙂

    Rob

  14. lion says:

    Thanks Rob, your service looks interesting. I don’t see any pricing information on your site though. Mind to share?

  15. lion says:

    update:

    My 1 year is up and I’ve received my first bill. It cost usd $8.69 for the computational resources (I left the instance on the entire time). There was no charge for the bandwidth usage since I haven’t actually been actively developing that project. I think my original estimate of it not exceeding $20 a month is probably still good. Now I just need to decide if I should kill this thing since I’m not using it, or get back to developing that project with a remote team.

  16. Andrei Nadin says:

    Just did this – fantastic find – seems to be working great!

  17. It’s December 2013, and I am thankful for this post.

    I’ve been developing my project on Unity, but when the teamwork made its entrance, there was no choice but to use an Asset Server. This tutorial helped me to built my own and we are good now.

    Thanks a lot!

  18. lion says:

    I’m thankful that this post is still providing value three years on 🙂

  19. zach says:

    SWEET! post. screenshots are a little dated, but you explained everything so well, I just found what you were talking about, and WHAM! got it all done in less than 10 minutes! seriously awesome info, thank you for sharing!

  20. Ryan says:

    Make that three and a half years. I echo what the last commenter said… despite some dated shots of the EC2 interface, I was able to figure everything out based on this info and get things up and running with a quickness!

    I ran into a scary little warning while in Terminal about an “UNPROTECTED PRIVATE KEY FILE!” but this guide helped me solve that right away. Wanted to put that here in case anyone else reads this guide and runs into the same problem!

  21. Richard Aronson says:

    Thank you for the excellent write-up.

    We have a team of nearly 20 developers using Unity. How many users are on your team? I’m worried that pricing might skyrocket as team and project size increases.

    Do you think we could also install a Git based solution on the same Amazon server? Some things are better stored on Git than Asset Server.

  22. lion says:

    Richard:

    The cost should be predictable, but you could always look for a hosting plan that has unlimited data for a fixed price if you’re really worried. Most game assets (code, 3D meshes) aren’t very big. If data transfer does start to become an issue maybe your team can come up with rules about how often to sync to the project, and how large texture files can be, etc.

    The Amazon servers are Linux virtual machines so yes, you can run Git there too.

  23. Great write up.

    For August 2014, I was able to get running on Amazon using: amzn-ami-pv-2014.03.2.x86_64-ebs (ami-7c807d14). I opted for PV given it is a bit faster than HPV.

    One caveat since the Amazon Linux are 64-bit is to use yum to install. The complete command-line prompt is: sudo yum --nogpgcheck -v install http://download.unity3d.com/asset_server/unity_asset_s
    erver-2.0.1.i386.rpm

    Otherwise, the rest of the instructions worked great. I ignored the numeric IP, and instead just set up ANAME record for one of my domains so I can access with a stable URL name.

  24. Scott says:

    Annnd always read the comments- Ward’s fix worked like gangbusters 🙂

  25. Kruegbert says:

    Thanks for this tutorial! Of course the interface has changes a lot, but still it was straightforward – with the help of Ward W. Vuillemot solution (for the Amazon 64 Bit servers)

Leave a Reply

Your email address will not be published. Required fields are marked *