> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aicodezero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run AI Code Zero from source

> Download the AI Code Zero code and run it yourself with Node.js, in your browser or as the desktop app, on Windows, macOS or Linux.

> [!TIP]
>
> Most people don't need this page. To try AI Code Zero, [use it in your browser](https://docs.aicodezero.com/quickstart-browser.md). To install it, see the [desktop app](https://docs.aicodezero.com/quickstart-desktop.md). Prefer containers? See [Docker](https://docs.aicodezero.com/self-hosting/docker.md).

Running from source means downloading the code and starting it with Node.js. It's a good fit if you're on a Mac and want to skip Pinokio, if you want your own copy, or if you want to change AI Code Zero itself.

There are two ways to start it:

* **Browser version** (`npm start`): runs at `http://localhost:3000`. Works on Windows, macOS and Linux. Projects and API key are saved in your browser.
* **Desktop app** (`npm run desktop`): opens in its own window. Projects are saved as folders and your key goes in the keychain. Tested on Windows and Linux, not on macOS.

## Before you start

You need **Node.js 22.12 or newer**. Install the **LTS** version from [nodejs.org](https://nodejs.org/). **Git** is optional but makes updating easier.

Open a terminal (PowerShell on Windows, Terminal on a Mac) and check Node.js:

```bash theme={null}
node --version
```

It should print `v22.12.0` or higher.

## Get the code

> [tab] With Git
>
> ```bash theme={null}
> git clone https://github.com/techmitten/aicodezero.git
> cd aicodezero
> ```

> [tab] Without Git
>
> 1. Open the [AI Code Zero page on GitHub](https://github.com/techmitten/aicodezero).
> 2. Click **Code**, then **Download ZIP**, and unzip it.
> 3. In your terminal, go into the unzipped folder, for example `cd Documents/aicodezero-master`.

Then install what AI Code Zero needs. The first time takes a minute or two:

```bash theme={null}
npm install
```

## Run it in your browser

**1. Start AI Code Zero**

```bash theme={null}
npm start
```

This builds the app and starts the server. Wait for `AI Code Zero is running. Open http://localhost:3000 in your browser.`

**2. Open it**

Go to [http://localhost:3000](http://localhost:3000).

**3. Set it up**

Accept the terms, enter your name and pick an avatar. Then choose a provider, paste your API key and pick a model. Need a key? See [Choose an AI provider](https://docs.aicodezero.com/ai-providers.md).

**4. Build something**

Describe what you want and press Enter — **Smart studio** picks App, Website or Game for you, or you can pick one with the icons at the bottom of the prompt box.

To stop it, press `Ctrl+C` in the terminal. To start it again, run `npm start` in the same folder.

If port 3000 is busy, pick another. On macOS or Linux, run `PORT=3001 npm start`. In PowerShell, run `$env:PORT=3001; npm start`.

Good to know:

* **Projects live in your browser**, tied to the exact address you opened. A different browser or port starts empty. Back up with **Settings → Data → Export**.
* **Your API key is in your browser too.** Your browser sends it straight to your AI provider, not through the local server.
* **Only your computer can open it.** Read [Security](https://docs.aicodezero.com/self-hosting/security.md) before changing that.
* **You can add a photo library.** Put an Unsplash key in a `.env` file and the AI uses real photos. See the [Configuration reference](https://docs.aicodezero.com/self-hosting/configuration.md#photo-library).

## Run the desktop app from source

```bash theme={null}
npm run desktop
```

AI Code Zero builds and opens in its own window. Set it up like the [installed app](https://docs.aicodezero.com/quickstart-desktop.md#set-up-ai-code-zero).

> [accordion] Linux: the window doesn't open and the terminal mentions chrome-sandbox
>
> Some systems, such as Ubuntu 24.04, need Electron's sandbox helper to be owned by root. Run these once in the AI Code Zero folder, then try again:
>
> ```bash theme={null}
> sudo chown root:root node_modules/electron/dist/chrome-sandbox
> sudo chmod 4755 node_modules/electron/dist/chrome-sandbox
> ```
>
> Run them again after `npm install` updates Electron. Avoid `--no-sandbox`: the sandbox protects your files from the apps you build.

To build Linux installers yourself, run `npm run desktop:dist`. The AppImage, `.deb` and snap files appear in `dist-desktop`. On Windows, AI Code Zero comes only from the [Microsoft Store](https://apps.microsoft.com/detail/9nk9ss4v2n1k).

## Update

1. Stop AI Code Zero (`Ctrl+C`, or close the window).
2. Get the new code: run `git pull`, or download the ZIP again and unzip it over the old folder.
3. Run `npm install`, then `npm start` (or `npm run desktop`).

Updating doesn't touch your projects.

## Contribute

To work on AI Code Zero itself, see the [GitHub repository](https://github.com/techmitten/aicodezero). Issues and pull requests are welcome.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.