Deploy a Self-Hosted AI Assistant on a Private Server and Connect DingTalk and QQ

    Learn how to deploy an open-source AI assistant in a Linux virtual machine on a NAS or private server, configure SSH and Node.js, and connect messaging platforms such as DingTalk and QQ. This guide also covers access controls, process supervision, backups, and updates for ongoing operation.

    1. Deployment Overview

    As large language models become more accessible, more developers want an AI assistant that runs continuously in a private environment. The assistant provides a unified conversational interface while using channel integrations to connect with different messaging platforms.

    Many open-source projects primarily support internationally popular messaging services out of the box. Teams that rely on Chinese messaging platforms such as DingTalk or QQ may need additional integrations.

    This guide follows a straightforward deployment path:

    Create a Linux virtual machine on a NAS → configure the operating system and remote access → install Node.js → deploy the open-source assistant → connect messaging channels.

    The assistant service itself has modest resource requirements: a configuration with two CPU cores and 4 GB of RAM can serve as a starting point. Local model inference requires separate resource planning.

    2. Why Use a Virtual Machine Instead of a Containerized Desktop?

    Some NAS devices include HDMI output and can run a containerized Linux desktop, allowing the same device to function as both storage and a desktop workstation.

    That arrangement can be convenient for everyday tasks and light development. However, a containerized desktop introduces several complications when used to host a persistent assistant service:

    1. More complex lifecycle management: The desktop container typically starts and stops with the NAS, and the restart behavior of services inside it may be harder to inspect and troubleshoot.
    2. Shared operating environment: Desktop applications and background services run together, increasing the potential for interference.
    3. Unnecessary desktop overhead: Long-running services are generally administered through SSH and the command line rather than a graphical interface.

    A lightweight Linux VM on the NAS virtualization platform provides a cleaner separation. The assistant gets its own operating system and resource allocation, while the NAS continues to handle storage. VM snapshots and migration also become easier to manage.

    This comparison concerns containerized desktops, not all container-based service deployments.

    3. Create a Linux Virtual Machine

    Resource Planning

    • CPU and memory: Start with two CPU cores and 4 GB of RAM. Consider four cores and 8 GB of RAM for multiple messaging channels; local model inference may require additional resources depending on the model.
    • Storage: Allocate at least 40 GB to leave room for logs and caches.
    • Operating system: Choose a mainstream Linux desktop or server distribution. A desktop edition can make initial installation easier for beginners.

    The commands below assume an APT-based Linux distribution.

    Installation and Initialization

    Upload the installation image to the NAS, create a VM in its virtualization interface, and attach the image to install Linux.

    After installation, open the VM through its VNC console and install the basic administration tools:

    1. sudo -i # Switch to a root shell
    2. apt update && apt install git curl wget vim openssh-server

    4. Configure SSH Remote Access

    A service intended to run continuously should not depend on a VNC desktop console for routine administration. Configure SSH so that subsequent work can be done from a terminal.

    Open the SSH server configuration:

    1. nano /etc/ssh/sshd_config

    The source setup uses the following settings for password-based root access:

    1. Port 22
    2. PermitRootLogin yes
    3. PasswordAuthentication yes

    Restart the SSH service after saving changes:

    1. systemctl restart ssh

    You can then connect to the VM from a computer on the local network using an SSH client.

    Security warning: These settings permit root login with a password and should not be treated as a secure configuration for an internet-facing server. If the VM is publicly accessible, use SSH keys and disable password authentication, or restrict SSH access to the private network. Changing the default SSH port is an additional precaution, not a substitute for secure authentication.

    Assistant installation generally does not require root privileges. Create or use a regular account for deployment, following the principle of least privilege. Run the remaining installation steps as that user.

    5. Install the Node.js Runtime

    The assistant in this workflow uses Node.js. The Node Version Manager, or nvm, makes it easier to install and switch between runtime versions.

    1. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
    2. source ~/.bashrc
    3. nvm install 22
    4. nvm use 22
    5. nvm alias default 22

    Setting Node.js 22 as the default avoids having to select it manually each time you open a terminal.

    6. Install the Assistant Service

    The source workflow provides installation commands for OpenClaw and a Chinese-language variant. Choose the package appropriate to your deployment and consult its official documentation for current requirements and configuration details.

    1. # Install the original package
    2. npm install -g openclaw@latest
    3. # Alternatively, install the Chinese-language variant
    4. npm install -g openclaw-cn@latest

    After installation, follow the project documentation to configure:

    • The model API key
    • The default model
    • The working directory

    Start the assistant using the documented command and test a conversation from the command line before configuring external messaging channels.

    7. Connect DingTalk, QQ, and Other Messaging Channels

    For teams using DingTalk or QQ, messaging integration typically follows four steps. The exact configuration depends on the platform and the assistant’s available channel integration.

    Create an Application or Bot

    Create an application or bot in the relevant platform’s developer portal. Obtain the credentials required by that integration, such as an AppKey or token.

    Platform availability and account requirements may vary by region.

    Add the Channel Configuration

    Add the appropriate channel entry to the assistant’s configuration and supply the required credentials and callback settings.

    Use the assistant’s official documentation and the platform’s API documentation for the exact configuration structure.

    Configure Message Delivery

    Many integrations use webhook callbacks. In that case, the callback endpoint must be reachable by the messaging platform.

    If the VM runs on a private network, a tunneling tool can provide a route to the callback endpoint. The integration’s actual requirements determine whether an externally reachable callback is necessary.

    Restrict Access

    Limit which users can invoke the assistant and protect integration credentials. Unrestricted access or leaked tokens can allow unauthorized use of the service.

    Other platforms mentioned in this workflow include WeCom, WeCom bots, and Feishu. Their general integration sequence is similar:

    Register an application → obtain credentials → configure the channel → verify message delivery.

    Any connection between WeCom and personal WeChat accounts depends on the platform’s supported capabilities and account configuration; it should not be assumed to provide unrestricted personal WeChat access.

    Start with one or two frequently used channels rather than adding every available integration. This keeps configuration and maintenance manageable.

    8. Ongoing Operations

    Process Supervision

    Use systemd or a process manager to keep the assistant running and restart it after an unexpected exit.

    Log Rotation

    Conversation logs can grow quickly. Configure regular rotation and cleanup to prevent them from consuming the VM’s storage.

    Backups

    Back up configuration files and conversation data. Periodic VM snapshots can also help preserve the deployment state.

    Updates

    The source workflow uses npm update -g to update globally installed packages. Test upgrades before applying them to the primary deployment, particularly when channel integrations are involved.

    9. Conclusion

    The core approach is to give the assistant a dedicated Linux environment, manage Node.js with nvm, install the service under a regular user account, and connect messaging platforms through their developer credentials and channel configuration.

    A NAS-hosted VM or a lightweight cloud server can support this deployment pattern without requiring substantial hardware for the assistant service itself. With remote administration, process supervision, backups, and controlled channel access in place, the result is a self-hosted assistant service that can be extended as messaging needs change.

    Self-hosting gives you control over the service environment, but model requests still depend on the model API configured for the assistant.