Deploying a Base Environment on Debian 12

Note: All commands are executed under the root user by default.

User Creation

Adding a User

Create a new user named sysadmin.

adduser sysadmin

This is an interactive command; follow the prompts.

Granting Administrative Privileges

Add the user to the sudo group for privilege escalation. Add the user to the root group to inherit its permissions.

usermod -aG sudo sysadmin
usermod -aG root sysadmin

To enable sudo, edit the /etc/sudoers file (using visudo is recommended) and add:

sysadmin ALL=(ALL:ALL) ALL

Desktop Environment Installation

Intsalling XFCE

Install the XFCE desktop with its core components.

apt install -y task-xfce-desktop

(If the user was created before this installation, a graphical login screen will appear after a reboot.)

Installing Remote Desktop Services

To enable Remote Desktop Protocol (RDP) access:

apt install xrdp
systemctl enable xrdp

The system is now accessible via an RDP client.

Localization for Remote Desktop

Setting Locale

Edit /etc/default/locale and set its contents to:

LANG=zh_CN.UTF-8
LANGUAGE=zh_CN:zh
LC_ALL=zh_CN.UTF-8

Apply the changes and generate the locale:

/usr/sbin/locale-gen

Reboot the system for the changes to take full effect.

Fonts and Input Method

Log in via RDP as the sysadmin user. If characters appear garbled, install Chinese fonts:

sudo apt install fonts-wqy-microhei fonts-wqy-zenhei

Reboot. Desktop font settings can be adjusted via Settings > Appearance > Fonts.

For Chinese input, install fcitx5:

sudo apt install fcitx5 fcitx5-chinese-addons

Configure it via Settings > Fcitx 5 Configuration, adding Pinyin from the available input methods list.

Core Service Setup

Docker

Install Docker and enable the service:

apt install docker.io
systemctl enable docker

Allow the sysadmin user to manage Docker without sudo:

usermod -aG docker sysadmin

Supervisor

Install Supervisor and enable its service:

apt install supervisor
systemctl enable supervisor

Grant sysadmin permission to use supervisorctl. The default socket file (/var/run/supervisor.sock) is owned by root. Since sysadmin is in the root group, adjust the group permissions:

chmod g+rw /var/run/supervisor.sock

Now sysadmin can execute supervisorctl commands directly.

Additional Notes

If installing a .deb package with apt from a user's home directory fails due to permissions, move the file to /tmp first:

apt install /tmp/package.deb

Alternatively, use dpkg:

dpkg -i package.deb

Tags: debian System Administration docker Supervisor XFCE

Posted on Thu, 22 Oct 2026 16:28:44 +0000 by MarK (CZ)