Running ASP.NET 5 application on Linux

In this article we will get to know how to run ASP.NET 5 application on Linux.

Before getting in to ASP.NET 5 part, let’s get familiarize with below basic commands which will help you on your Linux boxes



 more, less, cat, tail, tail -f

 View the contents of a file

 vi, vim, nano

 Edit a file

 cp, mv

 Copy and move files

 df –h, du -h

 Check disk space utilization

 ls, ls -ltr

 List files

 uptime, w, top

 Check system uptime

 sudo su

 Gain super-user privilieges

 ps , ps –l

 Process listing


 Look at process open files and ports

 ip addr show / ifconfig

 Verify network adapter configuration


 Network information


 Help on a command

 ip route, route, netstat –r

 View Routing Table        

 netstat -rn, route -n

 Default Gateway

 iptables --list

 View Firewall rules

 ip -s link show eth0 , netstat -s

 Network Statistics


Folder structure in Linux and its explanation

 Folder Structure



 Root Directory where everything is located under this and similar to C:\ in Windows.


 Contains system specific binaries and executables.


 Contains files required to boot your machine.


 Contains files which is used by hardware.


 Contains configuration files for your programs.


 Contains a home directory for each user.


 Contains shared libraries.


 Contains recovered files


 Home folder for root.


 Contains folders for media attached like CDs,USBs.


 Contains programs which is run by root.


 Contains kernel and process files.


 Contains temporary files stored by application.


 Contains application and files by users which are read only


 Variable data writable directory.


Steps to get ASP.NET 5 on Ubuntu

  • Install DNVM
  • Install DNX
  • Install Libuv
  • Install git
  • Download ASP.NET Sample
  • Run dnx web

Installing .NET Version Manager(DNVM)

  • Install and unzip curl if you have not installed:

 sudo apt-get install unzip curl

  • Download and install DNVM:

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

 Once you run above command you should be able to run dnvm commands like “dnvm list”.

Installing .NET Execution Environment (DNX) for .NET Core

  • Install DNX Pre-requisites:

 sudo apt-get install libunwind8 gettext libssl-dev libcurl4-openssl-dev zlib1g libicu-dev uuid-dev

  • Install DNX for .NET Core using DNVM:

 dnvm upgrade -r coreclr


Installing Libuv

Libuv is a multi-platform asynchronous IO library that is used by Kestrel, a cross-platform HTTP server for hosting ASP.NET 5 web applications.

To build Libuv run the below commands one after the other:

 sudo apt-get install make automake libtool curl

 curl -sSL | sudo tar zxfv - -C /usr/local/src

 cd /usr/local/src/libuv-1.4.2

 sudo sh

 sudo ./configure

 sudo make

 sudo make install

 sudo rm -rf /usr/local/src/libuv-1.4.2 && cd ~/

 sudo ldconfig

Make sure is there under /usr/local/lib after you run above commands.

For now, we have .NET core setup and below steps will help you to download sample ASP.NET 5 application from Git


Install Git

Run below command to install git:

 sudo apt-get install git


Download ASP.NET 5 Sample from Git

Run the below command to clone ASP.NET 5 application from git:

 sudo git clone

Run DNX Command

Navigate to the directory where the application is installed and in my above example it would have installed 3 applications “ConsoleApp”, “HelloMvc” and “HelloWeb”.

Run below command to execute the “ConsoleApp” application:

 dnu restore


 dnx run


Note: In case you run into an issue where you get error as:

 Restore failed

 Access to the path ‘/home/<user>/Home/Sample/…/ConsoleApp/project.locl.json’ is denied.

when you run “dnu restore” command then you need to check the permission on the application directory level. In my case I ran into this issue and ran below command at application directory level to give full permission.

 sudo chmod 777 <foldername>