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

44 Likes
How to install Discourse on windows
Help installing Discourse for Developer
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
Install Discourse on Ubuntu for Development
Discourse installation end to end on Windows Server 2016
Install Discourse on Ubuntu for Development
Install Discourse on Ubuntu for Development
No connection to db issue
How to Install Discourse on LocalHost in Windows?
Install Discourse for development using Docker
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
Please help, how do I install Discourse on macOS?
Install Discourse on Ubuntu for Development
Discourse eclipse in window
Discourse standalone
Migrate a NodeBB forum with Redis to Discourse
Migrate a MyBB forum to Discourse
Migrate a NodeBB forum with MongoDB to Discourse
Migrate a Phorum forum to Discourse
Migrate a PunBB forum to Discourse
Migrate from another forum to Discourse
Unable to setup discourse in my windows 10
Discourse Development Contributor Guidelines
Problem in development Installation
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