> For the complete documentation index, see [llms.txt](https://docs.zer0.build/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zer0.build/for-developers/building-from-source.md).

# Building from Source

Build zer0 browser from source code for development or custom deployments.

***

## 📋 Prerequisites

* **Node.js** 16+
* **Git**
* **Tor Expert Bundle** for your platform
* **4 GB RAM** minimum

***

## 🚀 Quick Build

```bash
# Clone repository
git clone https://github.com/BrowserZer0/Zer0.git
cd Zer0

# Install dependencies
npm install

# Download Tor binary
# Windows: Place tor.exe in ./resources/win/Tor/
# Linux/Mac: Place tor in ./resources/lin/

# Run development mode
npm run electron-dev

# Build production
npm run build-win    # Windows
npm run build-mac    # macOS
npm run build-linux  # Linux
```

***

## 📁 Project Structure

```
zero_browser/
├── public/              # Electron main process
│   ├── electron.js     # Main entry
│   ├── preload.js      # Preload scripts
│   └── functions/      # Tor, updater, etc.
├── src/                # React UI
│   ├── components/     # UI screens
│   └── electron-tabs/  # Tab implementation
└── dist/              # Build output
```

***

## 🔧 Development

```bash
# Start dev server
npm start

# Run with Electron
npm run electron-dev

# Run tests
npm test

# Lint code
npm run lint
```

***

## 📦 Build Scripts

```json
{
  "electron-dev": "concurrently \"npm start\" \"electron .\"",
  "build-win": "electron-builder build --win",
  "build-mac": "electron-builder build --mac",
  "build-linux": "electron-builder build --linux"
}
```

***

## 🐛 Troubleshooting

**Tor not found:**

* Download from [torproject.org](https://www.torproject.org/download/tor/)
* Place in correct `resources/` folder

**Build fails:**

* Clear node\_modules: `rm -rf node_modules && npm install`
* Update Node: Use v16 or later

**Electron won't start:**

* Check port 3000 is free
* Try: `npm run electron-dev`

***

## 📚 Next Steps

* [Project Structure](https://github.com/Onesignature/Zer0-gitbook/blob/main/developers/project-structure.md)
* [Agent SDK](https://github.com/Onesignature/Zer0-gitbook/blob/main/developers/agent-sdk.md)
* [Contributing Guide](https://github.com/Onesignature/Zer0-gitbook/blob/main/resources/contributing.md)

***

{% hint style="info" %}
**Need help?** Join our [Discord](https://discord.gg/zer0) or email <dev@zer0.build>
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zer0.build/for-developers/building-from-source.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
