Over a million developers have joined DZone.

How to Create Your First .NET Program on Red Hat Enterprise Linux

DZone's Guide to

How to Create Your First .NET Program on Red Hat Enterprise Linux

Learn how to use Vagrant to develop for .NET core on Red Hat Linux and create your first .NET program on RHEL in just 6 steps.

· Integration Zone ·
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

Sometimes, things are really easy. This is one of those cases. There are only six steps to creating and running your first .NET program on Red Hat Enterprise Linux (RHEL).

Install dotnet

What’s that? You don’t have RHEL installed on your Windows PC in a Virtual Machine (VM)? That’s okay… I’ll wait while you install it. Just follow this video to download and install the Red Hat Development Suite.

OK, now that you have a VM, open PowerShell and run vagrant up to start the VM. When that’s all finished (it'll just take a few minutes), run vagrant ssh to SSH into the VM.

Now that you’re at the RHEL command line, simply following the six steps in this video to install .NET Core on your VM.

Create a Directory

  • VM up and running: Check.

  • SSH’d into your VM: Check.

  • .NET Core installed: Check.

Create a directory for your Hello World! program using the command mkdir hw.

Move Into Directory

Use the command cd hw.

dotnet new

Use the command dotnet new.

(If that doesn’t work, it’s probably because you have a newer version of .NET Core. In that case, try dotnet new con.)

dotnet restore

Use the command dotnet restore. This pulls the required dependencies from NuGet.org.

dotnet run

Finally, run the program using dotnet run.


Congratulations! You created your first .NET Core program on Linux. If you want to do more, start experimenting with the command  dotnet –help.

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

dotnet ,integration ,rhel ,tutorial ,vagrant ,.net

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}