Programming Blog

Jeremy Morgan

Mostly Coherent Ramblings of a Silicon Forest Software Developer

How to Install ASP.Net 5 on Ubuntu Linux

Author: Jeremy Morgan

C# Newsletter

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:

sudo apt-get update&&sudo apt-get dist-upgrade

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:

sudo apt-key adv --keyserver --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-complete

To make sure it installed correctly, type in

mono -V

Next, we’ll install some prerequisites that we’ll need to fetch and build some items from source:

sudo apt-get install -y autoconf build-essential git-core libtool unzip curl

Also, to run web services we’ll need to install libuv. We’ll have to build it from source and link it:

cd /opt
sudo git clone
cd libuv
sudo ./
sudo ./configure
sudo make
sudo make install
sudo ln -s /usr/local/lib/ /usr/lib/

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:

curl -sSL | sh && source ~/.k/kvm/

Note: if you want to go real bleeding edge, you can install DNVM instead, shich is the replacement for KVM:

curl -sSL | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/

Now, let’s install DNX (the .Net execution environment)

kvm upgrade

If you downloaded DNVM above instead, run:

dnvm upgrade

3. Clone an ASP.Net Sample

Now we’ll clone the sample repositories:

mkdir ~/aspnet
cd ~/aspnet
git clone
cd ~/aspnet/Home/samples/HelloMvc

This is the sample we’ll choose to build. Type in the following to build the packages for it:

kpm restore

Now we can start it up:

k kestrel

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

nohup k kestrel &

Note that this should not yet be used for production servers!

C# Newsletter


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.