I'll provide a beginner-friendly guide to help you set up and run these FHIR server files on both Mac and Windows.
First, let's understand what these files are:
-
docker-compose.yml
: This is a configuration file that defines how to run two connected services:- A FHIR server (which is a healthcare data server)
- A PostgreSQL database to store the data
-
hapi.application.yaml
: This is a configuration file for the FHIR server that tells it how to connect to the database.
Docker is the main tool we need. It allows us to run applications in containers (think of them as lightweight virtual computers).
- Visit Docker Desktop for Windows
- Click "Download for Windows"
- Run the installer
- During installation, if prompted to install WSL 2, allow it
- Restart your computer after installation
- Visit Docker Desktop for Mac
- Click "Download for Mac"
- Choose Apple Chip if you have M1/M2 Mac, or Intel Chip for older Macs
- Double-click the downloaded .dmg file
- Drag Docker to Applications folder
- Start Docker from Applications
- Create a new folder anywhere on your computer (e.g., "fhir-project")
- Inside this folder, create two files:
docker-compose.yml
- copy the first code block into ithapi.application.yaml
- copy the second code block into it
- Open Terminal (Mac) or Command Prompt (Windows)
- Navigate to your project folder:
cd path/to/your/fhir-project
- Start the containers:
docker compose up
This command will:
- Download the necessary images (might take a few minutes first time)
- Start both the FHIR server and database
- Show you the logs in the terminal
- Open your web browser
- Go to:
http://localhost:8080
- You should see the HAPI FHIR server welcome page
-
"docker command not found"
- Make sure Docker Desktop is running
- Try restarting your computer
-
"Port 8080 already in use"
- Change the port in docker-compose.yml from "8080:8080" to something like "8081:8080"
-
"Permission denied" (Mac/Linux)
- Add
sudo
before the command:sudo docker compose up
- Add
- In the terminal where it's running, press
Ctrl+C
(Windows) orCmd+C
(Mac) - To completely clean up, run:
docker compose down
- Always make sure Docker Desktop is running before trying to use docker commands
- The first run will be slower as it downloads the necessary images
- If you make changes to the configuration files, you'll need to restart the containers
- Use
docker compose up -d
to run in detached mode (background) - Use
docker compose logs
to see the logs when running in detached mode