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

# Init Command

> Initialize your 2501 deployment configuration

The `init` command creates your deployment directory with all necessary configuration files.

## Usage

```bash theme={null}
2501-infra init [options]
```

For all available options:

```bash theme={null}
2501-infra init -h
```

## What Gets Created

The `init` command creates different directory structures depending on the installation mode.

### System Mode (Default)

When using system mode (requires sudo), files are created in standard system directories:

```
/etc/2501/default/
├── 2501.yaml              # Main configuration (documented inline)
├── env.engine             # Engine environment variables
├── env.command-center     # Command Center environment variables
└── generated/             # Generated deployment files

/var/lib/2501/default/
└── data/                  # (only with --postgres)
    └── postgres/

/var/log/2501/default/
├── engine/
└── command-center/
```

### User Mode

When using user mode (`--user` flag, no sudo required), files are created in `~/.2501/default/`:

```
~/.2501/default/
├── 2501.yaml              # Main configuration (documented inline)
├── env.engine             # Engine environment variables
├── env.command-center     # Command Center environment variables
├── logs/
│   ├── engine/
│   └── command-center/
├── generated/             # Generated deployment files
└── data/                  # (only with --postgres)
    └── postgres/
```

## Auto-Generated Secrets

The `init` command automatically generates all required secrets:

* `CREDENTIAL_DECRYPTION_KEY` / `CREDENTIAL_ENCRYPTION_KEY`
* `ENGINE_API_KEY`
* `AUTH_SECRET`
* `LOG_ENCRYPTION_KEY`

<Note>
  These secrets are generated once and must be preserved. Never regenerate them after initial deployment as this will break existing credentials.
</Note>

## Quick Start

```bash theme={null}
# Production setup with external database
2501-infra init --no-postgres

# Experiment with managed PostgreSQL
2501-infra init --postgres

# Custom directory
2501-infra init -d /etc/2501 -t swarm --no-postgres
```
