# Debian

> Deploy an ASP.NET Core app with TX Text Control to Debian: set up sudo, the ASP.NET Core Runtime from Microsoft's package repository, systemd, nginx and ufw.

- **Product:** TX Text Control .NET Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET Server > Deployment Guide > Linux > Debian
- **1485 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/debian/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/debian/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/debian/llms-full.txt

---

Debian has no .NET packages in its own archive, so on Debian 12 and 13 the ASP.NET Core Runtime comes from Microsoft's package repository. Apart from this step and a few details of a fresh installation, a Debian server runs an application with TX Text Control .NET Server exactly like an Ubuntu server: published for `linux-x64`, started by systemd and reached through nginx.

The Debian-specific steps follow below. For publishing the application, the service file and the nginx configuration, they point to the matching sections of [Ubuntu](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/ubuntu/llms-full.txt), which apply to Debian unchanged.

### Prerequisites

- **A server with Debian 12 or Debian 13.** Microsoft supports .NET 10, 9 and 8 on both versions. An ASP.NET Core application with the TX Text Control 34.0 packages runs on both; Debian 11 doesn't meet the [Linux Requirements](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/requirements/llms-full.txt).
- **A user account with sudo privileges.** See [Set Up sudo](#set-up-sudo) if your account doesn't have them yet.
- **An ASP.NET Core application that uses the Core engine**, for example from [Document Editor: ASP.NET Core](https://docs.textcontrol.com/tx-text-control-dotnet-server/getting-started/document-editor/aspnet-core/llms-full.txt). The commands use a .NET 10 project named *MyApp*.
- **A runtime license** for the server. See [Runtime Licenses](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/licensing/runtime/llms-full.txt).

### What Differs From Ubuntu

|  | Debian | Ubuntu |
|---|---|---|
| .NET packages | Microsoft package repository, which you register first | Ubuntu's own package feeds |
| `dotnet` command | */usr/share/dotnet/dotnet*, linked from */usr/bin/dotnet* | */usr/bin/dotnet* |

On Debian, sudo may also be missing, as described below. Everything else is the same: the user *www-data*, the folder */var/www*, the systemd unit with `ExecStart=/usr/bin/dotnet`, the nginx layout with */etc/nginx/sites-available/default* and the Uncomplicated Firewall.

### Set Up sudo

If you set a root password during the installation of Debian, sudo isn't installed, and the user created during installation isn't in the *sudo* group. Set it up as root:

```bash
su --login
apt install sudo
adduser <user> sudo
```

Replace `<user>` with your user name, then log out and log in again for the group membership to take effect.

### Install the ASP.NET Core Runtime

Register the Microsoft package repository. On Debian 13:

```bash
wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
```

On Debian 12, use `debian/12` in the address instead of `debian/13`. If `wget` isn't installed, install it first with `sudo apt-get install -y wget`.

Then install the ASP.NET Core Runtime, which contains the .NET Runtime and the ASP.NET Core Runtime:

```bash
sudo apt-get update && \
  sudo apt-get install -y aspnetcore-runtime-10.0
```

Check the installation with `dotnet --list-runtimes`. The Document Editor backend is built for .NET 8 and rolls forward to the newest installed major version, so it runs on the .NET 10 runtime as well.

`sudo apt-get update` and `sudo apt-get upgrade` install new patch releases of .NET later. After an upgrade of Debian itself, register the repository again with the address of the new version.

### Deploy the Application

1. **Prepare the application.** Bind the backend to the loopback address and add the Forwarded Headers Middleware, as described in [Prepare the Application](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/ubuntu/#prepare-the-application).
2. **Publish it for Linux** on the development machine with `dotnet publish -c Release -r linux-x64 --self-contained false`. [Publish the Application](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/ubuntu/#publish-the-application) lists what the output contains.
3. **Copy it to */var/www/myapp*** and give the files to *www-data*, as in [Copy the Application to the Server](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/ubuntu/#copy-the-application-to-the-server). Debian has the *www-data* user.
4. **Create the systemd service** from [Run the Application as a systemd Service](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/ubuntu/#run-the-application-as-a-systemd-service). The service file works unchanged, because the Microsoft packages provide */usr/bin/dotnet*, and the application finds the command there to start the Document Editor backend.
5. **Install nginx:**

    ```bash
    sudo apt-get install -y nginx
    ```

    Debian's nginx package uses the same */etc/nginx/sites-available* layout as Ubuntu's. Replace */etc/nginx/sites-available/default* with the configuration from [Configure nginx](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/ubuntu/#configure-nginx), test it with `sudo nginx -t` and load it with `sudo nginx -s reload`.
6. **Install and configure the firewall:**

    ```bash
    sudo apt-get install -y ufw
    ```

    Then allow SSH, HTTP and HTTPS and enable the firewall, as in [Configure the Firewall](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/ubuntu/#configure-the-firewall).
7. **Verify the deployment** in the browser and in the journal of the service, as described in [Verify the Deployment](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/ubuntu/#verify-the-deployment).

### When the Runtime Isn't Found

If `apt-get` reports "Unable to locate package" or "Some packages could not be installed" for `aspnetcore-runtime-10.0`, the repository registration didn't work. Remove and register it again:

```bash
sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
```

The command needs the *packages-microsoft-prod.deb* file, so download it again first. The Microsoft package repository publishes .NET 10 for x64 and Arm64; TX Text Control needs x64. [Install .NET on Debian](https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian) describes a manual registration for the case that this doesn't help.

### Next Steps

- [Ubuntu](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/ubuntu/llms-full.txt): the complete deployment with explanations of each step.
- [Linux Requirements](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/requirements/llms-full.txt): what a Linux server needs for TX Text Control.
- [Docker](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/docker/llms-full.txt): run the application in a Linux container.
- [Troubleshooting Linux](https://docs.textcontrol.com/tx-text-control-dotnet-server/troubleshooting/linux/llms-full.txt): solve problems that occur on Linux.

---

## Nearby

- **Previous:** [Ubuntu](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/ubuntu/llms-full.txt)
- **Next:** [Linux Requirements](https://docs.textcontrol.com/tx-text-control-dotnet-server/deployment/linux/requirements/llms-full.txt)
