Self-Hosting an AI Chat Service: Docker, Open WebUI, and Feishu Bot Integration

    This article is a practical, step-by-step guide to self-hosting an AI chat service. It covers who should self-host and what prerequisites to prepare, how to size hardware for different concurrency levels, how to compare containers, virtual machines, and cloud platforms, and how to build a secure Linux base with hardened SSH key authentication. It then walks through a minimal Docker deployment of Open WebUI as the chat front end and shows how to connect a Feishu (known internationally as Lark) bot through a dedicated callback service and an HTTPS reverse proxy. The guide also addresses runtime version management, long-term operations such as process supervision, logging, backups, and upgrades/rollbacks, and closes with a troubleshooting checklist and FAQ. Readers will get reusable, executable commands and a clear, auditable deployment path rather than a copy of any single vendor document.

    0. Bottom Line First: Who This Is For, Prerequisites, and Deliverables

    This article is aimed at three types of readers: developers who want to run conversational AI, knowledge-base Q&A, or agent services on their own hardware; small teams who want to connect chat capabilities to their internal office and communication tools; and operators who are already comfortable with Linux but want a deployment path they can follow step by step. The article walks through SSH hardening, Docker deployment, a minimal Open WebUI runtime, Feishu bot integration, and rollback and troubleshooting.

    Recommended prerequisites:

    • A Linux host that can stay online long-term, such as a home NAS, a virtual machine, a small server, or a cloud instance.
    • Basic Linux command-line skills, including SSH, package managers, and config file editing.
    • If you need public callback access to office platforms such as Feishu, you will need a domain, an HTTPS certificate, or an internal tunneling solution.
    • At least 10GB of free disk space for the system, container images, logs, and backups.

    The deliverables of this article are: an executable security baseline, a minimal working chat-service deployment example, a Feishu bot integration flow, and a troubleshooting and rollback checklist. Expect this to take roughly 1 to 3 hours; if it involves model inference, object storage, a permission system, or enterprise approval, allow more time.

    Risk notes: do not expose a service directly to the public internet without authentication; do not hardcode bot secrets in code or repositories; do not casually allow root password logins; do not upgrade unverified versions directly in production; do not run remote scripts without reviewing them first.

    1. The Value of Self-Hosting and Common Pain Points

    Using an official hosted service directly is usually easier, but for long-term users a few practical problems appear.

    First, documentation is often long and scattered, with key steps spread across English READMEs, wikis, or examples for different versions, which raises search costs. Second, many services are built around an overseas communication ecosystem, so connecting them to internal office tools requires extra adaptation. Third, chat data, logs, and user input pass through third-party platforms, leaving privacy boundaries and compliance responsibilities unclear.

    The core value of self-hosting is taking control back: the service runs under your own device or account, data stays in storage you manage, and channel integration follows your team’s preferences. The tradeoff is that you need to build up foundational skills in Linux, networking, and container or process management. The goal here is not to make you copy a single document, but to give you a reusable method: first secure the baseline, then get a minimal runtime working, and finally connect channels and establish operational practices.

    The hardware requirements for a self-hosted chat service depend on whether it only acts as a “chat gateway” or also handles model inference, retrieval, a vector database, log processing, and multiple channel connections.

    Scenario Recommended Spec Notes Monitoring Focus
    Minimum viable 2 vCPU, 4GB RAM, 20GB disk Runs only the chat front end, API gateway, or calls a cloud model; single-user testing or small-scale validation CPU, memory, disk usage, service liveness
    Recommended production 4 vCPU, 8GB RAM, 50GB SSD Small-team use; can host the chat service, basic retrieval, logs, and one or two channels Response latency, error rate, container restarts, certificate expiry
    Scaling up 8 vCPU, 16GB RAM, 100GB SSD or higher Multiple concurrent users, high log volume, local retrieval, or multiple bots P95 latency, concurrent connections, event backlog, backup success rate

    The minimum recommended here is 2 vCPU and 4GB, on the assumption that: model inference does not run on the same host, or only a lightweight model is used; the service only serves pages, APIs, session forwarding, and a few channel connections; and the log and database footprint is small. If you want to run a large model on the same host, evaluate the GPU, VRAM, memory, and inference framework separately, and do not reuse an ordinary gateway configuration.

    For storage, prefer an SSD for the system disk, and mount data directories separately so snapshots and migrations are easier. For networking, if you only need internal access, listen on 127.0.0.1; if you connect via a Feishu bot callback, you need a stable public HTTPS entry point or a tunneling solution.

    3. Runtime Forms: Containers, Virtual Machines, and Cloud Platforms

    Form Deployment Cost Isolation Snapshot & Migration Best For
    Docker container Low; pull an image and start Process-level isolation, shared kernel Relies on data volumes and image backups Fast validation, frequent upgrades, lightweight always-on services
    Virtual machine Medium; needs images and resource allocation Strong isolation, close to a dedicated host Full-machine snapshots, good for rollback Long-running, strongly consistent, needs a full system environment
    Cloud container platform Medium to high; needs platform setup Depends on the cloud provider’s isolation Depends on the image registry, orchestration config, and cloud storage Elastic scaling, multiple instances, cloud-managed hosting

    If the service runs on a home NAS or virtual machine, the recommended combination is “virtual machine + Docker”: the VM provides a stable boundary and snapshot capability, while Docker manages the application lifecycle and versioning. If your team already has cloud resources, you can also deploy stateless services on a cloud container platform and delegate logs, monitoring, and backups to the provider’s capabilities.

    4. System and Base Environment Preparation

    When installing Linux, choose a mainstream distribution, and set the system locale to a language you read comfortably during the install wizard. This makes later directories, prompts, and logs easier to read and lowers the comprehension cost when troubleshooting.

    1. Install Base Tools

    Package managers differ across distributions, so do not mix commands.

    Debian / Ubuntu:

    1. sudo apt update && sudo apt install -y git curl wget vim ca-certificates gnupg lsb-release openssh-server

    RHEL / Fedora:

    1. sudo dnf install -y git curl wget vim openssh-server

    openSUSE:

    1. sudo zypper refresh && sudo zypper install -y git curl wget vim openssh-server

    2. Create a Regular User and Disable Root Password Login

    Do not run services under the root account long-term, and do not allow root password logins. Create a regular admin user first, then switch to it.

    1. sudo adduser deployer
    2. sudo usermod -aG sudo deployer

    If your distribution uses the wheel group instead of sudo, do:

    1. sudo usermod -aG wheel deployer

    Generate an SSH key on your local terminal:

    1. ssh-keygen -t ed25519 -C "deployer@local"

    Copy the public key to the server:

    1. ssh-copy-id deployer@server_ip

    If the server does not yet have ssh-copy-id, write it manually:

    1. sudo mkdir -p /home/deployer/.ssh
    2. sudo chmod 700 /home/deployer/.ssh
    3. sudo nano /home/deployer/.ssh/authorized_keys

    Paste the contents of your local id_ed25519.pub, then run:

    1. sudo chmod 600 /home/deployer/.ssh/authorized_keys
    2. sudo chown -R deployer:deployer /home/deployer/.ssh

    3. SSH Hardening: Back Up First, Then Disable Password Login

    Before changing the SSH configuration, confirm that the deployer user can already log in with a key. Do not disable password login while you are in your only current session.

    Step one, check directory and file permissions:

    1. ls -ld /home/deployer/.ssh
    2. ls -l /home/deployer/.ssh/authorized_keys
    3. id deployer

    A correct result usually looks like:

    1. /home/deployer/.ssh is owned by deployer with mode 700
    2. authorized_keys is owned by deployer with mode 600

    If permissions are wrong, fix them first:

    1. sudo chown -R deployer:deployer /home/deployer/.ssh
    2. sudo chmod 700 /home/deployer/.ssh
    3. sudo chmod 600 /home/deployer/.ssh/authorized_keys

    Step two, back up the SSH configuration:

    1. sudo cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%F)

    Step three, edit the SSH server configuration:

    1. sudo nano /etc/ssh/sshd_config

    Keep or set the following:

    1. PubkeyAuthentication yes
    2. PermitRootLogin no
    3. PasswordAuthentication no

    If your cloud provider requires special handling for certain scenarios, consider key-only login at most; do not restore password login.

    Step four, check the configuration syntax:

    1. sudo sshd -t

    If there is no error output, restart the SSH service. On Debian / Ubuntu it is usually ssh.service; on RHEL / Fedora / openSUSE it is usually sshd.service. Use a compatible form:

    1. sudo systemctl restart ssh || sudo systemctl restart sshd

    Confirm the service status:

    1. sudo systemctl status ssh || sudo systemctl status sshd

    Step five, verify you are not locked out. Keep the current SSH session open, then open a new terminal to test:

    1. ssh deployer@server_ip

    If the login succeeds, key authentication is working. If it fails, check the SSH logs immediately:

    1. sudo journalctl -u ssh -u sshd -e

    Step six, recovery from failure. If the new terminal cannot log in but the current session is still valid, restore the original configuration immediately:

    1. sudo cp -a /etc/ssh/sshd_config.bak.$(date +%F) /etc/ssh/sshd_config
    2. sudo sshd -t
    3. sudo systemctl restart ssh || sudo systemctl restart sshd

    If the current session also drops, you will need to recover through the cloud provider’s console, a serial console, or another out-of-band management method.

    5. Runtime and Dependency Version Management

    Many chat services are built on runtimes such as Node.js, Python, or Java. Using the runtime from your system repository directly often leads to problems with outdated versions, global package conflicts, or uncontrolled upgrades. A safer approach is to introduce a version manager and keep installations within the current user space.

    For Node.js, you can use nvm to install a long-term support (LTS) version. Note: do not execute remote scripts directly through a pipe. The safer approach is to download the script, confirm its source, review its contents, and, where possible, verify the official checksum before running it.

    1. curl -fsSL -o /tmp/nvm-install.sh https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh

    Review the script contents first:

    1. less /tmp/nvm-install.sh

    If the release page or repository provides a checksum, compute and compare it:

    1. sha256sum /tmp/nvm-install.sh

    After confirming the source is trustworthy and the checksum matches, run it:

    1. bash /tmp/nvm-install.sh
    2. source ~/.bashrc

    Then install and pin the LTS version:

    1. nvm install --lts
    2. nvm alias default 'lts/*'
    3. node -v
    4. npm -v

    If you cannot reach the script URL, or if your team prefers auditable package sources, you can instead use the Node.js LTS version from your distribution’s official repository, or download the binary package from the official Node.js site and pin the version. The core principle is: a clear version source, a reproducible switching path, and no casual upgrades in production.

    If your project uses Python, you can manage versions with pyenv or conda; if it uses Java, you can use SDKMAN or the LTS version shipped with your distribution.

    6. Minimal Working Deployment: Docker and Open WebUI

    To provide a directly executable example, this section uses Docker to deploy Open WebUI as the chat-service entry point. It works well as a local or team-level chat interface and can later connect to a backend model API.

    1. Install Docker and the Compose Plugin

    Package names like docker-compose-v2 are not consistent across distribution repositories, so installing them directly often fails. First detect the available package names in your current repository:

    1. apt-cache policy docker-ce docker-compose-plugin docker.io

    If the output is empty or unavailable, use the official Docker repository to install docker-ce and docker-compose-plugin.

    Debian / Ubuntu example:

    1. sudo apt update
    2. sudo apt install -y ca-certificates curl gnupg
    3. sudo install -m 0755 -d /etc/apt/keyrings
    4. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    5. sudo chmod a+r /etc/apt/keyrings/docker.gpg
    6. echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    7. sudo apt update
    8. apt-cache policy docker-ce docker-compose-plugin
    9. sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

    If the current environment cannot reach the official Docker repository, you can install docker.io and the older docker-compose from your distribution’s repository, but accept the command differences: the new plugin uses docker compose, while the older standalone binary uses docker-compose.

    Verify:

    1. docker --version
    2. docker compose version

    If you are told that the docker compose subcommand does not exist, first check whether docker-compose-plugin is installed:

    1. apt-cache policy docker-compose-plugin
    2. sudo dpkg -l | grep docker

    For temporary troubleshooting, you can also use the older command:

    1. docker-compose --version

    2. Create the Deployment Directory

    1. sudo mkdir -p /opt/chat-stack
    2. sudo chown deployer:deployer /opt/chat-stack
    3. cd /opt/chat-stack

    3. Write docker-compose.yml

    1. nano docker-compose.yml

    Example content:

    1. services:
    2. open-webui:
    3. image: ghcr.io/open-webui/open-webui:v0.6.7
    4. restart: unless-stopped
    5. ports:
    6. - "127.0.0.1:3000:8080"
    7. volumes:
    8. - open-webui:/app/backend/data
    9. volumes:
    10. open-webui:

    The image tag v0.6.7 here demonstrates version pinning. In a real deployment, replace it with a specific tag you have already verified as stable, and avoid using latest or main as a production version.

    4. Start the Service

    1. docker compose up -d

    5. Minimal Verification

    Check container status:

    1. docker compose ps

    Check whether the local port responds:

    1. curl -sS -o /dev/null -w "%{http_code}\n" http://127.0.0.1:3000

    If it returns 200 or 302, the service has usually started. View the logs:

    1. docker compose logs --tail=100 open-webui

    After the first start, you can access it through a local SSH tunnel:

    1. ssh -L 3000:127.0.0.1:3000 deployer@server_ip

    Then open in your browser:

    1. http://127.0.0.1:3000

    For localization, if the project provides a language pack for the UI language you prefer, select it in the system settings; if the community edition offers a localized build, pin its specific image tag or source commit and record it in your change ticket.

    6. Important Boundary: Open WebUI Does Not Provide a Feishu Callback Route by Default

    Note in particular: Open WebUI ships a web interface and a basic API by default, and does not include the /feishu/callback route needed for Feishu event callbacks. Therefore, do not send Feishu callback requests directly to Open WebUI’s port 3000, or you will usually get a 404.

    The correct approach is to deploy a separate callback service, for example listening on 127.0.0.1:8787, and have a reverse proxy forward /feishu/callback to it.

    7. Multi-Channel Integration: The Feishu Bot Example

    Connecting a self-hosted chat service to an internal office platform commonly follows three paths: Webhook callbacks, a long-lived event stream, or a bot application account. Below is a minimal implementation flow using a Feishu custom app bot (Feishu is the domestic name; it is known internationally as Lark).

    1. Create the App and Bot

    Create an enterprise custom app on the Feishu open platform, add bot capabilities, and enable the minimum required permissions, for example:

    • Get and send group messages
    • Get bot information
    • Receive messages that users send to the bot

    Permissions should follow the principle of least privilege; do not request unrelated scopes such as contacts, approvals, or documents by default.

    2. Obtain Credentials

    In the app console, record the following:

    1. App ID
    2. App Secret
    3. Verification Token
    4. Encrypt Key

    Write these into an .env file in the deployment directory rather than into your code:

    1. cd /opt/chat-stack
    2. nano .env

    Example:

    1. FEISHU_APP_ID=cli_example_app_id
    2. FEISHU_APP_SECRET=example_app_secret
    3. FEISHU_VERIFICATION_TOKEN=example_verification_token
    4. FEISHU_ENCRYPT_KEY=example_encrypt_key
    5. FEISHU_CALLBACK_PATH=/feishu/callback
    6. FEISHU_CALLBACK_PORT=8787

    Restrict permissions:

    1. chmod 600 .env

    And make sure .env is not committed to Git:

    1. echo ".env" >> .gitignore

    3. Deploy an Independent Callback Service and Configure the HTTPS Reverse Proxy

    If the platform callback needs public access, use HTTPS on port 443. Here, do not point the Feishu callback directly at Open WebUI’s port 3000; instead, deploy a separate callback service listening on 127.0.0.1:8787.

    You can use Caddy as the reverse proxy:

    1. sudo apt install -y caddy
    2. sudo nano /etc/caddy/Caddyfile

    Example:

    1. chat.example.com {
    2. @feishu path /feishu/callback
    3. reverse_proxy @feishu 127.0.0.1:8787
    4. reverse_proxy 127.0.0.1:3000
    5. }

    After saving, validate the configuration and restart:

    1. sudo caddy validate --config /etc/caddy/Caddyfile
    2. sudo systemctl restart caddy
    3. sudo systemctl status caddy

    Verify HTTPS:

    1. curl -I https://chat.example.com

    The Feishu callback path should then be:

    1. https://chat.example.com/feishu/callback

    While the Open WebUI page is still reached at:

    1. https://chat.example.com

    4. Local Callback Verification: Do Not Hit Port 3000

    When only the independent callback service is running, local verification should target the callback service port, not the Open WebUI port:

    1. curl -sS -X POST http://127.0.0.1:8787/feishu/callback \
    2. -H "Content-Type: application/json" \
    3. -d '{"type":"url_verification","challenge":"demo"}'

    If the implementation is correct and encryption is not enabled, you should get something like:

    1. {"challenge":"demo"}

    If the platform has encryption enabled, you cannot return the plaintext challenge directly; instead, follow the Feishu open platform documentation to:

    • Decrypt the encrypt field in the event body.
    • Validate the Verification Token.
    • Validate the timestamp and signature.
    • Prevent replay attacks.
    • Handle duplicate messages idempotently.

    5. Minimum Feishu Callback Implementation Checklist

    A workable Feishu callback service needs at least the following logic:

    1. Parse the request body.
    2. If an encrypt field exists, decrypt it with the Encrypt Key.
    3. If it is a url_verification event, validate the token and return the challenge.
    4. If it is a message event, extract event_id, chat_id, user_id, and the message text.
    5. Deduplicate on event_id to avoid duplicate replies.
    6. Call the chat service or Open WebUI API to generate a reply.
    7. Send the message to the original conversation using the Feishu API.
    8. Return the success response the platform expects.

    Pseudocode example:

    1. handle_request(body):
    2. payload = parse_json(body)
    3. if payload.encrypt exists:
    4. payload = decrypt(payload.encrypt)
    5. if payload.type == "url_verification":
    6. if payload.token != FEISHU_VERIFICATION_TOKEN:
    7. return error("invalid token")
    8. return {"challenge": payload.challenge}
    9. event_id = payload.header.event_id
    10. if seen(event_id):
    11. return {"code": 0}
    12. mark_seen(event_id)
    13. message = payload.event.message
    14. text = extract_text(message.content)
    15. reply = call_chat_service(text)
    16. send_feishu_message(
    17. chat_id = payload.event.message.chat_id,
    18. text = reply
    19. )
    20. return {"code": 0}

    For a real production implementation, use a mature SDK or refer to the official Feishu examples, and focus your testing on decryption, signatures, timestamps, and idempotency.

    6. Message Send/Receive Verification

    Add the bot to a Feishu group chat, then mention the bot and send a message. During verification, at least check:

    • Whether the callback service log received the event.
    • Whether the user ID, chat ID, and message text were parsed successfully.
    • Whether the bot can call the send-message API.
    • Whether the reply appears in the group chat.

    If it fails, check these first:

    1. grep -E "FEISHU|webhook|callback|auth" /opt/chat-stack/logs/app.log
    2. docker compose logs --tail=200 open-webui
    3. ss -lntp | grep 8787
    4. sudo journalctl -u caddy -e

    Also note for channel integration: domain availability, certificate validity, whether the firewall exposes only the necessary ports, whether the callback address is publicly reachable, whether keys are rotated, and whether the platform API has changed.

    8. Long-Term Stability and Operations

    The point of an always-on service is not that installation succeeds once, but that it can recover after failure and roll back after an upgrade.

    1. Process Supervision and Auto-Start

    For Docker, you can use:

    1. restart: unless-stopped

    For a virtual machine, you can use a systemd unit. Example:

    1. sudo nano /etc/systemd/system/chat-stack.service

    Content:

    1. [Unit]
    2. Description=Chat Stack
    3. After=network.target docker.service
    4. [Service]
    5. Type=oneshot
    6. WorkingDirectory=/opt/chat-stack
    7. ExecStart=/usr/bin/docker compose up -d
    8. RemainAfterExit=yes
    9. [Install]
    10. WantedBy=multi-user.target

    Enable it:

    1. sudo systemctl daemon-reload
    2. sudo systemctl enable chat-stack
    3. sudo systemctl start chat-stack

    If the callback service also runs on the host, create a separate systemd unit and set Restart=always.

    2. Logging and Monitoring

    Common check commands:

    1. docker compose ps
    2. docker stats --no-stream
    3. df -h
    4. free -h
    5. ss -lntp

    At minimum, monitor CPU, memory, disk, container restart counts, HTTP status codes, callback error rate, and certificate expiry.

    3. Backup

    Example of backing up a data volume:

    1. cd /opt/chat-stack
    2. docker run --rm \
    3. -v open-webui:/data \
    4. -v "$PWD":/backup \
    5. alpine tar czf /backup/open-webui-$(date +%F).tar.gz -C /data .

    Note that when the backup runs as root inside the container, the resulting backup file may be owned by root. To avoid permission issues during later recovery or migration, check and fix ownership after the backup:

    1. ls -l ./open-webui-*.tar.gz
    2. sudo chown -R deployer:deployer ./open-webui-*.tar.gz

    You can also try backing up as the current user:

    1. docker run --rm \
    2. -u "$(id -u):$(id -g)" \
    3. -v open-webui:/data \
    4. -v "$PWD":/backup \
    5. alpine tar czf /backup/open-webui-$(date +%F).tar.gz -C /data .

    If the current user lacks permission on files inside the data volume, this method may fail; in that case, back up as root and then fix the host file ownership.

    Recovery example:

    1. cd /opt/chat-stack
    2. docker compose down
    3. docker run --rm \
    4. -v open-webui:/data \
    5. -v "$PWD":/backup \
    6. alpine tar xzf /backup/open-webui-2026-01-01.tar.gz -C /data
    7. docker compose up -d

    After recovery, you must verify:

    1. docker compose ps
    2. curl -sS -o /dev/null -w "%{http_code}\n" http://127.0.0.1:3000
    3. docker compose logs --tail=100 open-webui

    For virtual machines, take snapshots regularly, especially before upgrades, configuration changes, and database migrations.

    4. Upgrade and Rollback

    Back up before upgrading. If something breaks afterward, you can roll the image back:

    1. cd /opt/chat-stack
    2. docker compose down
    3. nano docker-compose.yml
    4. docker compose up -d
    5. docker compose logs --tail=200 open-webui

    For a virtual machine, you can restore the most recent snapshot directly. Do not upgrade a production instance without verification.

    9. Common Errors and Troubleshooting Checklist

    Symptom Possible Cause Diagnostic Command Suggested Fix
    Cannot log in via SSH Wrong key, firewall, sshd config error, security-group restriction sudo sshd -t, sudo journalctl -u ssh -u sshd -e, `ss -lntp \ grep 22` Keep the current session, fix the key and config, then restart SSH; on failure, restore the backup config
    Service not listening Container exited, wrong port mapping, process crash docker compose ps, `ss -lntp \ grep 3000,docker compose logs` Check container logs, fix the port or environment variables
    Permission error Wrong directory ownership, .env permissions too open, container UID mismatch ls -l, id deployer, docker compose exec id Restore ownership, restrict .env to 600
    Channel auth fails App Secret, Token, or Encrypt Key mismatch; wrong callback signature `grep -E “FEISHU\ auth\ callback” app.log` Verify open-platform parameters, reconfigure certificates or keys
    Fails to start after upgrade New-version config changes, database incompatibility, wrong image tag docker compose logs, docker images Roll back the previous image or restore the VM snapshot
    Feishu callback returns 404 Reverse-proxy path not matched, callback service not running, Open WebUI has no such route `ss -lntp \ grep 8787,curl -I https://chat.example.com/feishu/callback`, sudo caddy validate Start the independent callback service, check Caddy path forwarding
    Feishu callback returns 502 Callback service crashed, wrong listen port, upstream timeout journalctl -u callback, `ss -lntp \ grep 8787,sudo journalctl -u caddy -e` Check the callback service log, fix the port or dependencies
    docker compose subcommand not found Compose plugin not installed, or an older docker-compose was installed docker compose version, docker-compose --version, apt-cache policy docker-compose-plugin Install docker-compose-plugin, or temporarily use docker-compose

    General rollback principle: restore data and configuration first, then the service version; if the virtual machine has a snapshot, restore the whole machine first to avoid a half-upgraded state.

    10. FAQ

    How do I choose the minimum configuration for a self-hosted chat service?

    If you only need the front-end page, API forwarding, and a few channel connections, 2 vCPU and 4GB is enough to start. If you also need local retrieval, log analysis, and multiple concurrent bots, start at 4 vCPU and 8GB. If you run a local large model, evaluate the GPU, VRAM, and memory separately.

    Where should I look first when installation fails?

    Check three layers. First, the system and network, such as DNS, firewall, and ports. Second, the runtime, such as the Node.js or Python version. Third, the application logs. For Docker deployments, start with docker compose logs; for virtual machines, start with journalctl.

    What should I watch for when integrating a channel?

    Prefer HTTPS, do not put keys in code, ensure the callback address is verifiable, and make event handling idempotent. If your domain is hosted in the cloud, also watch for DNS configuration, security-group rules, and certificate renewal.

    How do I roll back after an upgrade breaks something?

    For containers, keep the previous image tag and, if needed, run docker compose down and switch back to the old version; for virtual machines, take a snapshot before upgrading and restore it on failure. After rolling back, always verify the service port, login, and channel callback.

    Can Open WebUI connect to Feishu directly?

    Usually not directly. Open WebUI provides a web chat interface and a basic API, but no routes for Feishu event subscription, decryption, signature verification, or message callbacks. For production integration, add an independent callback service or adapter layer: the callback service receives Feishu events, then calls Open WebUI or an internal chat service to produce a reply.

    11. Summary

    The key to self-hosting an AI chat service is not copying any single official document, but building a reusable deployment method: first define the hardware and runtime form, then set up a secure SSH base environment, then get a Docker minimal service running with concrete commands, then connect a Feishu bot through an independent callback service, and finally guarantee long-term stability with logging, backup, and rollback. Following this path, you get a self-managed service that keeps data under your control, has a clear configuration, can be customized, and runs reliably over the long term.