="zh">
TDengine is a time-series database optimized for IoT workloads. Its design feels like a hybrid between MySQL sharding proxies and MongoDB’s document model, yet it remains approachable for newcomers. Below is a concise guide to spinning up a single-node instance inside Docker on an Alibaba Cloud Elastic Compute Service (ECS) instance and connecting to it from both Linux and Windows clients.
Lanuching the Container
docker run -d \
--name tdengine-solo \
-p 6030-6040:6030-6040/tcp \
-p 6030-6040:6030-6040/udp \
-p 6041:6041/tcp \
-v /opt/tdengine/data:/var/lib/taos \
--cpus 1 \
--memory 4g \
tdengine/tdengine:2.div>
<p>The container exposes the following ports:</p>
<ul>
<li><strong>6030-6040</strong> – RPC and native protocol (TCP & UDP)</li>
<li><strong>6041</strong> – RESTful HTTP interface</li>
<li><strong>6042</strong> – Arbitrator port for clusters (can be omitted for a single node)</li>
</ul>
<p>Notes:</p>
<ul>
<li>TDengine ≥ 2.0 uses FQDN for node identification; inside the container the hostname equals the container ID.</li>
<li>Bind-mount /var/lib/taos to the host so data survives container recreation and you can run the CLI inside the container without root privileges.</li>
</ul>
<h2>Client Setup</h2>
<p>Keep server and client versions identical to avoid protocol mismatches.</p>
<h3>Linux</h3>
# Example for Ubuntu 20.04
wget https://www.tdengine.com/assets/TDengine-client-2.x.x-Linux-x64.tar.gz
tar -xzf TDengine-client-2.x.x-Linux-x64.tar.gz
sudo ./install_client.sh
<p>After installation, libtaos.so is automatically placed in /usr/lib, which is already on the dynamic linker path.</p>
<h3>Windows</h3>
<p>Download the MSI installer from the official site. The installer drops taos.dll into C:\Windows\System32, so no additional PATH tweaks are needed.</p>
<h2>Network & Host Resolution</h2>
<p>TDengine clients resolve the server via FQDN. Because the container’s hostname is its Docker ID, map that ID to the ECS public IP on every client machine.</p>
<h3>Linux / macOS</h3>
echo "47.100.123.45 4f7a8c3b9e12" | sudo tee -a /etc/hosts
<h3>Windows</h3>
<p>Edit C:\Windows\System32\drivers\etc\hosts and append:</p>
47.100.123.45 4f7a8c3b9e12
<p>Now connect from any client:</p>
taos -h 47.100.123.45
<h2>Alibaba Cloud Security Group</h2>
<p>In the ECS console, open <strong>Network & Security → Security Groups</strong>. Add two rules:</p>
<table>
<tr><th>Port Range</th><th>Protocol</th><th>Source</th></tr>
<tr><td>6030-6041</td><td>TCP</td><td>0.0.0.0/0 or your office IP</td></tr>
<tr><td>6030-6040</td><td>UDP</td><td>0.0.0.0/0 or your office IP</td></tr>
</table>
<h2>Recreating the Container</h2>
<p>If you ever remove and recreate the container, delete the host-side data directory first; stale metadata can prevent the new instance from starting:</p>
sudo rm -rf /opt/tdengine/data/*
docker rm -f tdengine-solo
# then re-run the docker run command above
<p>With these steps you have a fully functional single-node TDengine instance reachable from both local and remote clients.</p>