Beginners Guide to Install Discourse on Windows 10 for Development

So you want to set up a development environment for Discourse on Windows 10 (or 11)? You can do it easily using Windows Subsystem for Linux feature. It is faster too :star_struck:.

This setup requires the WSL 2 installation. It is only available in Windows 10 builds 18917 or higher. We’ll assume that you already installed Windows Subsystem for Linux 2 (Ubuntu) on your Windows 10 system.

Let’s begin!

Installing Discourse

  1. Initially follow the steps from the topic Beginners Guide to Install Discourse on Ubuntu for Development until the step Clone Discourse.
  1. Before setting up the database you have to start PostgreSQL service & Redis server manually using following commands

    sudo service postgresql start
    redis-server --daemonize yes
    
  2. Then go through all the remaining steps of the Ubuntu guide.

Creating a Command to Start Discourse

Now your development environment is almost ready. The only problem is every time when you open Ubuntu on Windows you have to start the PostgreSQL service & Redis server manually. Don’t worry we can have a workaround for this by creating a custom command :wink:

cd ~

Create a new file using the command nano start-discourse and paste the content below then save and exit.

#!/bin/bash

# to start PostgreSQL
sudo service postgresql start

# to start Redis server
redis-server --daemonize yes

Now modify the CHMOD using below command

chmod +x start-discourse

And copy the file to your bin folder

sudo cp start-discourse /usr/bin/

It’s done. Now, whenever you open the Ubuntu bash just run the command below and start developing :+1:

start-discourse

Alternatively, if you are using Windows 10 enterprise, pro, or education edition then you can create a Linux virtual machine in hyper-v to set up the Discourse dev environment.

Notes About Windows Environment

As of June 30, 2020:
As of July 1, 2020

Last Reviewed by @AlexDev on 2022-06-16T02:00:00Z

43 Likes
How to install Discourse on windows
Help installing Discourse for Developer
Beginners Guide to Install Discourse on Ubuntu for Development
Database connection error when setting up Discourse development environment using Linux Bash Shell on Windows 10
Restoring backup fails in Win10/Ubuntu development environment
How can i install Discourse forum on my win 10 dedicated server OVH
How to Install Discourse on LocalHost in Windows?
Restoring backup fails in Win10/Ubuntu development environment
»vagrant up« hangs
Dev Category sidebar
Beginners Guide to Install Discourse on Ubuntu for Development
Discourse installation end to end on Windows Server 2016
Beginners Guide to Install Discourse on Ubuntu for Development
Beginners Guide to Install Discourse on Ubuntu for Development
No connection to db issue
Migrating to Discourse from another Forum software
How to Install Discourse on LocalHost in Windows?
Beginners Guide to Install Discourse for Development using Docker
Beginners Guide to Install Discourse on Ubuntu for Development
How to install on localhost
Help with setting up discourse An error occurred while installing xorcist (1.1.2), and Bundler cannot continue
WSL environment deadlocks
Problem with development on Windows with Docker and mounted volume
Discourse Development Contribution Guidelines
Beginners Guide to Install Discourse on Ubuntu for Development
Beginners Guide to Install Discourse on Ubuntu for Development
Importing / migrating Phorum to Discourse
Importing / migrating MyBB to Discourse
Importing / migrating PunBB to Discourse
Importing / migrating NodeBB (MongoDB) to Discourse
Importing / migrating NodeBB (Redis) to Discourse
Problem in development Installation
Discourse standalone
Please help, how do I install Discourse on macOS?
Discourse eclipse in window
Beginners Guide to Install Discourse on Ubuntu for Development
How do I set up a local Discourse Development Environment?
Restoring backup fails in Win10/Ubuntu development environment
Topics which users cannot directly reply to, but can create a linked topic?
How to add a new language
How to Start Sidekiq When Using Puma
Discourse-webpack: A boilerplate for developing JS-heavy Discourse components
How can I directly edit Discourse database from a GUI?
Can't set up dev environment due to cppjieba_rb failing to install
Cloning and making our own Discourse community
How to Add Ngrok to Allowed Hosts

Hey, so I’ve been at this for about 5 hours now and I cannot for the love of me get it to work. I used to have Discourse perfectly running with this guide, but that was on an older hardware on Windows 10.

Now, I have Windows 11, but all guides of yours seem to indicate that it makes functionally no difference, I just wanted to mention it.

I’m running Ubuntu 18.04.5 LTS via WSL2 currently, but I’ve tried running Ubuntu 20.04 as well with the extended advertised guide to no avail. I’ve tried pretty much everything, and I always get stuck at the same error.

Couldn't create 'discourse_development' database. Please check your configuration.
rake aborted!
ActiveRecord::ConnectionNotEstablished: fe_sendauth: no password supplied

Now I’ve googled this error many, many times, I even found one thread on Discord that has the exact same issue.

I’ve tried many fixes, including putting a password entry inside the database.yml to no avail. I don’t know what I’m doing wrong, but I feel like I’m losing my mind.

2 Likes