ASP.NET MVC application on Linux? Easy!

As you may know, Microsoft recently released a lot of their products under MIT license. .NET Core runtime, .NET CoreFX, ASP.NET 5, MVC 6, Entity Framework 7, MSBuild, everything is now available on GitHub.


Our goal is: run Asp.Net MVC application with postgresql database on ubuntu server

Today we are gonna start with setting up .NET environment.

In the new stack you can choose between full .NET runtime and .NET Core. For now .NET Core has a lot of limitations, so we gonna use mono.

Install mono

As described in official documentation:

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

Install .NET Version Manager (DNVM)

First we need to install .NET Version Manager

We use the .NET Version Manager to install different versions of the .NET Execution Environment (DNX) (used by the ASP.NET 5 runtime) and switch between them.

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

Install the .NET Execution Environment (DNX)

kvm upgrade

This command will download the specified version of the DNX, and put it on your user profile ready to use. You are now ready to start using ASP.NET 5 with the DNX!

Compile and install libuv

sudo apt-get install gyp
tar -xvf libuv-v1.4.2.tar.gz
./ -f make -Duv_library=shared_library
make -C out
sudo cp out/Debug/ /usr/lib/
sudo ln -s /usr/lib// /usr/lib/

Run ASP.NET MVC example

Clone home repository:

git clone

Go to sample:

cd Home/samples/HelloMVC

Restore all required packages with:

kpm restore

Now you can run your MVC application

k kestrel

Go to and see the result.

In next part we are gonna install PostgreSQL with NHibernate and add web api methods to our application.

Next Part: "[vNext] Use PostgreSQL + Fluent NHibernate from ASP.NET 5 (DNX) on Ubuntu"