# Getting started

> Go from zero to your first managed database instance — install the Manager, connect a server, and provision MariaDB, MySQL, or PostgreSQL.

Source: https://fleetdock.dev/docs/getting-started


This guide takes you from nothing to a running, backed-up database instance managed by
Fleetdock. It uses the real commands from the repository. The example provisions MariaDB;
the same steps apply to MySQL and PostgreSQL.

## Prerequisites [#prerequisites]

* A Linux host for the **Manager** (x86\_64 or arm64). Docker is installed for you if missing.
* Ports **80** and **443** free on that host.
* Optionally a domain pointed at it — without one, Fleetdock uses an `<ip>.sslip.io` name
  that still gets a real TLS certificate.
* One or more Linux **database servers** you can run a command on as root.
* Outbound internet from those servers (to download the agent and, optionally, back up to
  object storage).

## 1. Install Fleetdock Manager [#1-install-fleetdock-manager]

<Callout type="info">
  **Server or your own computer?** This guide installs the Manager on a server, so your
  database servers can connect to it. To run Fleetdock only on your own machine — macOS,
  Linux, or Windows through WSL2 — follow [Install on your computer](/docs/local) instead.
</Callout>

On the server, run:

```bash
curl -sSL https://fleetdock.dev/install.sh | sudo sh
```

It asks three things:

1. **Where are you installing?** Press Enter for a server.
2. **Domain** — the hostname you pointed at this server, or press Enter for a free
   `<ip>.sslip.io` name that still gets a real HTTPS certificate.
3. **Admin email.**

It then shows a summary and waits for you to confirm. It installs Docker if needed,
generates secrets, starts the stack behind Caddy with automatic HTTPS, and prints:

```text
  Fleetdock is running.

    Dashboard   https://db.example.com
    Email       admin@example.com
    Password    8fK2mQ...
```

The stack runs one application container plus PostgreSQL and Caddy. Only 80 and 443 are
published. Migrations are applied and the admin account bootstrapped on first boot.

For automation, give the answers as flags and skip the questions:

```bash
curl -sSL https://fleetdock.dev/install.sh | sudo sh -s -- \
  --domain db.example.com --admin-email you@example.com --yes
```

<Callout type="info">
  Re-running the installer upgrades in place and **never** regenerates `.env` —
  rotating `FLEETDOCK_ENCRYPTION_KEY` would make every stored credential
  permanently unreadable. Use `fleetdock update` for routine upgrades.
</Callout>

### Managing the install [#managing-the-install]

The installer also adds a `fleetdock` command on the host:

```bash
fleetdock status                  # container health and readiness
fleetdock credentials             # dashboard URL and admin login
fleetdock logs -f
fleetdock update                  # back up, then pull a new release and restart
fleetdock domain new.example.com  # move to a different hostname
fleetdock doctor                  # diagnose DNS, certificates, reachability
```

### Running from source instead [#running-from-source-instead]

To work on Fleetdock itself, see
[CONTRIBUTING.md](https://github.com/Fleetdock/fleetdock/blob/main/CONTRIBUTING.md):

```bash
git clone https://github.com/Fleetdock/fleetdock.git
cd fleetdock
cp .env.example .env
./scripts/generate-secrets.sh >> .env
make up        # the full stack in Docker, at http://localhost
```

## 2. Create an administrator account [#2-create-an-administrator-account]

The first admin is created on first boot with the email and password the installer printed
(`fleetdock credentials` shows them again). Sign in, then change the password: your name
(top right) → **Your profile**.

<Screenshot name="overview" />

## 3. Add a node and generate a registration token [#3-add-a-node-and-generate-a-registration-token]

In the dashboard, open **Servers → Connect server**. Fleetdock generates a **single-use
registration token** (prefix `fleetr_`) and a ready-to-paste install command.

<Callout type="warn">
  Registration tokens are single-use and short-lived. Never paste a real token
  into a chat, an issue, or a public channel. The examples in these docs use a
  placeholder.
</Callout>

## 4. Install the Fleetdock Agent [#4-install-the-fleetdock-agent]

Run the generated command on the database server. This is the **agent installer**, served
by your own Manager — not `fleetdock.dev/install.sh`, which installs the Manager. Put `sudo`
**after** the pipe (before `sh`), because the installer must run as root:

```bash
curl -sSL https://your-control-plane/install.sh | \
  sudo env FLEETDOCK_URL=https://your-control-plane \
           FLEETDOCK_TOKEN=<registration-token> sh
```

The installer downloads the agent binary from the control plane, installs the MariaDB and
PostgreSQL client tools, ensures Docker is present, and starts a systemd service.

## 5. Verify node connectivity [#5-verify-node-connectivity]

The server appears in **Servers** within about 30 seconds and then heartbeats every 30
seconds. On the server itself you can confirm the service is running:

```bash
systemctl status fleetdock-agent
```

<Callout type="info">
  For local VM development, set `FLEETDOCK_PUBLIC_URL` to an address the VM can
  actually reach (for example `http://192.168.x.x`), not `localhost` — it is
  baked into the install command each agent is given. See
  [Networking](/docs/networking).
</Callout>

## 6. Provision your first database instance [#6-provision-your-first-database-instance]

Open **Servers → your server → Add instance → Provision new** and pick an engine — MariaDB,
MySQL, or PostgreSQL. Fleetdock launches a database container with a generated superuser
password, a named data volume, and a published port. See
[Database instances](/docs/database-instances) for the configuration fields.

## 7. Configure backups [#7-configure-backups]

<Steps>
  <Step>
    ### Add a backup destination [#add-a-backup-destination]

    Under **Destinations**, add an S3, Cloudflare R2, or S3-compatible bucket and run **Test
    bucket**. Storage keys are encrypted at rest.
  </Step>

  <Step>
    ### Back up a database [#back-up-a-database]

    From a database's detail page, trigger a manual backup, or create a recurring **Schedule**
    with a retention window.

    <Screenshot name="backups" />
  </Step>
</Steps>

## 8. Verify database connectivity [#8-verify-database-connectivity]

Provisioned instances publish a port on the server. Connect with your engine's client using
the generated credentials shown in the instance details:

```bash
# MariaDB / MySQL
mariadb -h <server-address> -P <published-port> -u <user> -p

# PostgreSQL
psql "postgresql://<user>@<server-address>:<published-port>/<database>"
```

## Where to go next [#where-to-go-next]

* [Core concepts](/docs/concepts) — the vocabulary behind servers, instances, and operations.
* [Backups](/docs/backups) and [Restore](/docs/restores) — protect and recover data.
* [Security](/docs/security) — the trust model and hardening steps before production.
