← All tools · Guides

Docker: deploy an open-source research agent with TradingAgents-CN

Agent series, part 2. Install Docker, start a multi-agent research team, and ask it about a stock from the browser.

Short answer: the official Docker script, then clone TradingAgents-CN, copy .env.example to .env, fill an LLM API key and a data-source token, and docker compose up -d. Open the port the README names.

How to choose: To run an open-source research agent on a server you control, install Docker with the official one-line script, clone the project, copy .env.example to .env, fill an LLM API key and a data-source token, then start it with docker compose up -d. This walkthrough uses TradingAgents-CN, a multi-agent project adapted for Chinese users and China A-share data sources. The project moves quickly, so the README wins on details. The four-step skeleton, install Docker, clone, set the keys, start the service, is the same shape for similar projects. Open the port the README names, often 8501 or 3000, and check the first report's price and market cap against your market software. This page is the Docker deploy. It is not the tool-order guide, not the site FAQ, not the note on opening a cloud server, and not the next article on wiring market data and an LLM API.

Who it is for: Someone who already has a cloud server and SSH, and wants a research agent in the browser: type a ticker, wait a few minutes, and read a report. In this example the agent is a team of roles, fundamentals, news sentiment, and technicals, that debate and then summarize. You still need an LLM API key and a data-source token. How to get those keys is the next article.

Who it is not for: Someone who does not have a machine yet. Opening an instance and connecting over SSH is a different article. Someone who wants the agent to send live orders, or who wants this page to pick the model and the market-data vendor, should read the next article on the model API and the market-data feed. A 2 GB machine can freeze while the container starts. This page adds a 2 GB swap file, or you resize to 4 GB. Do not commit a .env that contains keys. This page is not the tool-order guide and not the site FAQ.

The same walkthrough in Chinese is the Docker deploy of TradingAgents-CN. It is part 2 of that series. Opening an instance and connecting over SSH is opening a cloud server. The same note in Chinese is the Chinese cloud-server note. That note is not this article. The next part, a market-data token and an LLM API key, is market data and an LLM API. The same article in Chinese is the Chinese data-and-LLM article. That article is not this one either.

Facts and commands below follow the Chinese walkthrough. The commands were not re-run for this English page. Open-source projects move. If a port, an environment variable, or a supported data source disagrees with this page, the project README wins. This is not investment advice. Agent output is a research reference, not a reason to buy or sell.

01 · What you have when this step is done

An open-source research agent on your own server. Inside it is a virtual analyst team. Fundamentals, news sentiment, and technicals each do their job, debate each other, and then roll the result up into one report. You type a ticker in the web page and wait a few minutes for that report.

This walkthrough uses TradingAgents-CN, a multi-agent project adapted for Chinese users and China A-share data sources. The steps are the generic ones. Open-source projects move quickly, so the README wins on details. The skeleton, install Docker, clone, set the keys, start the service, is the same shape for similar projects.

02 · Install Docker: two commands

After you SSH into the server, run the official one-line script:

curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER   # current user can run docker without sudo
# log out and back in so the group applies
docker --version                # a version line means it worked
docker compose version          # the compose plugin is usually already there

03 · Clone the project and configure it

git clone https://github.com/hsliuping/TradingAgents-CN.git
cd TradingAgents-CN
cp .env.example .env            # the project ships an environment template
nano .env                       # edit it; the minimum set is the next paragraph

.env needs at least two kinds of values: an LLM API key (the next article is where you get one) and a data-source token (tushare is the example; the README lists what the project accepts). Save, then:

docker compose up -d            # background; the first run pulls images, so wait
docker compose ps               # STATUS Up or running means it worked
docker compose logs -f          # follow the log; Ctrl+C leaves the stack running

04 · Open the page and run a first analysis

Allow the project's public port in the security group. The README names the port. 8501 and 3000 are the common examples. Then, from a browser on your own computer, open http://YOUR_IP:PORT. Enter a ticker you already know and run it. The first run also checks the data source. The price and the market cap it cites should match your market software. If they do not, the data pipe is not right yet.

05 · Three commands for day-to-day use

docker compose restart          # pick up a change to .env
docker compose down             # stop
git pull && docker compose up -d   # update; read the release notes first

06 · Pitfalls, each one already paid for

The agent is a shell until it has a data source and an LLM key. The next article is that pipe, and it is still Chinese only:

Next: market data and an LLM API →

This tutorial is not investment advice. Agent output is a research reference, not a reason to buy or sell.

Part 2 of the research-agent series. Previous: open a cloud server. Next: market data and an LLM API.

Frequently asked questions

How to choose a Docker deploy for an open-source research agent?

To run an open-source research agent on a server you control, install Docker with the official one-line script, clone the project, copy .env.example to .env, fill an LLM API key and a data-source token, then start it with docker compose up -d. This walkthrough uses TradingAgents-CN, a multi-agent project adapted for Chinese users and China A-share data sources. The project moves quickly, so the README wins on details. The four-step skeleton, install Docker, clone, set the keys, start the service, is the same shape for similar projects. Open the port the README names, often 8501 or 3000, and check the first report's price and market cap against your market software. This page is the Docker deploy. It is not the tool-order guide, not the site FAQ, not the note on opening a cloud server, and not the next article on wiring market data and an LLM API.

Who it is for?

Someone who already has a cloud server and SSH, and wants a research agent in the browser: type a ticker, wait a few minutes, and read a report. In this example the agent is a team of roles, fundamentals, news sentiment, and technicals, that debate and then summarize. You still need an LLM API key and a data-source token. How to get those keys is the next article.

Who it is not for?

Someone who does not have a machine yet. Opening an instance and connecting over SSH is a different article. Someone who wants the agent to send live orders, or who wants this page to pick the model and the market-data vendor, should read the next article on the model API and the market-data feed. A 2 GB machine can freeze while the container starts. This page adds a 2 GB swap file, or you resize to 4 GB. Do not commit a .env that contains keys. This page is not the tool-order guide and not the site FAQ.

What do you have when this step is done?

An open-source research agent on your own server. Inside it is a virtual analyst team: fundamentals, news sentiment, and technicals each do their job, debate, and then roll the result up into one report. You type a ticker in the browser and wait a few minutes. This walkthrough uses TradingAgents-CN. The skeleton is install Docker, clone, set the keys, and start the service.

How do you install Docker?

After SSH, run the official script: curl -fsSL https://get.docker.com | sh. Then sudo usermod -aG docker $USER so the current user can run docker without sudo. Log out and back in. docker --version printing a version means it worked. docker compose version confirms the compose plugin, which is usually already there.

How do you clone the project and fill .env?

git clone https://github.com/hsliuping/TradingAgents-CN.git, cd into it, and cp .env.example .env. The minimum is two kinds of values: an LLM API key, which the next article covers, and a data-source token such as tushare. Which sources the project accepts is in the README. Then docker compose up -d starts it in the background. The first run pulls images. docker compose ps showing Up or running means it worked. docker compose logs -f follows the log, and Ctrl+C leaves the stack running.

How do you open the page and run a first analysis?

Allow the project's public port in the security group. The README names it. 8501 and 3000 are the common examples. In a browser on your own computer, open http://YOUR_IP:PORT. Enter a ticker you already know. The first run also checks the data source: the price and the market cap in the report should match your market software.

What are the three daily commands?

After you edit .env, docker compose restart. To stop, docker compose down. To update, git pull && docker compose up -d, and read the release notes first.

What pitfalls does this walkthrough call out?

Five. A 2 GB machine can freeze while the container starts. Add a 2 GB swap file, starting from sudo fallocate -l 2G /swapfile and the usual Ubuntu add-swap steps, or resize to 4 GB. If the page will not open, nine times out of ten the security group did not allow that port. If the image pull is slow or times out, configure a mirror accelerator. The Docker docs and the cloud vendor both publish a ready config, or retry later. The .env file holds API keys. chmod 600 .env, and do not commit a .env that contains keys to any public repository. Projects go quiet and interfaces change. Prefer one that people are still starring and whose issues get replies, and look at the latest commit time before you deploy.