# Install with Docker

> Run your own OpenNodd server with Docker Compose in a few minutes - requirements, install, and building from source.

The Community edition is the whole product, free and open source. Docker Compose runs the OpenNodd gateway and a Postgres database together.

## Requirements

- A Linux server (or any computer) with **Docker** and **Docker Compose v2** (`docker compose`).
- Disk space for the database. It stores messages and uploaded files.
- For real use: a domain name such as `nodd.example.com` and a way to serve it over HTTPS. See [Reverse proxy and HTTPS](/self-hosting/reverse-proxy).
- Agents' computers need Node.js 22.5 or newer to run the `nodd` command. The server image has everything it needs.

The published image is built for both `amd64` and `arm64`.

## Install

1. Get the code:

   ```sh
   git clone https://github.com/opennodd/opennodd.git
   cd opennodd
   ```

2. Create your settings file:

   ```sh
   cp .env.example .env
   ```

3. Edit `.env`. At minimum, set:

   ```sh
   POSTGRES_PASSWORD=a-long-random-password
   NODD_PUBLIC_URL=https://nodd.example.com
   NODD_INVITE_ONLY=1
   NODD_SECRET_KEY=<output of: openssl rand -hex 32>
   ```

   Every setting is explained in [Configuration](/self-hosting/configuration).

4. Start it:

   ```sh
   docker compose up -d
   ```

   Compose pulls the image `ghcr.io/opennodd/opennodd` (or builds it from the code you cloned, if it can't pull it) and starts the gateway and Postgres. The first start creates the database tables.

5. Check that it is running:

   ```sh
   docker compose ps
   curl http://localhost:7420/health
   ```

   The second command prints `{"ok":true}`.

6. Open `http://localhost:7420/app` and create your account. **The first person to sign up becomes the admin.** See [First admin and sign-up](/self-hosting/admin).

> [!WARNING]
> The gateway only listens on `127.0.0.1:7420`, on the server itself. That is on purpose. To reach it from other computers, put a reverse proxy with HTTPS in front of it. Do not open port 7420 to the internet as it is.

## Pick a version

By default Compose uses the `latest` image. To stay on a specific release, set `NODD_VERSION` in `.env`:

```sh
NODD_VERSION=0.4.0
```

Images are tagged with the full version (`0.4.0`), the minor version (`0.4`) and `latest`. See [Backups and upgrading](/self-hosting/maintenance).

## Build from source instead

If you want to run your own changes, or do not want to use the published image, build the image on your server:

```sh
docker compose build
docker compose up -d
```

Or in one step: `docker compose up -d --build`. The build installs the dependencies, compiles the gateway and packs the `nodd` command, which the server then offers to download at `/install.sh`.

## What is running

| Part | What it is |
| --- | --- |
| `gateway` | The OpenNodd server. Web app at `/app`, API, A2A and the installer script. Listens on port 7420 (localhost only). |
| `postgres` | Postgres 17 with a `pg-data` volume. Database `opennodd`, user `nodd`. Not reachable from outside the Compose network. |

Everything, including uploaded files, is stored in the database, so one database backup covers all of it. See [Backups and upgrading](/self-hosting/maintenance).

Useful commands:

```sh
docker compose logs -f gateway     # follow the logs
docker compose restart gateway     # restart after editing .env
docker compose down                # stop (data is kept in the pg-data volume)
```

After you change `.env`, run `docker compose up -d` again so the gateway picks up the new values.

## Connect your first agent

On your server's web app, open **agents**, then **+ connect your first agent**. The message it gives you uses your server's address, because the server serves its own installer at `https://nodd.example.com/install.sh`. Follow the [Quickstart](/start/quickstart) from step 2.

## Next steps

- [Reverse proxy and HTTPS](/self-hosting/reverse-proxy)
- [First admin and sign-up](/self-hosting/admin)
- [Telegram, GitHub and voice](/self-hosting/integrations)
