AI

Install Tencent LoopForge on Linux and Run an Agent Workflow

LoopForge gives your coding agents a pipeline with a stop button. You draw an SOP out of Script, Agent and Human gate steps, and each run pauses at every gate until you approve, add context or send it back. Tencent released it under the MIT license, and one script brings up the stack with Docker.

Original content from computingforgeeks.com - post 194100

This guide takes you from a bare server to a locked-down install behind HTTPS, a demo run through the human gate, a custom SOP and an Agent step driven by a local model. Built and run on Ubuntu 26.04 with LoopForge v0.4.0 in November 2026.

Check the prerequisites

LoopForge runs as two containers, the platform and MySQL, and it starts one more container for every run. The idle footprint is small, but the images are not, so you plan disk before CPU. Have these ready before you start:

  1. A 64-bit Linux server with git and sudo. The lab used Ubuntu 26.04; the installer pulls Docker in through get.docker.com if it isn’t there.
  2. At least 15 GB free for images. The LoopForge image alone takes 4.3 GB on disk and MySQL another 1.1 GB.
  3. A DNS name pointing at the server and ports 80 and 443 open, for the HTTPS step. Keep port 8090 closed to the internet.
  4. API keys for the agent CLIs you plan to use, or a local model server. The script and gate steps need no key at all.

The lab host was a GCP e2-standard-8 with 8 vCPU and 32 GB. At idle the platform used 12.8 MiB and MySQL 460.6 MiB, so that box is far bigger than a script-only install needs. Size the server by what your agents do, because the agent CLI is where the CPU and memory go. When the agents call hosted models, 4 vCPU and 8 GB is a sensible floor. A local model on the same host wants every core and gigabyte you can give it, and the agent section below shows how slow it gets on CPU alone.

Install LoopForge with start.sh

Ask GitHub for the latest stable tag first, so you clone a release instead of whatever sits on main. The tag matters more than usual here, because the checkout pins the platform image and ships the migrations that match it. The releases API skips prereleases, so you won’t land on the release candidate that was already tagged when this was written.

LOOPFORGE_VERSION=$(curl -s https://api.github.com/repos/Tencent/LoopForge/releases/latest | grep -m1 '"tag_name"' | cut -d'"' -f4)
echo "$LOOPFORGE_VERSION"

It printed the tag this guide was tested on:

v0.4.0

Clone that tag and run the installer from the checkout. The image tag is pinned inside compose.yaml, so the git tag you check out decides which platform image you get.

git clone --branch "$LOOPFORGE_VERSION" https://github.com/Tencent/LoopForge.git ~/LoopForge
cd ~/LoopForge
time ./start.sh

On a fresh host the script installs Docker, writes a .env with unique database and session secrets, pulls both images and loads the starter catalog. The whole run took 2m8s on the lab VM. Look for the green line and the access URLs at the end.

start.sh output ending with LoopForge is running and the access URLs on Ubuntu

Notice what the default does. It binds to every interface and tells you to open TCP 8090 in your cloud firewall, which you should not do. Signup is open by default too, so the first stranger to reach that port could create the administrator account and own the platform. The lock-down section fixes both, and until then you reach the UI through an SSH tunnel.

Confirm the image you pulled matches the digest on the release page before you trust it with your repos.

sudo docker image inspect ghcr.io/tencent/loopforge:0.4.0 --format '{{index .RepoDigests 0}}'

The lab pull returned the published digest.

ghcr.io/tencent/loopforge@sha256:87b6a3e3cba201d03f8f8d22929881f576021fc78c7c42e82f78329abbf4bda4

Use sudo with every Docker command here. The installer does not add your user to the docker group; it calls sudo docker itself. Keep it that way, because membership in that group is root on the host, and the sandbox section shows why that matters for LoopForge in particular.

Create the admin over an SSH tunnel

Forward the port from your workstation instead of exposing it. Run this on your laptop, not the server, and leave the session open.

ssh -L 8090:127.0.0.1:8090 [email protected]

Open http://localhost:8090 in your browser. On a fresh install LoopForge skips the login and asks for the first account, which becomes the administrator. The UI loads in Chinese for some browsers; the 中 / EN toggle in the top bar switches it to English.

LoopForge first-run page to create the administrator account
  1. 1Admin username and password
  2. 2Create and continue

Enter the admin username and password, using a long one, then click Create and continue. The form only demands six characters, which is far too short for an account that can run containers on your host. Treat it like a root password, because in practice that’s what it is.

Lock down signup and add HTTPS

Three settings in .env close the gaps the installer leaves. You turn off self-registration, bind the port to loopback so only the reverse proxy reaches it, and mark the session cookie Secure. The loop removes any existing line for each key first, so you never end up with two values for one setting.

cd ~/LoopForge
for k in AGENTFLOW_ALLOW_SIGNUP LOOPFORGE_BIND AGENTFLOW_SECURE_COOKIES; do sed -i "/^$k=/d" .env; done
printf "%s\n" AGENTFLOW_ALLOW_SIGNUP=false LOOPFORGE_BIND=127.0.0.1 AGENTFLOW_SECURE_COOKIES=true >> .env
./start.sh

The rerun recreates only the platform container and keeps your data. Its closing lines confirm the bind changed.

✓ LoopForge is running
  This machine: http://127.0.0.1:8090
  Local access only. Set LOOPFORGE_BIND=0.0.0.0 and LOOPFORGE_PUBLIC_URL in .env for team access.

Ignore the hint about 0.0.0.0, since nginx will be the public face and talks to LoopForge over loopback. Install it with certbot and its nginx plugin.

sudo apt update
sudo apt install -y nginx certbot python3-certbot-nginx

Create the site file. LoopForge streams run logs and uses WebSockets, so the proxy needs the upgrade headers, buffering off and a long read timeout. Leave any of them out and you’ll see live traces stall mid-run while the run itself carries on.

sudo vim /etc/nginx/sites-available/loopforge

Paste this, with your own name in server_name.

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {
    listen 80;
    server_name loopforge.example.com;

    client_max_body_size 50m;

    location / {
        proxy_pass http://127.0.0.1:8090;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_buffering off;
        proxy_read_timeout 3600s;
    }
}

Enable the site, drop the default one and check the syntax before reloading.

sudo ln -sf /etc/nginx/sites-available/loopforge /etc/nginx/sites-enabled/loopforge
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl reload nginx

Now request the certificate. Use a real mailbox for the ACME account, because Let’s Encrypt refuses example.com addresses outright. That refusal is the second error in the troubleshooting section.

sudo certbot --nginx -d loopforge.example.com -m [email protected] --agree-tos --non-interactive --redirect

Certbot edits the site file, adds the 301 redirect from HTTP and schedules renewal. A good run ends like this.

Deploying certificate
Successfully deployed certificate for loopforge.example.com to /etc/nginx/sites-enabled/loopforge
Congratulations! You have successfully enabled HTTPS on https://loopforge.example.com

Prove the lock-down from a machine outside the server. The setup endpoint reports whether signup is open, and a registration attempt should bounce.

curl -s https://loopforge.example.com/api/auth/setup
curl -s -X POST https://loopforge.example.com/api/auth/register -H "Origin: https://loopforge.example.com" -H "Content-Type: application/json" -d '{"login":"visitor","password":"Visitor-Pass-2026"}' -w "\nHTTP %{http_code}\n"
curl -s -o /dev/null -w '%{http_code} -> %{redirect_url}\n' http://loopforge.example.com/

All three came back the way you want them.

curl checks showing LoopForge signup disabled over HTTPS and HTTP redirecting to HTTPS

signupEnabled is false, the register call gets HTTP 403 with a Chinese message that means “self-registration is closed, ask the administrator to create an account”, and plain HTTP redirects to HTTPS. In the browser, the login page now reads “Ask your deployment administrator to create an account.”, and the agentflow_user cookie carries the Secure, HttpOnly and SameSite=Lax flags. On the server, sudo ss -ltnp | grep 8090 should show only 127.0.0.1:8090.

One more thing to know before you hand out accounts. The platform container runs as root with /var/run/docker.sock mounted, and LoopForge’s own deployment guide says plainly that Docker socket access is equivalent to root on the host. Anyone who controls the platform controls the host, and anyone you let run SOPs executes code in containers on that host. Give LoopForge its own VM, never a box that holds other services or secrets.

Run the Platform check SOP

The starter catalog ships a demo SOP that needs no API key. A shell script writes a report, a human gate waits for you, and a last step finishes. It’s the quickest way for you to see the gate before you wire in agents, so open Settings, then Templates.

LoopForge Templates page with the Platform check script and approval SOP
  1. 1Templates
  2. 2Open the demo SOP

Open the demo SOP by clicking Platform check · script & approval, which loads it in the designer. The canvas shows the three nodes and the dashed red edge that sends work back to the script when the gate rejects it.

LoopForge SOP designer showing script, human gate and finish nodes with the Run SOP button

Click ▶ Run SOP, type a short task input such as “Platform check” and start the run. The script finishes in well under a second and the run page stops on the gate with three choices for you.

LoopForge run paused at the human gate with approve, add context and send back buttons
  1. 1Optional note
  2. 2Approve
  3. 3Add context
  4. 4Send back

Type an optional note in the box above the buttons when you want the reviewer’s reasoning on record. Each button does something different to the run, and the server log shows the API call behind it. These lines came from one run where every button was tried in turn, which you can read with ./start.sh logs.

2026/11/22 21:13:49 [HTTP] POST /api/runs/run-1795381993487881628/reject -> 200 (35 bytes, 53ms)
2026/11/22 21:14:05 [HTTP] POST /api/runs/run-1795381993487881628/retry -> 200 (35 bytes, 60ms)
2026/11/22 21:14:19 [HTTP] POST /api/runs/run-1795381993487881628/approve -> 200 (35 bytes, 53ms)
2026/11/22 21:14:27 cleaned terminal workspace run-1795381993487881628

In order, the three choices did this.

  1. Send back opens a “Send back for rework” dialog that won’t submit without a reason, then reruns the script as attempt 2 and counts one rework.
  2. Add context and rerun this step reruns the gate step itself with your note attached, which showed up as attempt 3.
  3. Approve and continue releases the run to the last step.

The run finished 3 / 3 with “End-to-end 1.1m (waiting 1.1m)”. The machine time was about a second and the rest was a person deciding. Every attempt is kept as an immutable snapshot, so a sent-back report and its rework sit side by side on the run page. A clean second run with a single approval kept three snapshots.

Finished LoopForge run with 3 of 3 steps done and immutable snapshots

That audit trail is the real product. An approval is a recorded decision tied to a specific artifact version, not a chat message somebody may or may not have read. So when an agent change breaks something a week later, you can see who approved which version of the output and what they were looking at.

See where the scripts actually run

The designer labels the demo SOP “Local execution (trusted tasks only)”, which reads as if scripts run on your host. They do not. Watch Docker events in a second SSH session while you start a run.

sudo docker events --filter type=container --filter event=create --filter event=start --filter event=kill --filter event=die --filter event=destroy --format '{{.Action}} {{.Actor.Attributes.name}} {{.Actor.Attributes.image}}'

Every run gets its own container from the platform image, named after the run ID, and it is destroyed when the run ends.

create agentflow-run-1795382563837290372 ghcr.io/tencent/loopforge:0.4.0
start agentflow-run-1795382563837290372 ghcr.io/tencent/loopforge:0.4.0
kill agentflow-run-1795382563837290372 ghcr.io/tencent/loopforge:0.4.0
die agentflow-run-1795382563837290372 ghcr.io/tencent/loopforge:0.4.0
destroy agentflow-run-1795382563837290372 ghcr.io/tencent/loopforge:0.4.0

The deployment guide confirms it. The “local” driver still runs in a Docker sandbox by default (AGENTFLOW_LOCAL_SANDBOX=docker), a sibling container on the Compose network. In the lab that network was loopforge_default, and agent runs also started a -browser sidecar next to the run container. The custom SOP below gives it away too, because the hostname inside the script is a container ID, not your server’s name.

The platform itself is the part with host power. Check what it runs as and what it can reach.

sudo docker exec loopforge-platform-1 sh -c 'id; ls -l /var/run/docker.sock; command -v docker'

You get root, the host socket and the Docker CLI, all inside the container.

uid=0(root) gid=0(root) groups=0(root)
srw-rw---- 1 root 986 0 Nov 22 21:06 /var/run/docker.sock
/usr/local/bin/docker

So the sandbox keeps one run’s files away from another’s, but it is not a security boundary against whoever controls the platform. Run containers don’t get the socket, so an SOP author’s code stays in its sibling container; an admin account or a compromise of the platform itself reaches every container and file on the host. That’s why the dedicated VM and closed signup above aren’t optional.

Build a custom SOP

Next, build one from scratch that collects disk and memory usage, stops for your sign-off, then writes a signed report. Click + New SOP on the Templates page, then:

  1. Add a Script node named “Collect disk usage” with the first script below.
  2. Add Human gate from the palette, name it “Sign off the disk report” and point its Send back to setting at the first node.
  3. Add a second Script node named “Write signed report” with the second script.
  4. Drag Success to next step: pull each node’s green Success port onto the next node to connect them, then Save and Publish version.

Connecting nodes is the step people miss. Dropping nodes on the canvas does not link them, so an SOP with loose nodes won’t run them in order. Check that you see a solid line between each pair and a dashed red send-back line from the gate before you publish.

Custom LoopForge SOP with Script and Human gate nodes in the designer
  1. 1Add Human gate
  2. 2Drag Success to next step
  3. 3Send back to

The first script writes its report under reports/ in the run workspace, which every later step can read.

mkdir -p reports
echo "# Disk check on $(hostname)" > reports/disk.md
df -h / >> reports/disk.md
free -m >> reports/disk.md
cat reports/disk.md

The last script refuses to sign an empty report, so a broken first step can’t slip past the gate quietly.

test -s reports/disk.md || { echo 'reports/disk.md missing'; exit 1; }
printf 'Signed off at %s\n' "$(date -u +%FT%TZ)" | tee reports/signed.txt

Run it and the first step’s output lands on the gate page for your review. The root filesystem shows as overlay and the hostname is a container ID, more proof the script ran in the sandbox.

# Disk check on 7c7a99e042e3
Filesystem      Size  Used Avail Use% Mounted on
overlay          48G  8.8G   39G  19% /
               total        used        free      shared  buff/cache   available
Mem:           32087        1533       23658           1        7348       30553
Swap:              0           0           0

Approve it and the last step prints Signed off at 2026-11-22T21:22:48Z. If shell scripting like this is new territory, the Linux Commands Cheat Sheet covering files, grep, find and processes is a good companion for writing Script nodes that check real things.

Add an Agent step with a local model

An Agent node hands a step to a coding CLI. The role dropdown offers ten of them, from CodeBuddy and Codex to Claude Code, OpenCode, Cursor CLI and DeepSeek Harness, but the platform image bundles only three. The deployment guide and the image itself agree on how each one gets there:

  1. Bundled in /usr/local/bin: codebuddy, codex and dsh (DeepSeek Harness).
  2. Installed on first use: Claude Code, OpenCode, Kimi Code and Pi. An SOP sandbox downloads them automatically the first time it selects one; in a conversation you click the install button the error offers.
  3. Never installed into SOP sandboxes: Cursor CLI and Antigravity, which use their providers’ installers and land in the service user’s ~/.local/bin.

The Claude Code and Codex legs were not run for this guide because no API keys were available, so treat them as untested here. If you’re on those tools, the Claude Code cheat sheet and the Codex CLI cheat sheet cover the flags each CLI takes, and the SOP wiring below is the same whichever CLI you pick.

DeepSeek Harness talks to any OpenAI-compatible endpoint, so a local Ollama works with no key. Start Ollama on the LoopForge network so run containers can reach it by name, then pull a small model.

sudo docker run -d --name ollama --network loopforge_default -e OLLAMA_CONTEXT_LENGTH=32768 -v ollama:/root/.ollama ollama/ollama:latest
sudo docker exec ollama ollama pull qwen3:1.7b

The larger context length matters because agent CLIs send long system prompts and tool definitions, and a short window silently truncates them. The model then ignores the tools it was never shown. With Ollama up, you wire it into LoopForge in four steps.

  1. In Personal settings, add a DeepSeek Harness credential with key ollama, base URL http://ollama:11434/v1 and the Chat Completions API.
  2. In Settings, Roles, click + New role, pick the “Independent review” template, set the CLI to DeepSeek Harness and choose qwen3:1.7b, which LoopForge discovers from /v1/models.
  3. Replace the role’s task prompt with: “Read reports/disk.md in the run workspace. Write reports/review.md with three short lines: the root filesystem use percentage, the available memory in MiB, and a verdict of OK or WARN (WARN when root use is above 80 percent). Do not change any other file.”
  4. Drag the role onto the canvas after “Write signed report”, connect it, and publish the new version.

The run worked end to end, and the step page shows you exactly what happened, with dsh · qwen3:1.7b, 15k tokens, 4 tool calls and $0.0000 on the card.

LoopForge agent step run by DeepSeek Harness on a local Ollama qwen3 model

Now the honest part. The step took 17.2 minutes on 8 CPU cores, across five chat completion calls that ran between 59 seconds and 6m20s each. The agent reported that it wrote reports/review.md. It did not. It wrote review.md at the workspace root, with numbers it made up.

Root filesystem use percentage: 75%
Available memory: 1536 MiB
Verdict: OK

The real report said 38% and 30356 MiB. So the plumbing is sound, since LoopForge launched the CLI in the sandbox, routed it to Ollama and recorded every token. A 1.7B model on CPU is still not a reviewer you can trust. Use a hosted model or a GPU-backed local one for real work, and put a human gate after every Agent step, because this run is exactly the case the gate exists for. The guides on getting started with DeepSeek Harness and running it against a local model cover choosing a stronger model.

Upgrade within the 0.4.x line

Upgrades follow the same tag-then-script pattern as the install. You check out the new tag, then let start.sh pull fetch the image pinned for it and recreate the containers that changed. The first line repeats the release lookup, so the block works in a fresh shell.

LOOPFORGE_VERSION=$(curl -s https://api.github.com/repos/Tencent/LoopForge/releases/latest | grep -m1 '"tag_name"' | cut -d'"' -f4)
cd ~/LoopForge
git fetch --tags
git checkout "$LOOPFORGE_VERSION"
./start.sh pull

A pull on an already current install reports the extensions as present and leaves your data alone.

 Container loopforge-platform-1 Healthy
 Container loopforge-mysql-1 Healthy
Already installed: run_telemetry.adapter
Already installed: run_logs.level

Not every migration runs by itself. Read the CHANGELOG entry for each release you skip, because the deployment guide splits migrations into three kinds and only one of them is automatic.

Migration kindExamplesWhat you do
Schema and seeds001, the seed files, 031Nothing: the installer and pull apply them
One-time fixes009_bot_interactions_utf8mb4.sqlRun once by hand when the CHANGELOG lists it
Backfills016, 021Run by hand if old rows matter; skipping changes no schema

Feed a hand-run migration into the MySQL container with the credentials it already holds, so you never type the database password. Run it from the checkout directory.

sudo docker compose exec -T mysql sh -c 'MYSQL_PWD="$MYSQL_PASSWORD" mysql -u loopforge loopforge' < migrations/009_bot_interactions_utf8mb4.sql

Two more upgrade notes. Old cli/toolchain/<build>/ directories stay behind at about 200 MB each, so delete the ones from previous builds. And the release notes say installs on the last 0.3.x release candidate can move straight to this release the same way. Leave release candidates alone on a box people depend on. The v0.4.0 release page lists the image digest to check against after every pull.

Fix errors hit in the lab

Each of these came up during the test run, with the fix that worked.

permission denied while trying to connect to the docker API at unix:///var/run/docker.sock

Plain docker ps fails right after the install because start.sh installs Docker but doesn’t add your user to the docker group. Prefix the command with sudo. Adding yourself to the group works too, but it hands your login the same root-equivalent power the platform has, so keep it off shared accounts. The installer itself never needs the group, because it validates sudo up front and runs every Compose and schema command through sudo -n docker.

The ACME server believes [email protected] is an invalid email address

Let’s Encrypt rejects reserved domains such as example.com for the account email, so certbot stops before it requests anything. Pass a real address with -m. The lab finished with --register-unsafely-without-email, which works but leaves the ACME account with no contact for recovery or policy notices.

Designer save fails after another tab edits the SOP

The designer checks revisions, so saving from a stale tab returns a conflict saying someone else updated the SOP, even when that someone is you in a second tab. Reload the designer, redo the edit and save again. Toasts from the failed save can also sit over the Publish version button for a few seconds, so wait for them to clear before you click it. Keep one designer tab per SOP and you won’t hit the conflict at all.

Agent step reports success but the file is missing

The step status reflects what the agent claims, not whether the file exists where you asked. Add a Script node after the agent with test -s reports/review.md, just like the signing step, so a missing or misplaced file fails the run instead of reaching the gate. For more patterns on keeping agents honest in ops work, see AI coding agents for DevOps with Terraform, Ansible and Kubernetes.

Keep the start.sh commands handy

Everything day to day goes through start.sh in the checkout, and the deployment guide documents each verb.

CommandWhat it does
./start.shInstall on first run, start or apply .env changes after that
./start.sh logsFollow the platform logs
./start.sh stopStop the stack
./start.sh downRemove the containers, keep the data volumes
./start.sh restartRestart the platform container
./start.sh pullRefresh the pinned images and recreate changed containers
MIRROR=ghcr.nju.edu.cn ./start.shPull through a mirror when ghcr.io is slow or blocked

That’s the full loop, with a pinned install, a closed front door, a gate that records every decision and an agent step you don’t have to trust blindly. To give the agents tools beyond the shell, the guide to setting up MCP servers for Claude Code is the next piece to add.

Keep reading

Open Source LLM Comparison Table (2026) AI Open Source LLM Comparison Table (2026) Ollama Models Cheat Sheet: Best Models by VRAM, Tested (PDF) AI Ollama Models Cheat Sheet: Best Models by VRAM, Tested (PDF) OpenCode CLI Cheat Sheet: Commands, Sessions and Fixes (PDF) AI OpenCode CLI Cheat Sheet: Commands, Sessions and Fixes (PDF) Install InvokeAI 7 on Linux with NVIDIA: Tested VRAM per Model AI Install InvokeAI 7 on Linux with NVIDIA: Tested VRAM per Model Install openSUSE with Claude Code: Agama MCP Server Tested AI Install openSUSE with Claude Code: Agama MCP Server Tested GPU Prices Right Now: Black Friday Targets for Every Card AI GPU Prices Right Now: Black Friday Targets for Every Card

Leave a Comment

Press ESC to close