One of the primary goals of the ASP.Net 5 (codenamed vNext) project is cross platform development, and it’s become easier than ever to develop ASP.Net applications on Linux and OSX. Today we’re going to take a look at how to do this with Ubuntu Linux server.
1. Get Your System Ready
Let’s get our system started. For this tutorial I’m using a Digital Ocean droplet. These are only $5 per month, and if you click this link to sign up you’ll get a $10 credit.
I installed a blank Ubuntu 14.04 64 bit server. First, run the following:
This will make sure we have the newest package lists and upgrade packages if they are available.
Next we’ll need to install Mono. The current stable version for Ubuntu is 3.2.8, which won’t run ASP.Net, so we will have to pull it directly from the Mono repositories:
1 2 3 4
To make sure it installed correctly, type in
Next, we’ll install some prerequisites that we’ll need to fetch and build some items from source:
Also, to run web services we’ll need to install libuv. We’ll have to build it from source and link it:
1 2 3 4 5 6 7 8
Now our system should be ready for ASP.Net 5.
2. Set up ASP.Net 5
Now that we’ve got that set up, let’s put ASP.Net 5 on here. First we’ll install KVM:
Note: if you want to go real bleeding edge, you can install DNVM instead, shich is the replacement for KVM:
Now, let’s install DNX (the .Net execution environment)
If you downloaded DNVM above instead, run:
3. Clone an ASP.Net Sample
Now we’ll clone the sample repositories:
1 2 3 4
This is the sample we’ll choose to build. Type in the following to build the packages for it:
Now we can start it up:
You should see a screen that looks like this:
Congrats! You now have ASP.Net 5 running on Ubuntu Linux!
If you would like to run this as a background process, type in
Note that this should not yet be used for production servers!
I have found several articles online about how to do this, but many of them seemed innaccurate, missing peices or out of date. This is common with bleeding edge stuff. I’ll try to update this as much as possible.
This is a good way to set up cheap instances of ASP.Net for your projects. At only $5 a month you could have several application servers running for your project for very little. As I stated before you can get a $10 credit from Digital Ocean by using this link to sign up, or you can use some of the other low cost Linux hosts out there to set up some low cost, fast ASP.Net 5 servers.