# Quick start

From nothing to a signed-in admin in a few minutes. You need Docker (Docker Desktop on Windows or macOS, Docker Engine or Podman on Linux) and nothing else.

## 1. Start the server

```
docker run -d --name crushmft27 \
  -p 8080:8080 -p 443:443 -p 2222:2222 -p 21:21 \
  -v crushmft27:/app/CrushMFT27 \
  --restart unless-stopped \
  crushftp/crushmft27:latest
```

| Part | What it does |
|---|---|
| `-p 8080:8080` | the web interface over HTTP (also 9090) |
| `-p 443:443` | the web interface over HTTPS |
| `-p 2222:2222` | SFTP |
| `-p 21:21` | FTP and FTPS (passive transfers need more: see [Ports and networking](Ports-and-Networking.md)) |
| `-v crushmft27:/app/CrushMFT27` | a named volume `crushmft27` for everything the server keeps. Without it Docker makes a volume with a random name, which is easy to lose. |
| `--restart unless-stopped` | Docker starts the server again after a reboot, and after a restart asked for in the admin pages |
| `:latest` | the newest build; pin one in production, e.g. `crushftp/crushmft27:27.0.0_289` ([Images and tags](Images.md)) |

On Podman, write `docker.io/crushftp/crushmft27:latest` and the same options.

## 2. Wait for it to be ready

```
docker logs -f crushmft27
```

The first start takes some seconds (it puts the program into the volume and creates the settings). It is ready when

```
curl -s http://localhost:8080/WebInterface/api/readyz
```

answers `{"status":"ready"}`.

## 3. Get the admin password

```
docker logs crushmft27 | grep "first admin"
```

```
CrushContainer: The first admin user crushadmin gets a random password, kept in /app/CrushMFT27/passfile: Hn4pQ7...
```

The password is printed this once, and it is also kept in the file `passfile` in the volume. The `-dev` image can read it later: `docker run --rm -v crushmft27:/app/CrushMFT27 --entrypoint cat crushftp/crushmft27:latest-dev /app/CrushMFT27/passfile`.

To choose the password yourself, start the container with `-e CRUSHFTP_ADMIN_PASSWORD_FILE=<a file>` or `-e CRUSHFTP_ADMIN_PASSWORD=<password>` instead ([Configuration](Configuration.md#the-first-admin)). Either one is used only when the admin user is created, on the very first start.

## 4. Sign in

Open `http://localhost:8080/` and sign in as `crushadmin` with that password. Change the password in your account settings, then enter your licence key in the admin pages (without one, CrushMFT runs as a 30 day trial).

## 5. Next

| | |
|---|---|
| keep it running for real | [Docker Compose](Docker-Compose.md) |
| set settings without the admin pages | [Configuration](Configuration.md) |
| make users and folders | the [CrushMFT 27 documentation](../CrushMFT27/Main.md) |
| back it up | [Operations](Operations.md#backup-and-restore) |

## Stop and remove

```
docker stop crushmft27      # stops the server cleanly
docker start crushmft27     # starts it again with the same data
docker rm crushmft27        # removes the container; the volume and your data stay
docker volume rm crushmft27 # deletes the data for good
```
