# Install Discourse on Windows for development

**URL:** https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149
**Category:** Developer Guides
**Tags:** dev-install, how-to
**Created:** [December 1, 2017, 6:36am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149 "2017-12-01T06:36:51Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [December 1, 2017, 6:36am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/1 "2017-12-01T06:36:51Z")

</div>

ℹ This tutorial has been tested on Windows 10 and 11.

To set up a development environment for Discourse on Windows, you can do it using [Windows Subsystem for Linux](https://msdn.microsoft.com/en-us/commandline/wsl/install-win10) feature.

_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)](https://docs.microsoft.com/en-us/windows/wsl/install) on your Windows 10 system. **WARNING:** Install Ubuntu 18.04, and not 20.04 since some installations will fail on 20.04. For more information see June 30th, 2020 notes at the bottom of this post.

Let’s begin!

# Installing Discourse

1. **Initially follow the steps from the topic [Beginners Guide to Install Discourse on Ubuntu for Development](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-ubuntu-for-development/14727)** until the step **Clone Discourse**.

> [@Install Discourse on Ubuntu or Debian for Development](https://meta.discourse.org/t/install-discourse-on-ubuntu-or-debian-for-development/14727/1):
>
> ## Install Discourse Dependencies
> 
> You will need the following packages on your system:
> 
> - [Git](http://git-scm.com/)
> - [rbenv](https://github.com/sstephenson/rbenv) or [asdf](https://asdf-vm.com/guide/getting-started.html)
> - [ruby-build](https://github.com/sstephenson/ruby-build)
> - [Ruby](https://www.ruby-lang.org/) (latest stable)
> - [Rails](http://rubyonrails.org/)
> - [PostgreSQL](http://www.postgresql.org/)
> - [SQLite](https://sqlite.org/)
> - [Redis](http://redis.io/)
> - [Node.js](https://nodejs.org/en)
> - [pnpm](https://pnpm.io/)
> - [libvips](https://github.com/libvips/libvips/wiki#building-and-installing)
> - [MailHog](https://github.com/mailhog/MailHog)\*\*
> - [ImageMagick](http://www.imagemagick.org/)\*\*
> 
> _\*\* optional_
> 
> Now that we have installed Discourse dependencies, let’s move on to install Discourse itself.

1. Before setting up the database you have to start PostgreSQL service & Redis server manually using following commands

2. **Then go through all the remaining steps of the [Ubuntu guide](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-ubuntu-for-development/14727)**.

> [@Install Discourse on Ubuntu or Debian for Development](https://meta.discourse.org/t/install-discourse-on-ubuntu-or-debian-for-development/14727/1):
>
> ## Clone Discourse
> 
> Clone the Discourse repository in `~/discourse` folder:
> 
> ```sh
> git clone https://github.com/discourse/discourse.git ~/discourse
> 
> ```
> 
> _`~` indicates home folder, so Discourse source code will be available in your home folder._
> 
> ## Setup Database
> 
> Create role **with the same name as your ubuntu system username** :
> 
> ```sh
> sudo -u postgres createuser -s "$USER"
> 
> ```
> 
> ## Bootstrap Discourse
> 
> Switch to your Discourse folder:
> 
> ```sh
> cd ~/discourse
> 
> ```
> 
> Install the needed gems
> 
> ```sh
> source ~/.bashrc
> bundle install
> 
> ```
> 
> Now that you have successfully installed gems, run these commands:
> 
> ```sh
> bundle exec rake db:create
> bundle exec rake db:migrate
> RAILS_ENV=test bundle exec rake db:create db:migrate
> 
> ```
> 
> Try running the specs:
> 
> ```sh
> bundle exec rake autospec
> 
> ```
> 
> All the tests should pass.
> 
> Start rails server:
> 
> ```sh
> bundle exec rails server
> 
> ```
> 
> You should now be able to connect with your Discourse app on [http://localhost:3000](http://localhost:3000) - try it out!
> 
> In a separate terminal instance, navigate to your discourse folder (`cd ~/discourse`) and run:
> 
> ```sh
> bin/dev --only ember
> 
> ```
> 
> This starts the frontend bundler; the app remains served from [http://localhost:3000](http://localhost:3000).

## 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 😉

```sh
cd ~

```

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

```sh
#!/bin/bash

# to start PostgreSQL
sudo service postgresql start

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

```

Now modify the CHMOD using below command

```sh
chmod +x start-discourse

```

And copy the file to your bin folder

```sh
sudo cp start-discourse /usr/bin/

```

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

```sh
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](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/) to set up the Discourse dev environment.

## Notes About Windows Environment

> **As of June 30, 2020:**
>
> > [@AndreaHabib](#):
> >
> > With the introduction of Windows 10 build 2004 and WSL 2 and many of you might run into some issues since Discourse now requires WSL 2 to actually run.  
> > **For starters:** If you haven’t already, you would want to update your system to Windows 2004 (19041)  
> > **Note: Don’t install using Windows Update in the system settings as you might get errors mid-installation. Also make sure you are on Windows 1903 (18362) or 1909 (18363), you can search winver for that.**
> > 
> > - Go to: [Download Windows 10](https://www.microsoft.com/en-us/software-download/windows10)
> > - Click the Update Now button under Windows 10 May 2020 Update to download the update assistant and let it install and finish
> > - If you get any errors, then download the media creation tool, run it, and create a bootable flash drive (at least 8GB flash) and use it to install Windows.
> > 
> > When you are done with the Windows installation, you will need to manually install WSL 2  
> > But first, we need to make sure that 2 features are enabled:
> > 
> > - Virtual Machine Platform which can be enabled directly from your Windows by going to Programs and Features and then enabling Optional Features in **Turn Windows features on or off**
> > - The other is Virtualization which can be only enabled from your BIOS. However this option can vary from one motherboard to the other. eg: on AMD it’s called SVM. So please look up your specific motherboard.
> > 
> > Now that you have both features enabled:
> > 
> > - Install Ubuntu 18.04, and not 20.04 since some installations will fail on 20.04.
> > - Go here and update Linux Kernel: Link in replies
> > - Go to this link and follow the steps: [Install Windows Subsystem for Linux (WSL) on Windows 10 | Microsoft Docs](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
> > - Go to powershell (run as administrator) and run: `wsl --set-version Ubuntu-18.04 2` or `wsl --set-version Ubuntu 2`, whichever distro shows up in `wsl -l -v`
> > - Conversion takes time, a few minutes
> > - Run `wsl -l -v` to make sure that Ubuntu is running on WSL 2
> > 
> > Now you can run Ubuntu-18.04 or Windows Terminal with Ubuntu and start installing the dependencies and tools
> > 
> > **Note: If you are running into an error installing one of the gems during `bundle install`: Make sure you are on Ubuntu-18.04 and not 20.04**
> > 
> > However, if you already have postgreSQL 12 and running on port 5432, you might run into some issues, since the dependencies install postgreSQL 10, which might increment the port to 5433.  
> > To fix that:
> > 
> > - Open your folder in a text editor (VS Code for example)
> > - Go to `config/database.yml`
> > - Under development and under adapter, add a new line and then add: **port: 5433**
> > - Make sure you do the same for test and profile.
> > 
> > If the above doesn’t work, make sure to check if PostgreSQL is running and at which port via `pg_isready`. Then follow the same instructions above, setting the port equal to the one the database is running on.
> > 
> > FOR THE LINUX KERNEL: [Updating the WSL 2 Linux kernel | Microsoft Docs](https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel)
> 
> > [@RickyC0626](#):
> >
> > A solution that does not require explicit port configuration in `database.yml`
> > 
> > Some errors during database creation and migration:
> > 
> > ## Invalid Redis connection to a specific port / connection refusal
> > 
> > ```sh
> > bundle exec rake db:create
> > 
> > ```
> > 
> > ```plaintext
> > rake aborted!
> > Redis::CannotConnectError: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)
> > ...
> > 
> > Caused by:
> > Errno::ECONNREFUSED: Connection refused - connect(2) for 127.0.0.1:6379
> > ...
> > 
> > Caused by:
> > IO::EINPROGRESSWaitWritable: Operation now in progress - connect(2) would block
> > ...
> > 
> > Tasks: TOP => db:create => db:load_config => environment
> > (See full trace by running task with --trace)
> > 
> > ```
> > 
> > **From this error we can see that the port Redis uses is `6379`, and we can fix this by starting the Redis server via that port.**
> > 
> > By default, `redis-server --daemonize yes` should work, but if not, use:
> > 
> > ```sh
> > redis-server --daemonize yes --port 6379
> > 
> > ```
> > 
> > Check status of Redis instance:
> > 
> > ```sh
> > redis-cli
> > 
> > 127.0.0.1:6379> ping
> > PONG
> > 
> > ```
> > 
> > ## Invalid connection to psql port
> > 
> > ```sh
> > bundle exec rake db:migrate
> > 
> > ```
> > 
> > ```plaintext
> > PG::ConnectionBad: could not connect to server: No such file or directory
> > Is the server running locally and accepting
> > connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
> > 
> > ```
> > 
> > **From this error we can see that PostgreSQL is having trouble connecting to port `5432`. Usually starting the service should work**
> > 
> > ```sh
> > sudo service postgresql start
> > 
> > ```
> > 
> > If this still doesn’t work and the error persists, try checking to see which port the service is listening from, and if necessary, change the port to the one you want in [postgresql.conf](https://stackoverflow.com/questions/187438/change-pgsql-port):
> > 
> > ```sh
> > pg_isready
> > 
> > ```
> > 
> > ```plaintext
> > /var/run/postgresql:5432 - no response
> > or
> > /var/run/postgresql:5432 - accepting connections
> > 
> > ```
> > 
> > * * *
> > 
> > ## The Result
> > 
> > Once we have done the above or executed the `start-discourse` command, the two instances should run on their default/specified ports. To check their status via the default Windows `cmd` terminal, we can run:
> > 
> > ```sh
> > netstat -anop tcp
> > 
> > ```
> > 
> > which will show something like this:
> > 
> > ```plaintext
> > Proto Local Address Foreign Address State PID
> > TCP 127.0.0.1:5432 0.0.0.0:0 LISTENING 17768
> > TCP 127.0.0.1:6379 0.0.0.0:0 LISTENING 17768
> > 
> > ```
> > 
> > We have now confirmed that both our postgresql and redis-server instances are running.
> > 
> > We can also check the status of the instances on Ubuntu or WSL, with the following commands:
> > 
> > ```sh
> > lsof -i
> > 
> > ```
> > 
> > ```plaintext
> > COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
> > mailcatch 3244 rickyc0626 7u IPv4 36127 0t0 TCP localhost:1025 (LISTEN)
> > mailcatch 3244 rickyc0626 8u IPv4 36128 0t0 TCP *:socks (LISTEN)
> > redis-ser 3287 rickyc0626 6u IPv6 29352 0t0 TCP *:6379 (LISTEN)
> > redis-ser 3287 rickyc0626 7u IPv6 29353 0t0 TCP *:6379 (LISTEN)
> > 
> > ```
> > 
> > * * *
> > 
> > ```sh
> > sudo ss -plunt | grep postgres
> > 
> > ```
> > 
> > ```plaintext
> > tcp LISTEN 0 128 127.0.0.1:5432 0.0.0.0:* users:(("postgres",pid=3070,fd=7))
> > 
> > ```
> > 
> > * * *
> > 
> > ```sh
> > pg_lsclusters
> > 
> > ```
> > 
> > ```plaintext
> > Ver Cluster Port Status Owner Data directory Log file
> > 10 main 5432 online postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
> > 
> > ```
> > 
> > * * *
> > 
> > From here, these commands should work with no major issues, without needing to modify the `database.yml` file:
> > 
> > ```sh
> > bundle exec rake db:create
> > bundle exec rake db:migrate
> > RAILS_ENV=test bundle exec rake db:create db:migrate
> > 
> > ```
> > 
> > Any further issues that show up can be addressed in the future.

> **As of July 1, 2020**
>
> > [@RickyC0626](#):
> >
> > A solution that does not require explicit port configuration in `database.yml`
> > 
> > Some errors during database creation and migration:
> > 
> > ## Invalid Redis connection to a specific port / connection refusal
> > 
> > ```sh
> > bundle exec rake db:create
> > 
> > ```
> > 
> > ```plaintext
> > rake aborted!
> > Redis::CannotConnectError: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)
> > ...
> > 
> > Caused by:
> > Errno::ECONNREFUSED: Connection refused - connect(2) for 127.0.0.1:6379
> > ...
> > 
> > Caused by:
> > IO::EINPROGRESSWaitWritable: Operation now in progress - connect(2) would block
> > ...
> > 
> > Tasks: TOP => db:create => db:load_config => environment
> > (See full trace by running task with --trace)
> > 
> > ```
> > 
> > **From this error we can see that the port Redis uses is `6379`, and we can fix this by starting the Redis server via that port.**
> > 
> > By default, `redis-server --daemonize yes` should work, but if not, use:
> > 
> > ```sh
> > redis-server --daemonize yes --port 6379
> > 
> > ```
> > 
> > Check status of Redis instance:
> > 
> > ```sh
> > redis-cli
> > 
> > 127.0.0.1:6379> ping
> > PONG
> > 
> > ```
> > 
> > ## Invalid connection to psql port
> > 
> > ```sh
> > bundle exec rake db:migrate
> > 
> > ```
> > 
> > ```plaintext
> > PG::ConnectionBad: could not connect to server: No such file or directory
> > Is the server running locally and accepting
> > connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
> > 
> > ```
> > 
> > **From this error we can see that PostgreSQL is having trouble connecting to port `5432`. Usually starting the service should work**
> > 
> > ```sh
> > sudo service postgresql start
> > 
> > ```
> > 
> > If this still doesn’t work and the error persists, try checking to see which port the service is listening from, and if necessary, change the port to the one you want in [postgresql.conf](https://stackoverflow.com/questions/187438/change-pgsql-port):
> > 
> > ```sh
> > pg_isready
> > 
> > ```
> > 
> > ```plaintext
> > /var/run/postgresql:5432 - no response
> > or
> > /var/run/postgresql:5432 - accepting connections
> > 
> > ```
> > 
> > * * *
> > 
> > ## The Result
> > 
> > Once we have done the above or executed the `start-discourse` command, the two instances should run on their default/specified ports. To check their status via the default Windows `cmd` terminal, we can run:
> > 
> > ```sh
> > netstat -anop tcp
> > 
> > ```
> > 
> > which will show something like this:
> > 
> > ```plaintext
> > Proto Local Address Foreign Address State PID
> > TCP 127.0.0.1:5432 0.0.0.0:0 LISTENING 17768
> > TCP 127.0.0.1:6379 0.0.0.0:0 LISTENING 17768
> > 
> > ```
> > 
> > We have now confirmed that both our postgresql and redis-server instances are running.
> > 
> > We can also check the status of the instances on Ubuntu or WSL, with the following commands:
> > 
> > ```sh
> > lsof -i
> > 
> > ```
> > 
> > ```plaintext
> > COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
> > mailcatch 3244 rickyc0626 7u IPv4 36127 0t0 TCP localhost:1025 (LISTEN)
> > mailcatch 3244 rickyc0626 8u IPv4 36128 0t0 TCP *:socks (LISTEN)
> > redis-ser 3287 rickyc0626 6u IPv6 29352 0t0 TCP *:6379 (LISTEN)
> > redis-ser 3287 rickyc0626 7u IPv6 29353 0t0 TCP *:6379 (LISTEN)
> > 
> > ```
> > 
> > * * *
> > 
> > ```sh
> > sudo ss -plunt | grep postgres
> > 
> > ```
> > 
> > ```plaintext
> > tcp LISTEN 0 128 127.0.0.1:5432 0.0.0.0:* users:(("postgres",pid=3070,fd=7))
> > 
> > ```
> > 
> > * * *
> > 
> > ```sh
> > pg_lsclusters
> > 
> > ```
> > 
> > ```plaintext
> > Ver Cluster Port Status Owner Data directory Log file
> > 10 main 5432 online postgres /var/lib/postgresql/10/main /var/log/postgresql/postgresql-10-main.log
> > 
> > ```
> > 
> > * * *
> > 
> > From here, these commands should work with no major issues, without needing to modify the `database.yml` file:
> > 
> > ```sh
> > bundle exec rake db:create
> > bundle exec rake db:migrate
> > RAILS_ENV=test bundle exec rake db:create db:migrate
> > 
> > ```
> > 
> > Any further issues that show up can be addressed in the future.

* * *

_Last Reviewed by @SaraDev on 2022-06-16T02:00:00Z_

* * *

This document is version controlled - suggest changes [on github](https://github.com/discourse/discourse/blob/main/docs/developer-guides/docs/02-development-environments/06-windows-10-setup.md).

---

<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: [April 15, 2023, 12:07am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/102 "2023-04-15T00:07:10Z")

</div>

> [@Arkshine](#):
>
> On a fresh Ubuntu 22 (windows 10, WSL2) and successful Discourse installation, all the image images fail to be served on the default port 4200.

Alright, found a solution.

I noticed that replacing `127.0.0.1` with `localhost` would fix the images.

After searching a bit, this the command you can use to start Discourse:

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

* * *

I will try to update the guide later.

---

<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 6, 2023, 9:51pm UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/105 "2023-05-06T21:51:12Z")

</div>

Any chance to review this PR?

[https://github.com/discourse/install-rails/pull/45/files](https://github.com/discourse/install-rails/pull/45/files)

That would make this guide a little friendlier.

---

<div class="post-metadata">

### Author: ![Will\_S1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/will_s1/32/311520_2.png) [@Will\_S1](https://meta.discourse.org/u/Will_S1)
#### Post date: [June 15, 2023, 7:13am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/106 "2023-06-15T07:13:53Z")

</div>

Any idea why I’m getting “Unfortunately, an unexpected error occurred, and Bundler cannot continue.” After `bundle install `?

---

<div class="post-metadata">

### Author: ![D111](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/d111/32/311961_2.png) [@D111](https://meta.discourse.org/u/D111)
#### Post date: [June 18, 2023, 4:14am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/107 "2023-06-18T04:14:14Z")

</div>

same problem

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [June 19, 2023, 6:02am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/108 "2023-06-19T06:02:41Z")

</div>

Can you supply a screenshot of the error. What version of Ruby do you have installed?

---

<div class="post-metadata">

### Author: ![frocm](https://avatars.discourse-cdn.com/v4/letter/f/a3d4f5/32.png) [@frocm](https://meta.discourse.org/u/frocm)
#### Post date: [October 1, 2023, 9:35pm UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/109 "2023-10-01T21:35:04Z")

</div>

I’m having trouble of dependencies:

```plaintext
ux430uq@Asus-UX430UQ:~/discourse$ bundle install
You must use Bundler 2 or greater with this lockfile.
ux430uq@Asus-UX430UQ:~/discourse$ bundler -v
Bundler version 1.16.1

ux430uq@Asus-UX430UQ:~/discourse$ gem install bundler

Fetching: bundler-2.4.20.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.5.0 directory.
ux430uq@Asus-UX430UQ:~/discourse$
ux430uq@Asus-UX430UQ:~/discourse$ sudo gem install bundler
[sudo] password for ux430uq:
Fetching: bundler-2.4.20.gem (100%)
ERROR: Error installing bundler:
        The last version of bundler (>= 0) to support your Ruby & RubyGems was 2.3.26. Try installing it with `gem install bundler -v 2.3.26`
        bundler requires Ruby version >= 2.6.0. The current ruby version is 2.5.0.
ux430uq@Asus-UX430UQ:~/discourse$ bundler -v
Bundler version 1.16.1
ux430uq@Asus-UX430UQ:~/discourse$

```

How can I get it fixed easily? I was trying to install 2.6.0, then 2.7.0, but there are always other troubles with this.

---

<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:45am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/111 "2023-10-14T10:45:28Z")

</div>

As per some of the earlier comments, I also ran into some difficulties and errors while trying to follow this guide - tried on both a Windows 10 and Windows 11 desktop.

After some trial-and-error I finally have steps that result in a fully working development environment under Windows 11, tested on the latest 22H2 build and also on the upcoming 23H2 Release Preview (I assume it will also work on the newest build of Windows 10)

If it’s of use to anybody, I have just posted the guide here:-

> [@Guide to Setting Up Discourse Development Environment - Windows 11](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227):
>
> 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 slight_smile 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…

Hopefully this helps people like myself who are trying to get Discourse running under Windows 😃

---

<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 19, 2023, 9:40am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/112 "2023-10-19T09:40:20Z")

</div>

I went through this whole official guide again to ensure nothing broke since my last try.  
I installed Ubuntu (unspecified version) via WSL on Windows 11, which installed the last LTS version, 22.04 in this case.

I didn’t encounter any issues; all straightforward, no errors, and the dev installation works.

If you have trouble installing something using one of our official guides in the future, please write down the errors and report them to us, it’s always useful 😄

* * *

Two warnings though:

When installing Node.js:

```plaintext
================================================================================
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
================================================================================

                           SCRIPT DEPRECATION WARNING

  This script, located at https://deb.nodesource.com/setup_X, used to
  install Node.js is deprecated now and will eventually be made inactive.

  Please visit the NodeSource distributions Github and follow the
  instructions to migrate your repo.
  https://github.com/nodesource/distributions

  The NodeSource Node.js Linux distributions GitHub repository contains
  information about which versions of Node.js and which Linux distributions
  are supported and how to install it.
  https://github.com/nodesource/distributions

                          SCRIPT DEPRECATION WARNING

================================================================================
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
================================================================================

TO AVOID THIS WAIT MIGRATE THE SCRIPT
Continuing in 60 seconds (press Ctrl-C to abort) ...

```

When running `redis-server --daemonize yes`:

```plaintext
# WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

```

---

<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 20, 2023, 6:19am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/113 "2023-10-20T06:19:29Z")

</div>

Unsure why I had so many issues then! Perhaps there was something strange in my Windows install that I managed to fix during my troubleshooting without realising it! 😛

Still, I’m still happy with what I’ve learnt so far and look forward to continuing to work with migrating my forums across to Discourse.

---

<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: [October 20, 2023, 12:34pm UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/114 "2023-10-20T12:34:52Z")

</div>

> [@Canapin](#):
>
> I went through this whole official guide again to ensure nothing broke since my last try.

I had to reinstall Windows, and I have now a fresh Windows 11 installed.  
I will follow the guide and report back later! Will keep @AliBenBongo’s guide in mind as well.

---

<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: [October 21, 2023, 3:28pm UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/115 "2023-10-21T15:28:47Z")

</div>

Here is a follow-up.

The guide could surely use an update, but it still works wonderfully well on a fresh Windows 11 22H2. 👍

The only issue I had, was even though `wsl` command was working in a terminal, the WSL feature was actually not enabled by default:

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/1/7/2170cc273e84a09c67451a1e6316b0b640454469.png)

---

<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: [November 7, 2024, 11:35am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/116 "2024-11-07T11:35:35Z")

</div>

I think this guide is outdated. Steps mentioned in the Ubuntu/Debian guide don’t even exist anymore.

---

<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: [January 12, 2025, 10:13am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/117 "2025-01-12T10:13:10Z")

</div>

Is there a way to undo all these steps, e.g. reverse the install script of packages, gems, and cloning?

---

<div class="post-metadata">

### Author: ![TempAccount](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@TempAccount](https://meta.discourse.org/u/TempAccount)
#### Post date: [June 22, 2025, 8:26pm UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/118 "2025-06-22T20:26:17Z")

</div>

> [@Discourse](#):
>
> **WARNING:** Install Ubuntu 18.04, and not 20.04 since some installations will fail on 20.04.

Is installing 18.04 over 20.04 still required?

Receiving error when installing nodejs:

````plaintext
# apt install nodejs

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nodejs : Depends: libc6 (>= 2.28) but 2.27-3ubuntu1.6 is to be installed
E: Unable to correct problems, you have held broken packages.```
````

---

<div class="post-metadata">

### Author: ![saros](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@saros](https://meta.discourse.org/u/saros)
#### Post date: [April 22, 2026, 8:46am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/119 "2026-04-22T08:46:41Z")

</div>

> [@Arkshine](#):
>
> Okay, I found a solution.
> 
> I noticed that replacing `127.0.0.1` with `localhost` resolves the image issue.
> 
> After some searching, you can start Diwsl using the following command:

Installation failed on 24.04; the host machine cannot connect to port 3000.

---

<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: [April 22, 2026, 10:18am UTC](https://meta.discourse.org/t/install-discourse-on-windows-for-development/75149/120 "2026-04-22T10:18:42Z")

</div>

I have it running on 24.04. I recommend sharing more information about what things look like when you start the server.

Try `FORCE_HOSTNAME=localhost bin/ember-cli -u` which will run both back end and front end servers simultaneously.

(On the road: from memory)
