I'm running several ASP.NET 5 application on multiple Ubuntu Debian machines already. Some options are not necessary, but I've included them because you will need them later on.
For the installation I will use a fresh copy of Ubuntu 14.04 x32 Debian 8.1 x64
Note: I'd recommend using x64 because .NET coreclr just supports x64 at the moment
0. Since most of our commands require root permission, we will switch to sudo bash
First we need to install a few dependencies:
Optional, but I highly recommend installing the Node Package Manager.
apt-get install npm
Optional, but most people use Git as their version control software nowadays. Including Microsoft.
apt-get install git
(More or less optional) This is an open source software platform, sponsored by Xamarin, that allows us to use .NET on cross platform devices. Many things are still missing in .NET Core so you might want to target mono instead. Atleast until all you needed features gets included into .NET Core.
If you target the coreclr you don't need mono. See Mono Installation Docs.
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
apt-get install Mono-Complete
4. DNX Prerequisites
.NET Core needs following packets (Mono doesn't need them btw):
apt-get install libunwind8 gettext libssl-dev libcurl3-dev zlib1g libicu-dev
The (development) web server Kestrel is based on libuv. [Comparison: WebListener is a wrapper around HTTP.sys]
apt-get install automake libtool curl
curl -sSL https://github.com/libuv/libuv/archive/v1.4.2.tar.gz | tar zxfv - -C /usr/local/src
rm -rf /usr/local/src/libuv-1.4.2 && cd ~/
Unzip (Is needed to unzip runtimes for DNVM):
apt-get install unzip
The .NET Version Manager is a command line tool to configure and setting up (different) runtimes.
curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh
7. Node.js + Build-Essential
Optional: This comes handy in combination with bower and grunt. It's required for the yeoman generators.
curl -sL https://deb.nodesource.com/setup | bash -
apt-get install -y nodejs
apt-get install -y build-essential
Now we need to fix/install a few things:
1. Fix NuGet Feeds:
<?xml version="1.0" encoding="utf-8"?>
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v2/" />
<add key="nuget.org" value="https://www.nuget.org/api/v3/" />
(Save with CTRL+O and Exit with CTRL+X)
2. Update DNVM + Upgrade DNX Runtime (You may need apt-get install unzip):
dnvm install latest
Caution: If you want the latest feed use the unstable paramater -u (dnvm update-self -u or dnvm install latest -u)!
If you want to install the coreclr use the parameter -r coreclr
If you want a specific or older version use this for example:
dnvm install 1.0.0.-beta8
3. Updating NPM:
npm install -g npm@latest
npm cache clean
4. Yeoman Generators:
npm install -g yo grunt-cli generator-aspnet bower
If you have STILL an outdated Node.js version do this and RESTART your terminal
npm cache clean -f
npm install -g n
Basicly we are done! For a small test we are going to create a project:
0. You could download an example instead: https://github.com/aspnet/Home/tree/dev/samples/1.0.0-beta8/HelloMvc
1. Call the ASP.NET Generator:
2. Select Web Application:
2. After creation, change into its folder:
3. Restore NuGet pakets:
4. Run kestrel:
Update: If you are at beta1-6 use 'dnx . kestrel' (with a dot) instead
If you want to run kestrel in the background:
nohup dnx kestrel > /dev/null 2>&1 &
... done (go to http://localhost:5001 or http://localhost:5004 - whatever is stated in your project.json)