---
title: "Running .NET Core 6.0 Applications and Websites on a Raspberry Pi 4B"
description: "This guide explains how to install the .NET 6.0 SDK on a Raspberry Pi 4B, deploy console applications and web apps, and configure services to start automatically on boot using systemd."
canonical_url: "https://blog.markkulab.net/en/post/raspberry-pi-run-net-core-app"
author: "Mark Ku"
author_url: "https://blog.markkulab.net/en/author/mark-ku"
site: "Mark Ku's Tech Notes"
date_published: "2022-02-03 01:01:01 +0800"
category: ".NET Core"
tags: ["raspberry pi", "net core", "dotnet", "linux", "systemd", "deployment"]
language: "en"
license: "CC BY 4.0"
license_url: "https://creativecommons.org/licenses/by/4.0/"
attribution: "when reusing or quoting, credit the author and link back to the original"
---

# Running .NET Core 6.0 Applications and Websites on a Raspberry Pi 4B

## Running .NET Core 6.0 Applications and Websites on Raspberry Pi 4B

## Environment Setup
### Install .NET Core Dependencies
```
sudo apt install -y libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4 libcurl4-openssl-dev libssl-dev uuid-dev unzip libgdiplus libc6-dev libkrb5-3
```
### Download and Unzip the .NET SDK

```
wget https://download.visualstudio.microsoft.com/download/pr/1f85b038-9917-4d0a-8485-5dc86510eec7/a7555924fe292c6c2140893f066abe65/dotnet-sdk-6.0.100-linux-arm.tar.gz -O dotnet-sdk-linux-arm.tar.gz --no-check-certificate
sudo mkdir -p /usr/local/dotnet && sudo tar zxf dotnet-sdk-linux-arm.tar.gz -C /usr/local/dotnet
```

### Create a Symbolic Link
```
sudo ln -s -f /usr/local/dotnet/dotnet /usr/local/bin
```
P.S. A symbolic link (also called a symlink or soft link) is a type of link file similar to a Windows shortcut.
/usr/local is typically where executable programs are placed. Basically, all of Linux's built-in executables are located here.

### Test dotnet
```
dotnet --version
```
![Raspberry Pi terminal displaying dotnet version 6.0.100](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/uGT1OUa.png)

## Part 1: Running a .NET Core Console Application on Raspberry Pi
### Create a new .NET Core console application project

![New project dialog highlighting C .NET Core console application template](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/nMVJCbK.png)

![Development UI selecting .NET 6.0 for a console application](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/5Y3GiST.png)

### Right-click the project, then Publish > Folder > Finish > Publish

![Publish dialog with Folder option selected](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/c95PUoW.png)

### Xftp is a tool that uses the SSH protocol to quickly upload files to Linux through a UI. To copy your locally built .NET Core application to the Raspberry Pi, you can easily do it with Xftp.
![Xftp file manager showing local and remote .NET Core files](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/bTEL45d.png)
[Xftp download link](https://www.google.com/search?q=xftp+%E4%B8%8B%E8%BC%89&sxsrf=APq-WBvdRrsaGOHymmV8qmpJwXXlfJworA%3A1643711165001&ei=vAr5YZrHPM-fhwO7kKFY&ved=0ahUKEwialemgpd71AhXPz2EKHTtICAsQ4dUDCA4&uact=5&oq=xftp+%E4%B8%8B%E8%BC%89&gs_lcp=Cgdnd3Mtd2l6EAMyBQgAEIAEOgcIABBHELADOgQIABBDSgQIQRgASgQIRhgAUJcGWJYWYNYWaAFwAngAgAFRiAGcAZIBATKYAQCgAQHIAQrAAQE&sclient=gws-wiz)

### Switch to the newly uploaded .NET Core folder
```
cd NetCoreTest/
```
### Run dotnet ConsoleApp1.dll
![Raspberry Pi terminal running .NET Core 'Hello, World!' application](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/kv3NH1l.png)

## Part 2: Running a .NET Core Website on Raspberry Pi and Registering It as a Service to Start on Boot
### Follow the same steps as for the .NET Core console application to copy the build output of your .NET Core web application to the Raspberry Pi using Xftp.
![New project dialog, ASP.NET Core Web Application template highlighted](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/A6moxXI.png)

![Chinese dialog for new ASP.NET Core web project creation](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/w0hSS3c.png)

![Xftp displaying .NET Core web app files on local and Raspberry Pi](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/4CGAHwG.png)

### Right-click the project, then Publish > Folder > Finish > Publish

![Publish dialog with Folder option highlighted for local deployment](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/c95PUoW.png)

### Switch to the uploaded folder and specify the URL and port number
```
dotnet LetGo.Label.Service.dll  --urls "http://localhost:5100;https://localhost:5101"
```

### Finally, visit the URL
![Web browser showing Let's Go Label Service on localhost:5101](https://blog.markkulab.net/content/markku/posts/raspberry-pi-run-net-core-app/images/Lj3zprW.png)

### If you want the application to start automatically on boot, you can register it as a service.
sudo vim /lib/systemd/system/label.service

```
[Unit]
Description=Label Services
After=network.target
Wants=network.target

[Service]
Restart=on-failure
RestartSec=5
ExecStart=dotnet /var/label/LabelService.dll  --urls "http://localhost:5100;https://localhost:5101"

[Install]
WantedBy=multi-user.target
```

### Start the `label` service you just registered
```
sudo systemctl start label.service //啟動 FRP Server 服務
sudo systemctl stop label.service //停止 FRP Server 服務
sudo systemctl restart label.service //重啟 FRP Server 服務
sudo systemctl enable label.service //開機時自動啟動 FRP Server 服務
sudo systemctl disable label.service //開機時不要啟動 FRP Server 服務
sudo systemctl status label.service //查看FRP Server 狀態
sudo systemctl is-failed label.service // 查看失敗狀態
sudo systemctl daemon-reload  // reload service
sudo systemctl status frpc.service
```

## References
[Link](https://www.quarkbook.com/?p=683)

---

## About this article and its author

Originally published on [Mark Ku's Tech Notes](https://blog.markkulab.net/en/post/raspberry-pi-run-net-core-app)

License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) — when reusing or quoting, credit the author and link back to the original

### About the author

**[Mark Ku](https://blog.markkulab.net/en/author/mark-ku)** — Software Solution Provider

- 10+ years senior software engineer, now an AI Builder
- Focused on large-platform architecture — North-American e-commerce, AI SaaS subscription billing
- Combining AI Agents and automation to build evolvable product foundations

### Free tools built by the author

All of these are free to use:

- [Free PDF Sign Tool](https://blog.markkulab.net/en/tools/pdf-sign): Online PDF sign tool — draw, type, or upload a signature, then drag, resize, and download. Everything runs in your browser; nothing is uploaded.
- [VS Code Refactory](https://blog.markkulab.net/en/tools/refactory): Refactory is a VS Code refactoring extension: 34 actions plus a 37-rule code-smell inspection layer with a Code Health dashboard, across 18 languages, backed by 534 tests. It learns your repo's conventions: where interfaces live, where DI is registered, whether 'use client' belongs. It ranks files by git churn × complexity so you know what to fix first, and hands any smell to the Claude Code already on your machine. Free to use, and your source never leaves your computer.
- [DB-Kit Database Manager](https://blog.markkulab.net/en/tools/db-kit): DB-Kit is a lightweight, cross-platform database manager built with Tauri + Rust + React. Manage MySQL, MariaDB, PostgreSQL, SQL Server, Oracle, SQLite, MongoDB, Redis, Kafka, Elasticsearch and RabbitMQ from one consistent interface: passwords encrypted in the OS keychain, SSH tunnels, full CRUD, a visual query builder, stacked multi-statement result sets, cross-connection data transfer and compare/sync, Excel / CSV import & export, visualized execution plans, ER diagrams, scheduled backups, SQL stress testing with p50–p99 latency percentiles, a 15-rule SQL review engine, Kafka message browsing with monitoring & alerts, a bilingual UI (Traditional Chinese / English), a built-in AI assistant (natural-language SQL, AI review and tuning advice) and the dbk CLI. Free and open source (MIT), with installers for Windows, macOS and Linux.
- [VS Code Super Mermaid](https://blog.markkulab.net/en/tools/super-mermaid): Super Mermaid is a VS Code extension for beautiful Mermaid diagrams out of the box: auto-colored live preview, mouse pan & zoom, high-res PNG / SVG export, 21 templates and multiple themes. Free and open source (MIT).
- [React Super Mermaid](https://blog.markkulab.net/en/tools/react-super-mermaid): react-super-mermaid is an open-source React component library: render beautiful Mermaid diagrams with a single <MermaidViewer>, with built-in colorful / sketch themes, pan & zoom, in-diagram search, and high-res SVG / PNG export. Lightweight, SSR-safe, fully typed. Free and open source (MIT).
- [Jira / Confluence Super Mermaid](https://blog.markkulab.net/en/tools/jira-super-mermaid): An Atlassian Forge app: write Mermaid syntax directly inside a Jira issue or a Confluence page and get flowcharts, sequence diagrams, state machines and Gantt charts. 11 diagram types, SVG / PNG export, light and dark themes, full CJK support. Runs on Atlassian: your diagrams live in your own site and the app calls no third-party service. Free, coming soon to the Atlassian Marketplace.
- [Mermaid Live Preview](https://blog.markkulab.net/en/tools/mermaid-preview): Write Mermaid in your browser, see it render instantly, and share the whole diagram as a single link. No sign-up, nothing uploaded to a server, and mermaid.live share links work as-is.
- [React Intl Phone Number](https://blog.markkulab.net/en/tools/react-intl-phone-number): react-intl-phone-number is an open-source React component: framework-agnostic and antd-free, with E.164 in/out, a searchable flag / country-code dropdown, configurable validation levels (strict / mobile-strict / loose), themeable CSS, and i18n — phone logic powered by google-libphonenumber. Lightweight and fully typed. Free and open source (MIT).
- [Uptime Kuma Cluster](https://blog.markkulab.net/en/tools/uptime-kuma-cluster): Turn single-node Uptime Kuma into a highly available cluster: OpenResty + Lua smart load balancing, shared MariaDB state, health checks and automatic failover, plus cluster-management REST APIs. One Docker Compose command to start. Free and open source (MIT).
- [Special Education](https://blog.markkulab.net/en/education): Learning materials crafted for special education students

### Daily podcasts

- [Mark's Tech Insights — Daily AI News](https://blog.markkulab.net/en/category/tech-news): Daily curated AI and tech trends. Catch the latest developments via audio summaries — covering AI applications, software architecture, DevOps, and engineering practice. — RSS: https://blog.markkulab.net/feed.xml
- [AI股市蝦聊](https://blog.markkulab.net/en/category/ai-stock-chat): Every trading day, an AI-analyzed take on the Taiwan stock market, delivered as a two-host conversation covering the session and the next-day outlook. — RSS: https://blog.markkulab.net/ai-stock-chat/feed.xml
- [開源好物週報](https://blog.markkulab.net/en/category/open-source-weekly): A weekly two-host pick of free open-source tools surfaced from real Hacker News, GitHub, and Reddit buzz — what pain they solve and the fastest way to get started. — RSS: https://blog.markkulab.net/open-source-weekly/feed.xml

### Newsletter

[Subscribe to the newsletter](https://blog.markkulab.net/en/subscribe) — Be the first to know about new posts. No spam, unsubscribe anytime.
