# Fresh VPS Install

Run these commands on the Linux VPS. The helper assumes Debian/Ubuntu style package management for automated host setup.

## 1. Preview Host Changes

```bash
sudo install/install-host.sh --dry-run
```

This prints the Docker, firewall, NTP and directory setup actions without applying them.

## 2. Configure The Host

```bash
sudo install/install-host.sh
```

This configures:

- Docker and Docker Compose plugin
- `ufw`
- inbound `8192/tcp`
- chrony/NTP
- `/opt/defcon` directory layout

RPC is not opened publicly.

## 3. Prepare Fullnode Compose Setup

Set the real DeFCoN Docker image before running the command:

```bash
sudo bin/defcon-helper install-new --dry-run --image YOUR_DEFCON_IMAGE
sudo bin/defcon-helper install-new --image YOUR_DEFCON_IMAGE
```

The command creates:

```text
/opt/defcon/data
/opt/defcon/config/defcon.conf
/opt/defcon/compose/docker-compose.yml
/opt/defcon/compose/.env
/opt/defcon/backups
```

## Masternode Mode

For a masternode config, provide the public IP and BLS secret:

```bash
sudo bin/defcon-helper install-new --dry-run \
  --image YOUR_DEFCON_IMAGE \
  --external-ip YOUR_VPS_PUBLIC_IP \
  --masternode \
  --bls-key YOUR_BLS_SECRET
```

Then run the same command without `--dry-run`.

## Verify

```bash
sudo bin/defcon-helper doctor
sudo bin/defcon-helper peers
sudo bin/defcon-helper pose
```
