Ubuntu Linux

Install .NET 8.0 on Ubuntu 24.04

Richard
Written by
Richard
Mar 5, 2025 Updated Mar 20, 2026 3 min read
Install .NET 8.0 on Ubuntu 24.04

This article explains how to install .NET 8 on Ubuntu 24.04.

.NET 8 is a cross-platform, high-performance framework developed by Microsoft. It allows developers to create a variety of applications, including web, mobile, desktop, and cloud, deploying them on Windows, macOS, and Linux with a single codebase.

With .NET 8, developers can build applications for both Windows and Linux, which is especially beneficial in enterprise environments where diverse systems are utilized.

Installing .NET 8 on Ubuntu enables developers to take advantage of these benefits while working in a Linux environment, making it an excellent choice for those who prefer or require Linux for their development and deployment processes.

Install .NET 8

.NET 8 packages are now available in the default repositories for Ubuntu. Previously, users had to add a separate repository to install .NET 8. However, that is no longer necessary.

You can simply run the command below to install .NET 8 on Ubuntu.

🐧Bash / Shell
sudo apt update
sudo apt install dotnet8

Once installed, run the command below to verify the .NET version number.

💻Code
dotnet --version

Create Hello World app

After installing .NET 8 on Ubuntu, you can start building your apps. A simple app to test is the [Hello World] app.

Run the command below to create a simple Hello World app.

💻Code
dotnet new console -o helloworld

Change into the helloworld folder and run the app.

Command Prompt
cd helloworld
dotnet run

It should output [Hello World] on your terminal.

You can also create an ASP.NET app. To do that, run the command below.

💻Code
dotnet new razor -o asp.net

Change into the [asp.net] folder and run the app.

Command Prompt
cd asp.net
dotnet run --urls=http://0.0.0.0:5000/

To test, open your browser and browse to the server hostname or IP address followed by port number 5000.

💻Code
http://srv1.example.com:5000
.NET app portal

That should do it!

Conclusion:

In summary, installing and using .NET 8 on Ubuntu 24.04 is straightforward and provides numerous advantages for developers. Here are the key points to remember:

  • Cross-Platform Development: .NET 8 allows for the development of applications across various platforms.
  • Streamlined Installation: Installation has been simplified with packages available in the default repositories.
  • Easy Verification: The command to check the .NET version allows for quick installation confirmation.
  • Hello World Example: Creating a basic “Hello World” app helps beginners start with .NET 8.
  • ASP.NET Capability: Developers can easily create and run ASP.NET applications for web development.
  • Accessibility: Applications can be accessed via a web browser, demonstrating successful deployment.

With these benefits, .NET 8 on Ubuntu empowers developers to build robust applications efficiently.

Frequently Asked Questions

How do I install .NET 8 on Ubuntu 24.04?

You can install .NET 8 on Ubuntu 24.04 by running the command 'sudo apt update' followed by 'sudo apt install dotnet8'. This installs the .NET 8 packages available in the default repositories.

How can I verify that .NET 8 is installed correctly?

To verify that .NET 8 is installed correctly, run the command 'dotnet --version' in your terminal. This will display the installed version of .NET.

What is the first application I can create with .NET 8?

A simple 'Hello World' application is a great starting point. You can create it by running 'dotnet new console -o helloworld' and then executing 'dotnet run' within the 'helloworld' directory.

Can I create ASP.NET applications on Ubuntu with .NET 8?

Yes, you can create ASP.NET applications on Ubuntu using .NET 8. Use the command 'dotnet new razor -o asp.net' to create an ASP.NET app and run it with 'dotnet run --urls=http://0.0.0.0:5000/'.

What are the benefits of using .NET 8 on Ubuntu?

Using .NET 8 on Ubuntu allows for cross-platform development, streamlined installation from default repositories, and easy access to applications via a web browser. It empowers developers to build robust applications efficiently in a Linux environment.

Was this guide helpful?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

2469 articles → Twitter

📚 Related Tutorials

Mount External Storage as Read-Only in Ubuntu
Ubuntu Linux Mount External Storage as Read-Only in Ubuntu
How to Install Varnish Cache on Ubuntu 24.04 with Apache
Ubuntu Linux How to Install Varnish Cache on Ubuntu 24.04 with Apache
How to Install LAMP on Ubuntu Linux
Ubuntu Linux How to Install LAMP on Ubuntu Linux
How to Install SonarQube on Ubuntu Linux
CMS How to Install SonarQube on Ubuntu Linux

Leave a Reply

Your email address will not be published. Required fields are marked *