Install .NET 6 runtime on clean Alpine Linux

These are step-by-step instructions as they seems to be scattered all over the internet. I will start with a completely clean, stock Alpine distro.



Alpine does not have .NET 6 installers or sudo, so you have to install dependencies as admin first:

isb:/home/alg# apk add bash icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib
(1/13) Installing ncurses-terminfo-base (6.3_p20211120-r1)
(2/13) Installing ncurses-libs (6.3_p20211120-r1)
(3/13) Installing readline (8.1.1-r0)
(4/13) Installing bash (5.1.16-r0)
(5/13) Installing libgcc (10.3.1_git20211027-r0)
(6/13) Installing libstdc++ (10.3.1_git20211027-r0)
(7/13) Installing icu-libs (69.1-r1)
(8/13) Installing krb5-conf (1.0-r2)
(9/13) Installing libcom_err (1.46.4-r0)
(10/13) Installing keyutils-libs (1.6.3-r0)
(11/13) Installing libverto (0.3.2-r0)
(12/13) Installing krb5-libs (1.19.3-r0)
(13/13) Installing libintl (0.21-r0)
Executing busybox-1.34.1-r3.trigger
OK: 49 MiB in 35 packages

.NET 6

.NET 6 itself does not need admin privileges to install. First, download install script:

isb:~$ wget
Connecting to (
Connecting to (
saving to ''    100% |************************************************************************| 57823  0:00:00 ETA
'' saved

give it exec permission

isb:~$ chmod +x

and install the latest runtime:

isb:~$ ./ -c Current --runtime aspnetcore
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit to get the installer.

dotnet-install: wget extra options are unavailable for this environment
dotnet-install: Attempting to download using link
dotnet-install: wget extra options are unavailable for this environment
Connecting to (
saving to '/tmp/dotnet.XXXKEaFfa'
dotnet.XXXKEaFfa     100% |************************************************************************| 37.5M  0:00:00 ETA
'/tmp/dotnet.XXXKEaFfa' saved
dotnet-install: Extracting zip from
dotnet-install: Installed version is 6.0.9
dotnet-install: Adding to current process PATH: `/home/alg/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.

At this point .net is fully installed.

Add to path

Alpine is using ash shell, so you need to create .profile in your home folder and add the following:

export DOTNET_ROOT=$(pwd)/.dotnet

Now reload the shell and you’re done.

Short way

  1. Run as su
apk add bash icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib
  1. Run as user
chmod +x
./ -c Current --runtime aspnetcore
vi .profile
# paste 2 lines:
# export DOTNET_ROOT=$(pwd)/.dotnet
source .profile

Thanks! You can always email me or use contact form for more questions/comments etc.