If you’re a fan of Windows based web application, then you’re going to love that the latest version of ASP.Net, which is ASP.NET 5, codenamed ASP.NET v5 can now be developed and hosted in three major platforms, Windows, Linux and Macs. If you haven’t started using ASP.NET v5, then this is the good time to begin using it. It’s a fun language to play, and you’ll expand your programming skills too! Now with that in mind, we’ll start installing ASP.Net on your Linux machine!
Before everything, I suggest you update Linux to the latest version to make sure everything can work seamlessly and there are minimal bugs. On Ubuntu, you can use the following commands:
sudo apt-get update
sudo apt-get upgrade
Installing ASP.Net on Ubuntu
These steps also apply on the same derivatives as well as the parent, Debian. For the reference, the OS these commands were used is on Ubuntu 14.04. The very first step we’ll do is to install the DNVM, the .Net Version Manager.
- If you already don’t have unzip or curl installed yet, you’re going to want to install them first. Use the following commands to install them:
sudo apt-get install unzip curl
- Now, download and install DNVM using the following command:
curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh
- Once it’s done, you can try running dnvm to see some help text.
- Now, we’re going to install the .Net Execution Environment (DNX). We’re going to install the DNX prerequisites using the following command:
sudo apt-get install libunwind8 gettext libssl-dev libcurl4-openssl-dev zlib1g libicu-dev uuid-dev
- Now, using the DNVM we installed earlier, we are going to install DNX for the .NET core:
dnvm upgrade -r coreclr
- If you want to install DNX for Mono, you’ll have to install Mono using the following command:
Then, after installation, use the following command:
- Now, we can install DNX for Mono using DNVM:
dnvm upgrade -r mono
- Now, we are going to install libuv. What is Libuv? It’s a cross platform asynchronous library, used by Kestrel and is a HTTP server for hosting ASP.NET 5 web applications. You need to build libuv using the following:
sudo apt-get install make automake libtool curl
curl -sSL https://github.com/libuv/libuv/archive/v1.4.2.tar.gz | sudo tar zxfv - -C /usr/local/src
sudo sh autogen.sh
sudo make install
sudo rm -rf /usr/local/src/libuv-1.4.2 && cd ~/
And that’s it! You now have a fully installed and running ASP.Net on your Linux machine!