docs/setup/dev-setup.md
This guide will show you how to setup a local development environment for Agent Zero in a VS Code compatible IDE, including proper debugger.
[!WARNING] This guide is for developers and contributors. It assumes you have a basic understanding of how to use Git/GitHub, Docker, IDEs and Python.
[!NOTE]
- Agent Zero runs in a Docker container, this simplifies installation and ensures unified environment and behavior across systems.
- Developing and debugging in a container would be complicated though, therefore we use a hybrid approach where the python framework runs on your machine (in VS Code for example) and only connects to a Dockerized instance when it needs to execute code or use other pre-installed functionality like the built-in search engine.
[!NOTE] I will be using clean VS Code, Conda and Docker Desktop in this example on MacOS.
git clone https://github.com/agent0ai/agent-zero in your desired directory.[!NOTE] In my case, I used
cd ~/Desktopandgit clone https://github.com/agent0ai/agent-zero, so my project folder is~/Desktop/agent-zero.
.vscode folder that contains basic setup, recommended extensions, and debugger profiles. These will help us a lot.File > Open Folder and select your folder, in my case ~/Desktop/agent-zero..vscode/extensions.json file. It contains Python language support, debugger and error helper, install them by confirming the popup or manually in Extensions tab of your IDE. These are the extensions mentioned:usernamehw.errorlens
ms-python.debugpy
ms-python.python
Now when you select one of the python files in the project, you should see proper Python syntax highlighting and error detection. It should immediately show some errors, because we did not yet install dependencies.
+ Create Virtual Environment button. You might be prompted to select the environment manager if you have multiple installed. I have venv and Conda, I will select Conda here. I'm also prompted for desired python version, I will select 3.12, that is known to work well.
Terminal > New Terminal or clicking the + button in the terminal tab. Your terminal prompt should now start with your environment name/path, in my case (/Users/frdel/Desktop/agent-zero/.conda) This shows the environment is active in the terminal.pip install -r requirements.txt
PLAYWRIGHT_BROWSERS_PATH=tmp/playwright playwright install chromium --only-shell
The first command installs Python dependencies. The second installs the Chromium headless shell into tmp/playwright ahead of time (same path in Docker: /a0/tmp/playwright). If you skip the second command, local development still downloads the shell on first browser use through ensure_playwright_binary() in plugins/_browser/helpers/playwright.py. Pre-installing avoids that wait. Docker images ship the shell preinstalled; runtime install is for local dev when the binary is missing.
Errors in the code editor caused by missing packages should now be gone. If not, try reloading the window.
Great work! Now you should be able to run Agent Zero from your IDE including real-time debugging. It will not be able to do code execution and few other features requiring the Docker container just yet, but most of the framework will already work.
.vscode/launch.json.The framework will run at the default port 5000. If you open http://localhost:5000 in your browser and see ERR_EMPTY_RESPONSE, don't panic, you may need to select another port like I did for some reason. If you need to change the default port, you can add "--port=5555" to the args in the .vscode/launch.json file or you can create a .env file in the root directory and set the WEB_UI_PORT variable to the desired port.
You can also set the bind host via "--host=0.0.0.0" (or WEB_UI_HOST=0.0.0.0).
It may take a while the first time. You should see output like the screenshot below. The RFC error is ok for now as we did not yet connect our local development to another instance in docker.
After inserting my API key in settings, my Agent Zero instance works. I can send a simple message and get a response. ⚠️ Some tools like code execution will not work yet as they need to be connected to a Dockerized instance.
python/api/message.py for example and place a breakpoint at the beginning of the communicate function by clicking on the left of the row number. A red dot should appear showing a breakpoint is set.agent0ai/agent-zero from Docker Hub and run it with a web port (80) mapped and SSH port (22) mapped.
If you want, you can also map the /a0 folder to our local project folder as well, this way we can update our local instance and the docker instance at the same time.
This is how it looks in my example: port 80 is mapped to 8880 on the host and 22 to 8822, /a0 folder mapped to /Users/frdel/Desktop/agent-zero:
RFC Password field to a new password and save.RFC Password field to the same password you used in the dockerized instance. Also set the SSH port and HTTP port the same numbers you used when creating the container - in my case 8822 for SSH and 8880 for HTTP. The RFC Destination URL will most probably stay localhost as both instances are running on the host machine.My Dockerized instance:
My VS Code instance:
Agent Zero runs code inside the container by default. If you are running the framework locally in your IDE but want tools (like code execution) to run in Docker, configure RFC in Settings -> Development and point it to a running Agent Zero container. This routes execution through SSH/RFC to the container while keeping the UI and agent loop on your host.
You have successfully set up a complete Agent Zero development environment! You now have:
You're now ready to contribute to Agent Zero, create custom extensions, or modify the framework to suit your needs. Happy coding!
For development and testing, you can override default settings using the .env file with A0_SET_ prefixed variables:
# Add to your .env file
A0_SET_chat_model_provider=ollama
A0_SET_chat_model_name=llama3.2
A0_SET_chat_model_api_base=http://localhost:11434
A0_SET_memory_recall_interval=5
These environment variables automatically override the hardcoded defaults in get_default_settings() without modifying code. Useful for testing different configurations or multi-environment setups.
DockerfileLocal to build your docker image.docker build -f DockerfileLocal -t agent-zero-local --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) .CACHE_DATE argument is optional, it is used to cache most of the build process and only rebuild the last steps when the files or dependencies change.docker/run/build.txt for more build command examples..github/workflows/docker-publish.yml. The latest eligible main tag generates its GitHub release body on the fly from commit subjects and descriptions via OpenRouter.