# How to install Discourse locally?

**URL:** https://meta.discourse.org/t/how-to-install-discourse-locally/185116
**Category:** Self-hosting
**Created:** [April 1, 2021, 2:43pm UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116 "2021-04-01T14:43:28Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Marcin\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcin_j/32/215377_2.png) [@Marcin\_J](https://meta.discourse.org/u/Marcin_J)
#### Post date: [April 1, 2021, 2:43pm UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/1 "2021-04-01T14:43:29Z")

</div>

I’m looking into Discourse as a candidate for a forum in my project.  
I am a bit surprised by how convoluted it is to actually run the stack.

On GitHub there is [this](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) instruction - it requires an SMTP server and a domain.

I also saw another [guide](https://github.com/discourse/discourse/blob/master/docs/DEVELOPER-ADVANCED.md) which goes through the installation of the stack on the host directly. I’d prefer to rely on Docker to have all these dependencies set up 🙂  
What also confused me is that the first guide put great emphasis on the fact that I need SMTP server, and DNS. This one does not mention that at all.

It seemed to me that since it is all dockerized, I should be able to just run some Docker Compose to have Discourse and the database (as I see it’s Postgresql) containers running (+ possibly some other containers, like caching if Discourse needs it). Then, in production, I’d probably host in on Kubernetes (seems to not be so easy as I’ve read in some thread).

Am I missing something?

---

<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 1, 2021, 2:48pm UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/2 "2021-04-01T14:48:56Z")

</div>

> [@Install Discourse for development using Docker](https://meta.discourse.org/t/beginners-guide-to-install-discourse-for-development-using-docker/102009):
>
> Developing using Docker Since Discourse runs in Docker, you should be able to run Discourse directly from your source directory using a Discourse development container. white_check_mark Pros: No need to install any system dependencies, no configuration needed at all for setting up a development environment quickly. x Cons: Will be slightly slower than the native dev environment on Ubuntu, and much slower than a native install on MacOS. See also [Developing Discourse using a Dev Container](https://meta.discourse.org/t/developing-discourse-using-a-dev-container/336366) …

and without docker (in case of interest/you find above too slow):

> [@Install Discourse on Ubuntu or Debian for Development](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-ubuntu-for-development/14727):
>
> warning This guide covers installation instructions in a development environment. For a production guide see: [Install Discourse in production with the official supported instructions](https://meta.discourse.org/t/how-to-install-discourse-in-production/142537) So you want to set up Discourse on Ubuntu or Debian to hack on and develop with? We’ll assume that you work locally and don’t have Ruby/Rails/Postgres/Redis installed on your Ubuntu or Debian system. Let’s begin! Requirements We suggest having at least 4 GB RAM and 2 CPU cores. Current compatibility: O…

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 1, 2021, 3:04pm UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/3 "2021-04-01T15:04:55Z")

</div>

Do you want a development install or a production install? If it’s the latter, then see[Discourse official Standard Installation](https://meta.discourse.org/t/discourse-official-standard-installation/142537). Running under k8s is possible, but it’s not straightforward, as you need to use `./launcher` to build the container. And doing a full no-downtime upgrade requires a few steps that are not immediately obvious. If you want it to be easy, just spin up a VM (a bit easier if it runs Ubuntu or Debian).

Yes, you need to be able to send email for production. For development, you obviously don’t need that.

---

<div class="post-metadata">

### Author: ![Marcin\_J](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcin_j/32/215377_2.png) [@Marcin\_J](https://meta.discourse.org/u/Marcin_J)
#### Post date: [April 2, 2021, 6:34am UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/4 "2021-04-02T06:34:13Z")

</div>

@merefield Thanks for the Docker link. That works, and that’s close to what I imagined the process would look like. Although, it’s a bit weird that everything is packaged into one container. And yeah, it is slow.  
What surprised me is that when I `git clone` discourse, and `cd discourse`, my shell becomes really slow - first time I see that 🙂 . This repo must contain lots of files, or something, although I’m not sure why that would impact my shell.

@pfaffman I’d also like to try the installation that is closer to production one, to have an idea what the process looks like. I’m fine with installation on a VM. However, what about the SMTP server and the domain? The guide is very strict about these and says that I MUST have those.  
And that would also be fine, but it’s just that I don’t fully understand some things:

- why is the domain actually needed? Why localhost is not enough?
- does the mail server need to point at the same domain as the domain I use for Discourse?
- the guide also talks about subdomains - why subdomain? I.e., I’m setting up a VM on Azure, and the VM has some DNS assigned to it (like [myvm.westeurope.cloudapp.azure.com](http://myvm.westeurope.cloudapp.azure.com)) - isn’t that domain enough?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 2, 2021, 12:20pm UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/5 "2021-04-02T12:20:52Z")

</div>

It’s for production and it requires https so you need a domain name. The azure one will work.

You don’t have to use the same domain name for the mail server as the hostname. A while back I changed discourse-setup to prompt for the notification email address.

Subdomain means just don’t use `x.com` but use `y.x.com`. That’s fairly established practice.

---

<div class="post-metadata">

### Author: ![Im\_Nim](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/im_nim/32/215769_2.png) [@Im\_Nim](https://meta.discourse.org/u/Im_Nim)
#### Post date: [April 5, 2021, 3:41am UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/6 "2021-04-05T03:41:00Z")

</div>

Hi Marcin,

I have the same concern with you about the domain names for discourse. WHY LOCALHOST IS NOT ENOUGH?

I just only install discourse for my team to play but cannot without DNS. We tried to add DNS resource with localhost to the hosts file on my server to resolve but unsuccessful.

Does anyone try to run discourse without public domain?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 5, 2021, 8:35am UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/7 "2021-04-05T08:35:20Z")

</div>

> [@Im\_Nim](#):
>
> Does anyone

No. If you want to run a development install you don’t need a hostname, but it works only for localhost. If you want your team to use it, you need a host name. If you have a team, surely you have a domain name? Just create some subdomain of whatever your company uses, pay $12 for a host name, or do the free trial.

---

<div class="post-metadata">

### Author: ![thebetterjort](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thebetterjort/32/219919_2.png) [@thebetterjort](https://meta.discourse.org/u/thebetterjort)
#### Post date: [May 6, 2021, 11:17pm UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/8 "2021-05-06T23:17:04Z")

</div>

Well for us – we don’t want discourse to be public. We want an internal discussion board. I’m with the others, localhost fails, install fails when you are just trying to give it a test run. Really off putting and the crazy scripts instead of the well known and standard ‘docker-compose up -d --build’ is alarming to say the least.. I don’t know if I want to use this product because it takes itself too seriously… or at least somebody who wrote the launcher is.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 7, 2021, 2:18am UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/9 "2021-05-07T02:18:37Z")

</div>

Or maybe it was written before `docker-compose` was a viable utility and it still works on thousands of sites and a change would risk breaking them all for an edge case.

If the server has access to the outside world its not that hard to disable the https stuff, though I’ve not done it in a while.

---

<div class="post-metadata">

### Author: ![thebetterjort](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thebetterjort/32/219919_2.png) [@thebetterjort](https://meta.discourse.org/u/thebetterjort)
#### Post date: [May 7, 2021, 4:54am UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/10 "2021-05-07T04:54:23Z")

</div>

@pfaffman That is exactly what happened when docker-compose was released in 2015. It was met with healthy skepticism.

My organization has no public servers. Can I get discourse, which frankly is the best solution going without a .com?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 7, 2021, 12:13pm UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/11 "2021-05-07T12:13:16Z")

</div>

You need a domain name, but it does not need to be on a public ip. If your server can access the internet (to download discourse and it’s pieces) then you can turn off the let’s encrypt stuff and it should work. I think you just need to delete the ssl and let’s encrypt templates in the yml file, but you won’t be able to use `discourse-setup`. Copy the standalone sample and edit it by hand.

You still need a mail server.

---

<div class="post-metadata">

### Author: ![Abhilash\_Ebooks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/abhilash_ebooks/32/266635_2.png) [@Abhilash\_Ebooks](https://meta.discourse.org/u/Abhilash_Ebooks)
#### Post date: [July 12, 2022, 1:31pm UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/12 "2022-07-12T13:31:58Z")

</div>

I wish I could do it easily on Mac M1

---

<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: [July 12, 2022, 1:48pm UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/13 "2022-07-12T13:48:13Z")

</div>

I have Discourse running in development mode on my M1 Pro locally with no issues.

> [@Install Discourse on macOS for development](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-macos-for-development/15772):
>
> warning This guide covers installation instructions for a macOS development environment, for production guides see: [Install Discourse in production with the official supported instructions](https://meta.discourse.org/t/how-to-install-discourse-in-production/142537) So you want to set up Discourse on macOS to hack on and develop with? We’ll assume that you don’t have Ruby/Rails/Postgres/Redis installed on your Mac. Let’s begin rocket ! 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 s…

---

<div class="post-metadata">

### Author: ![crcoli7307](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/crcoli7307/32/267901_2.png) [@crcoli7307](https://meta.discourse.org/u/crcoli7307)
#### Post date: [July 12, 2022, 3:45pm UTC](https://meta.discourse.org/t/how-to-install-discourse-locally/185116/14 "2022-07-12T15:45:57Z")

</div>

> [@Marcin\_J](#):
>
> why is the domain actually needed? Why localhost is not enough?

It’s needed for several reasons. Although you can get a domain for free at [FreeNom](https://freenom.com), however there has been a lot of controversy on how FreeNom handles data and user information so be careful if you choose to take that route.
