Docker Compose

Use the following Docker Compose commands to get up and running quickly with FusionAuth, PostgreSQL, and OpenSearch:

  1. Install the prerequisites:

    • On macOS and Windows, one of the following container management tools:
      • Docker desktop
      • OrbStack (to use Orbstack for docker compose commands after install, run docker context use orbstack)
      • Podman (in the commands below, replace docker with podman)
    • On Linux, Docker 23 or later
  2. Download the docker-compose.yml file:

    $ curl -fsSL https://fusionauth.io/docs/docker-compose.yml > docker-compose.yml
    
    $ curl -fsSL https://fusionauth.io/docs/docker-compose.yml > docker-compose.yml
    
    Invoke-WebRequest -UseBasicParsing https://fusionauth.io/docs/docker-compose.yml -OutFile docker-compose.yml
    
  3. Start the FusionAuth container:

    $ docker compose up -d
    
  4. Visit http://localhost:9011/admin to access the Admin UI.

  5. Congratulations, you have a working instance of FusionAuth! To set up login for an application, see our First Time Setup guide.

To install FusionAuth, copy and paste the following skill into your harness:

SKILL.md
---
name: install-fusionauth-docker
description: Install and run FusionAuth locally with Docker Compose, including
  PostgreSQL and OpenSearch, then confirm it is healthy. Use when the user asks
  to install, run, or try FusionAuth on their machine.
---

# Install FusionAuth with Docker

The FusionAuth docs are the source of truth for these steps. Before you start,
read https://fusionauth.io/docs/get-started/install.md and
follow it wherever it differs from this skill, except for the compose file:
use the one that ships with this skill.

1. Check that `docker compose version` succeeds. If it fails, tell the user to
   install Docker 23 or later, or a compatible tool such as OrbStack or Podman,
   and stop. If the user has Podman, replace `docker` with `podman` in every
   command below.

1. Check that nothing else is listening on port 9011. If something is, ask the
   user whether to stop it or use another port.

1. Copy the `docker-compose.yml.txt` file that ships next to this `SKILL.md`
   into an empty directory, and name the copy `docker-compose.yml`. Don't edit
   the image version in the file. FusionAuth pins the image to the release the
   docs document.

   When no `docker-compose.yml.txt` sits next to this `SKILL.md`, such as when
   the user pasted the skill into the harness, don't download one yourself.
   Ask the user to download the compose file into the directory by following
   https://fusionauth.io/docs/get-started/install, then continue.

1. Replace the example passwords in the copied file with random values, so
   no two installs share a password. Do this once, before the first start.
   When the file has no `example_` passwords, skip this step, because a
   changed password no longer matches the existing database:

   ```shell
   sed -i.bak \
     -e "s/example_postgres_password_change_me/$(openssl rand -hex 16)/g" \
     -e "s/example_fusionauth_password_change_me/$(openssl rand -hex 16)/g" \
     docker-compose.yml && rm docker-compose.yml.bak
   ```

   If `openssl` isn't installed, generate two random 32-character hex strings
   another way. Tell the user that the passwords are in `docker-compose.yml`,
   and that they only protect this local install.

1. Set `INSTALLATION_SOURCE` to your harness name, model name, and model
   version, such as `Opencode / Claude Sonnet 4.6`. This optional step tells
   FusionAuth the install was AI-assisted. Add it to a `.env` file next to
   `docker-compose.yml`:

   ```shell
   echo 'INSTALLATION_SOURCE=<harness> / <model> <version>' > .env
   ```

1. Start the containers:

   ```shell
   docker compose up -d
   ```

1. Wait for FusionAuth to report healthy. The first start can take a few
   minutes while Docker pulls images. This polls the Health API every 5 seconds
   for up to 5 minutes:

   ```shell
   for attempt in $(seq 60); do
     curl -fsS -o /dev/null http://localhost:9011/api/health && break
     sleep 5
   done
   ```

   If the last attempt still fails, run `docker compose ps` and
   `docker compose logs fusionauth`, show the user the relevant errors, and
   stop.

1. Tell the user that FusionAuth is running, and that they can open the Admin UI
   at http://localhost:9011/admin to create their admin account. To set up
   login for an application, point them to
   https://fusionauth.io/docs/get-started/first-time-setup.md. For follow-up
   questions, use the FusionAuth Docs MCP server when it is available.

To stop FusionAuth, run `docker compose down`. To also delete its data, run
`docker compose down -v`, but only when the user asks for that.