# Guide to Setting Up Discourse Development Environment - Windows 11

**URL:** https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227
**Category:** Self-hosting
**Tags:** dev-install
**Created:** [October 14, 2023, 10:38am UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227 "2023-10-14T10:38:25Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![AliBenBongo](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@AliBenBongo](https://meta.discourse.org/u/AliBenBongo)
#### Post date: [October 14, 2023, 10:38am UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/1 "2023-10-14T10:38:25Z")

</div>

Hi Everyone,

After spending some time attempting to get a working development environment up and running under Windows 11 / WSL2 I thought I would share the steps that I have followed.

This is my first post here so I hope that this is of use to somebody 🙂 I am a Systems Administrator used to working with Windows so this has been an interesting journey learning Linux / Ruby / Discourse etc.

A few things seem to have changed since the guide for Windows 10 was written and I ran into a few issues along the way (and from reading the comments, I wasn’t the only one!)

I can confirm that the following instructions worked on my Windows 11 Pro 22H2 install & also on my Windows Insider build of the upcoming Windows 11 23H2 Release Preview.

I’ll try to keep the instructions as short and straightforward as possible 🙂

**Initial Preparation**

1. Check for any WSL updates and install them if applicable. From a Windows Powershell window use this command:-

`wsl.exe --update`

1. Install Ubuntu on WSL2 using this command:-

`wsl.exe --install -d Ubuntu`

1. Follow the onscreen prompts to create the username and password

2. Once you’re in the Ubuntu terminal, check for and install all applicable updates

`sudo apt update && sudo apt upgrade -y`

1. Now that everything is updated we can proceed 🙂

**WSL Modifications**

1. Before cloning Discourse, run the following command to open the /etc/wsl.conf file:-

`sudo nano /etc/wsl.conf`

1. At the bottom of the existing file, add the following , press Ctrl + X to save the changes and press “Y” when prompted.

```plaintext
[automount]
enabled = true
root = /mnt/
options = "metadata,umask=22,fmask=11"

```

1. Completely close the WSL terminal and relaunch it for these changes to properly apply.

2. Now copy and paste the following one-line installation script to set up the development environment. Depending on the speed of your computer and/or internet connection this might take a bit of time to complete, so go and grab a coffee or something!

```plaintext
bash <(wget -qO- https://raw.githubusercontent.com/discourse/install-rails/master/linux)

```

1. Start the PostgreSQL service:-

```plaintext
sudo service postgresql start

```

1. Because we’re running in WSL2 I got a warning message about the VM running out of memory, which can be solved by running the following

```plaintext
sudo sysctl vm.overcommit_memory=1

```

1. Run the following so that the redis-server automatically restarts:-

```plaintext
redis-server --daemonize yes

```

1. Clone Discourse into the home folder:-

```plaintext
git clone https://github.com/discourse/discourse.git ~/discourse

```

1. Change to the newly-created Discourse folder:-

```plaintext
cd ~/discourse

```

1. Run the following commands (I did them one line at a time)(Unsure whether this is necessary or if they can be copied and pasted in one go)

```plaintext
source ~/.bashrc

bundle install

yarn install

```

1. Setup the environment:-

```plaintext
RAILS_ENV=development bundle exec rake db:create db:migrate

```

1. Start Discourse

```plaintext
DISCOURSE_HOSTNAME=localhost UNICORN_LISTENER=localhost:3000 bin/ember-cli -u

```

1. Open a separate terminal , change into the Discourse directory using _cd ~/discourse_ and run **rails admin:create** - follow the instructions to set up your Admin user account.

2. Go to [http://localhost:4200](http://localhost:4200) in a web browser and Discourse should all be up and running 🙂

---

<div class="post-metadata">

### Author: ![Andrew\_Bond](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_bond/32/271376_2.png) [@Andrew\_Bond](https://meta.discourse.org/u/Andrew_Bond)
#### Post date: [October 14, 2023, 4:12pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/2 "2023-10-14T16:12:58Z")

</div>

> [@AliBenBongo](#):
>
> 1. Install Ubuntu on WSL2 using this command:-
> 
> `wsl.exe --install -d Ubuntu`

This part might fail. If it does click start , type turn windows features on or off  
Enable virtual machine platform  
Reboot

Resume the commands.

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/4/2/a4253c2d1f666e644e2e0a287f403fdc3d9e3bc8.png)

---

<div class="post-metadata">

### Author: ![AliBenBongo](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@AliBenBongo](https://meta.discourse.org/u/AliBenBongo)
#### Post date: [October 15, 2023, 3:13am UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/3 "2023-10-15T03:13:18Z")

</div>

Thanks for adding this Andrew!

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [October 16, 2023, 6:39am UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/4 "2023-10-16T06:39:46Z")

</div>

> [@AliBenBongo](#):
>
> ```plaintext
> cd ~/discourse
> 
> ```

One **very** important thing that I struggled with for a while to figure out is that the repo absolutely **must** be on the WSL filesystem (i.e., NOT on `/mnt/*`). Otherwise, you’ll either get all kinds of odd errors or have a very, **very** , **very** slow instance.

This is supposed to be common knowledge, but from my interaction with other devs, it kind of isn’t.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [October 16, 2023, 9:49am UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/5 "2023-10-16T09:49:00Z")

</div>

Hi AliBenBongo 👋

Thank you for this guide.

Out of curiosity, did you try [Install Discourse on Windows for development](https://meta.discourse.org/t/install-discourse-on-windows-10-for-development/75149) but faced issues on Windows 11?

I followed this official guide less than two months ago to set up my dev install on Win11, and it worked flawlessly.

---

<div class="post-metadata">

### Author: ![AliBenBongo](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@AliBenBongo](https://meta.discourse.org/u/AliBenBongo)
#### Post date: [October 19, 2023, 5:28am UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/6 "2023-10-19T05:28:46Z")

</div>

That’s interesting yes I did try that guide first and ran into many error messages. I can’t remember specifically but some of the error messages were mentioned in the comments section of that same thread …

Think this is a good thing in the end as I’ve definitely got more knowledge now through resolving the issue myself and then writing this guide up! 🙂

---

<div class="post-metadata">

### Author: ![user48](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/user48/32/367923_2.png) [@user48](https://meta.discourse.org/u/user48)
#### Post date: [March 4, 2024, 11:47pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/8 "2024-03-04T23:47:43Z")

</div>

Probs a dum question but I have to ask. Assuming I could get this up and running following your guide. Do you think it’s possible to reverse proxy this to a domain?

---

<div class="post-metadata">

### Author: ![AliBenBongo](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@AliBenBongo](https://meta.discourse.org/u/AliBenBongo)
#### Post date: [March 5, 2024, 4:58am UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/9 "2024-03-05T04:58:54Z")

</div>

There are no dumb questions, we can all always learn something new! 🙂 I don’t have much experience with reverse proxy stuff except for using Nginx Proxy Manager in a Docker container - perhaps have a look at that as it does most of the hard work and even generates free SSL certificates through Let’s Encrypt

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [March 5, 2024, 7:00am UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/10 "2024-03-05T07:00:29Z")

</div>

You are going to hit a lot of pain points I suspect. The dev install is not supported to run in Production.

Running the [standard install](https://meta.discourse.org/t/142537?silent=true) in the cloud might cost a few dollars a month but how much is your time worth?! With that you can be up and running in 30 minutes and be done.

---

<div class="post-metadata">

### Author: ![user48](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/user48/32/367923_2.png) [@user48](https://meta.discourse.org/u/user48)
#### Post date: [March 16, 2024, 7:49pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/11 "2024-03-16T19:49:03Z")

</div>

That is in fact what I have done. I started off with on communiteq, I also tried DigitalOcean but have ultimately landed on Contabo.

I think I might be a lunatic because what I was trying doing (just to see if I could), running Ubuntu in HyperV, I even managed to get the VM on the same subnet lol but I could not get initial domain check to work. I think part of the problem is that I am already hosting a handfull of services on my Windows host and consequently I am port forwarding 80/443 to that machine IP. I know it’s beyond the scope of this thread and it’s not supported, but have you any experience trying to do something similar?

---

<div class="post-metadata">

### Author: ![jordan-violet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jordan-violet/32/281428_2.png) [@jordan-violet](https://meta.discourse.org/u/jordan-violet)
#### Post date: [May 7, 2024, 9:23pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/12 "2024-05-07T21:23:08Z")

</div>

> [@AliBenBongo](#):
>
> **Initial Preparation**
> 
> 1. Check for any WSL updates and install them if applicable. From a Windows Powershell window use this command:-

It should be noted that, if you don’t have any subsystems installed yet then this command will not work.

---

<div class="post-metadata">

### Author: ![OlliePartly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/olliepartly/32/383857_2.png) [@OlliePartly](https://meta.discourse.org/u/OlliePartly)
#### Post date: [May 24, 2024, 1:35am UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/13 "2024-05-24T01:35:50Z")

</div>

I got stuck on installing Ruby; this helped me: [ChatGPT - Ruby 3.2 Not Released](https://chatgpt.com/share/34bf1295-7f31-450d-90cc-d850c113bc2b)

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [May 24, 2024, 6:57pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/14 "2024-05-24T18:57:18Z")

</div>

Hi, welcome 👋

If you follow the steps in this guide, you won’t need to install Ruby manually. The “install-rails” script will do that automatically.

---

<div class="post-metadata">

### Author: ![MarcosB](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcosb/32/458086_2.png) [@MarcosB](https://meta.discourse.org/u/MarcosB)
#### Post date: [October 25, 2024, 3:23am UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/15 "2024-10-25T03:23:26Z")

</div>

FYI, the latest version of Ubuntu, 24.04, doesn’t seem to work & I had a lot of problems with it

So when installing with WSL, be sure to use:

```plaintext
wsl.exe --install -d Ubuntu-22.04

```

---

<div class="post-metadata">

### Author: ![afovos](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/afovos/32/518166_2.png) [@afovos](https://meta.discourse.org/u/afovos)
#### Post date: [August 19, 2025, 2:35pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/16 "2025-08-19T14:35:47Z")

</div>

Hi 👋, I am using WSL2 under Windows 11, and I followed the steps in this post to install a local Discourse development instance. I encountered some issues, but I was eventually able to resolve them. Here is what I found:

(At first I tried with **ubuntu-20.04** but I was running into an issue with missing **libwebp7** dependency which is required during installation of ImageMagick. It seems libwebp7 is not available for For ubuntu-20.04) ➡ So I decided to use **ubuntu-22.04** instead which worked for me.

Following @AliBenBongo’s guide in the opening post, everything before step 9) worked as expected. 👍

In **step 9)** a few changes were necessary

> [@AliBenBongo](#):
>
> 1. Now copy and paste the following one-line installation script to set up the development environment. Depending on the speed of your computer and/or internet connection this might take a bit of time to complete, so go and grab a coffee or something!
> 
> ```plaintext
> bash <(wget -qO- https://raw.githubusercontent.com/discourse/install-rails/master/linux)
> 
> ```

Some of the resources in [https://raw.githubusercontent.com/discourse/install-rails/master/linux](https://raw.githubusercontent.com/discourse/install-rails/master/linux) are not up to date, it seems:

- I had to install Ruby 3.3.x instead of 3.2.1 by changing `ruby_version=“3.2.1”` to `ruby_version=“3.3.9”`
- I had to install Node 20 instead of 18 by changing `curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -` to `curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -`

In **step 15)** you need to run `pnpm install` instead of `yarn install`

Then, when running migrations in **step 16)**, it threw an error for some migrations depending on the `pgvector` Postgres extension. So I followed the Linux installation guide here: [https://github.com/pgvector/pgvector/blob/master/README.md](https://github.com/pgvector/pgvector/blob/master/README.md)

⚠To be on the safe side, it’s better to copy the commands directly from the readme file. However, if you’re curious, this is what worked for me::

```cd
git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git
cd pgvector
make
sudo make install

```

**After that** , I was able to run the migrations in step 16 and completed the installation by following the rest of the guide. 🎉

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [February 1, 2026, 10:26pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/17 "2026-02-01T22:26:19Z")

</div>

7 posts were split to a new topic: [Avatar upload issue (Ubuntu)](https://meta.discourse.org/t/avatar-upload-issue-ubuntu/394901)

---

<div class="post-metadata">

### Author: ![gilles](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gilles/32/549022_2.png) [@gilles](https://meta.discourse.org/u/gilles)
#### Post date: [March 8, 2026, 12:10pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/18 "2026-03-08T12:10:08Z")

</div>

Thanks for the tutorial but I still encounter the same error

Your Ruby version is 3.4.0.dev, but your Gemfile specified ~\> 3.4

I don’t know what to do about this

Thanks for the info 🤔

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [March 8, 2026, 12:38pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/19 "2026-03-08T12:38:03Z")

</div>

Hmm… that seems pretty common nowadays:

> [@Build fails due to ruby version mismatch](https://meta.discourse.org/t/build-fails-due-to-ruby-version-mismatch/396317):
>
> After some days of using ./launcher bootstrap web\_only && ./launcher destroy web\_only && ./launcher start web\_only without issue I ran into issues after trying to use the rails console to set SiteSetting.can\_permanently\_delete = true using ./launcher enter web\_only then rails c Question: Is the rails console accessed differently in separate container mode? After failing to get a successful rebuild and bootstrap I rolled the server back a couple of days prior to implementing AI stuff. No joy…

> [@\[Solved\] Discourse crashed during update](https://meta.discourse.org/t/solved-discourse-crashed-during-update/397520):
>
> I don’t undestand what’s happend and what to do. My Discourse crashed when I did the last update. Any help would be very appreciated Waiting for Unicorn to reload............... Stopping 1 Unicorn worker(s), to free up memory $ cd /var/www/discourse && git fetch --tags --prune-tags --prune --force $ cd /var/www/discourse && git reset --hard HEAD is now at 44bf7b363ac I18N: Update translations (#37404) $ cd /var/www/discourse && git -c advice.detachedHead=false checkout beta Previous HEAD posi…

> [@Update problem, do I press the big scary red button?](https://meta.discourse.org/t/update-problem-do-i-press-the-big-scary-red-button/396452/3):
>
> this doesn’t sound very promising: Your Ruby version is 3.3.8, but your Gemfile specified ~\> 3.4 Docker Manager: FAILED TO UPGRADE I tried ask.discourse after posting and it suggests doing a full rebuild: sudo git pull sudo ./launcher rebuild app yay or nay?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [March 8, 2026, 12:51pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/20 "2026-03-08T12:51:58Z")

</div>

> [@gilles](#):
>
> Your Ruby version is 3.4.0.dev, but your Gemfile specified ~\> 3.4

The former is considered older than the requirement so you will need to use rbenv or equivalent to install a more recent version.

---

<div class="post-metadata">

### Author: ![gilles](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gilles/32/549022_2.png) [@gilles](https://meta.discourse.org/u/gilles)
#### Post date: [March 8, 2026, 1:48pm UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/21 "2026-03-08T13:48:16Z")

</div>

Thank you

I had tried to download too recent a version and it didn’t work, it is imperative to stay on version 3.x.x. For my part, I used version 3.4.8.

So everything works, now I have to do the tutorials to try to code

Thanks for your help 👍
