I’m trying to set up Discourse locally using Docker on Windows, but I’m running into errors. Here’s what I’ve done so far:
Installed Docker Desktop and ensured it’s running.
Cloned the Discourse Docker repository:
bash
git clone GitHub - discourse/discourse_docker: A Docker image for Discourse discourse cd discourse
Tried to bootstrap Discourse:
bash
./launcher bootstrap app
But I get this error:
./launcher: line 118: ifconfig: command not found ./launcher: line 162: [: /c/Program: binary operator expected Cannot connect to the Docker daemon - verify it is running and you have access
I’ve tried replacing ifconfig with ipconfig in the launcher script, but I’m still stuck. Docker Desktop is running, and
docker ps
works fine. Any help would be greatly appreciated!
Details:
Windows 10/11
Docker Desktop 4.x
Git Bash
Thanks in advance!
You’re on the right track, but running Discourse locally using the discourse_docker
repo is not recommended on Windows. That repo is intended for production installs on Linux, typically Ubuntu, and expects a Linux environment (e.g., access to ifconfig
, real systemd, etc.). That’s why you’re seeing errors like:
ifconfig: command not found
binary operator expected
Cannot connect to the Docker daemon
Even modifying the script (e.g., swapping ifconfig
for ipconfig
) won’t fix deeper compatibility issues with the Windows environment and how launcher
is written.
Recommended Approach for Local Development on Windows
If your goal is local development or testing, you should use the official Discourse development environment, which works well on Windows (via WSL2):
Steps:
- Install WSL2 and UbuntuIf not already installed:
- Install Docker Desktop (WSL2 Backend)
Make sure Docker Desktop is running and set to use the WSL2 backend.
- Set up Discourse for development
Follow the official Discourse Development Environment guide:
git clone https://github.com/discourse/discourse.git
cd discourse
./bin/bootstrap
./bin/rails s
This approach uses bin/dev
, rails
, and puma
— much more suited to dev purposes than the production-style launcher
.
Why discourse_docker
Doesn’t Work Well on Windows
- Assumes a Linux shell environment (e.g.,
/bin/bash
, ifconfig
, systemd, etc.)
- Designed for a standalone Ubuntu server, not for Windows or WSL
- Script logic doesn’t handle Windows paths properly (e.g.,
/c/Program Files/...
)
Quick Fix Summary
Use WSL2 + official Discourse dev setup, not discourse_docker
.