How to install .NET Core on Windows, Linux, and macOS

Today, I want to walk you through the process of installing .NET Core on these three platforms.

Emma White
5 min readFeb 19, 2021

If you are a software engineer serious about cross-platform development, chances are pretty good you will, at some point, work with .NET Core. After all, the primary purpose of .NET Core is to enable developers to create .NET applications for nearly any operating system.

So instead of having to hire developers to take care of Windows, macOS, Android, iOS, Linux, and server applications, a single developer (or team of .NET developers, such as those from BairesDev) could work with one framework to meet your needs.

That’s what .NET Core does.

And .NET Core offers plenty of outstanding features, such as:

  • A world-class IDE (Visual Studio Core)
  • Support for microservices.
  • Modular, lightweight, flexible, and scalable.

All while being open source and free of charge.

.NET Core uses the C# language, which is one of the most versatile on the market. So if you’re looking to develop cross-platform apps, and get up to speed quickly, you need .NET Core.

It should come as no surprise that a development tool geared toward cross-platform applications is available on the three most popular operating systems — Linux, macOS, and Windows.

And so, I want to walk you through the process of installing .NET Core on these three platforms. Let’s get this installed.

Installing .NET Core on Windows

Because the installation of .NET Core is easiest on Windows, we’ll start here. As we’re going to install .NET Core 3.1, you need to know that it’s only supported on Windows 10 (versions 2004, 1909, 1903, and 1809).

To install .NET Core on a supported version of Windows, you’ll need to first install the .NET Core Runtime. To successfully install the .NET Core, first download and install the runtime. The process of installing this package is the same as any other on Windows. Simply walk through the user-friendly GUI installer to complete the steps.

With the runtime installed, you’ll then need to install the .NET Core SDK. Download and run the .NET Core SDK installer. The installation of the SDK is very similar to the .NET Core installation.

With both components installed, verify it by opening the Windows command prompt tool and issuing the command:

dotnet — info

You should see the versions of both the runtime environment and the SDK listed (Figure 1).

Figure 1

Both .NET Core and the .NET Core SDK have been successfully installed.

Installing .NET Core on macOS

Installing .NET Core on macOS is just as easy as it is on Windows, so .NET developers just need to download and install the .NET Core SDK (which will include the .NET Core runtime). Open the .NET Core downloads page, click on the macOS tab, and then click to download the .NET Core SDK.

When the .pkg file finishes downloading, click on the file (from within your Downloads directory) and then walk through the user-friendly installer (Figure 2).

Figure 2

Installing .NET Core SDK on macOS Catalina.

And that’s all there is to installing .NET Core and the .NET Core SDK on macOS.

Installing .NET Core on Linux

This is where it gets a bit complicated because the installation will depend on the distribution of Linux you use. I’m going to walk you through the steps for installing .NET Core on Ubuntu, Fedora, and OpenSUSE.

If you’re using Ubuntu, you’ll need to be running a Long Term Support (LTS) release, such as 18.04 or 20.04, as .NET Core won’t install on non-LTS releases. If you’re using Fedora, you must have version 32 or newer. For openSUSE, the only supported release is 15.

Ubuntu

First, we’ll install the .NET Core SDK on Ubuntu (which will also install the .NET Core runtime). To do this log into your desktop and open a terminal window. We need to add the necessary repository, so issue the command:

wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

If you find that wget isn’t installed, you’ll need to first install that package with the command:

sudo apt-get install wget -y

You can then run the wget command again to download the .deb file. With that downloaded, add the repository with the command:

sudo dpkg -i packages-microsoft-prod.deb

When the installation of the repository finishes, update apt with the command:

sudo apt-get update

Install the necessary dependencies with the command:

sudo apt-get install apt-transport-https -y

Finally, install the .NET Core SDK with the command:

sudo apt-get install dotnet-sdk-3.1 -y

When the installation completes, you’re ready to start developing with .NET Core on Ubuntu.

Fedora

As of Fedora 32, installing .NET Core is very simple, because the package is available from the standard repositories. So to install .NET Core on Fedora 32, log into your machine, open a terminal window, and issue the command:

sudo dnf install dotnet-sdk-3.1 dotnet-runtime-3.1 aspnetcore-runtime-3.1 -y

Once that installation completes, you’re ready to start developing with .NET Core on Fedora 32.

openSUSE

Now we’ll install .NET Core on openSUSE. The first thing you have to do is install a single dependency. Log into your system, open a terminal window, and issue the command:

sudo zypper install libicu

Next, we need to import the GPG key for the .NET Core repository with the command:

sudo rpm — import https://packages.microsoft.com/keys/microsoft.asc

Download the repository file with the command:

wget https://packages.microsoft.com/config/opensuse/15/prod.repo

Move the file into the necessary directory with the command:

sudo mv prod.repo /etc/zypp/repos.d/microsoft-prod.repo

Give the repository the necessary ownership with the command:

sudo chown root:root /etc/zypp/repos.d/microsoft-prod.repo

Install the .NET Core SDK with the command:

sudo zypper install dotnet-sdk-3.1

Install the .NET Core runtime with the command:

sudo zypper install aspnetcore-runtime-3.1

After a reboot, you can start developing with .NET Core on openSUSE.

And that’s all there is to installing .NET Core on Windows, macOS, and Linux. You are now ready to take your cross-platform development to the next level.

--

--

Emma White

I’m a tech writer, IT enthusiast, and business development manager living in Miami.