# Install Discourse for development using Docker

**URL:** https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009
**Category:** Developer Guides
**Tags:** docker, dev-install, how-to
**Created:** [November 16, 2018, 9:40am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009 "2018-11-16T09:40:04Z")
**Posts on this page:** 20
**Page:** 4

<div class="post-metadata">

### Author: ![Vin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vin/32/209238_2.png) [@Vin](https://meta.discourse.org/u/Vin)
#### Post date: [February 11, 2021, 2:21am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/148 "2021-02-11T02:21:43Z")

</div>

Hello,

I’m getting this error when trying to run `d/boot_dev --init`

```plaintext
Errno::EACCES: Permission denied @ dir_s_mkdir - tmp
/src/config/boot.rb:23:in `<top (required)>'
/src/config/application.rb:16:in `require'
/src/config/application.rb:16:in `<top (required)>'
/src/Rakefile:7:in `require'
/src/Rakefile:7:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)

```

Any ideas on how I fix it? Tried searching for it everywhere but didn’t find any solutions.

Edit: fixed it by doing `chmod -R 777 ~/discourse`, but now I’m getting this error:

`gifsicle worker: gifsicle not found; please provide proper binary or disable this worker (--no-gifsicle argument or :gifsicle => false through options)`

---

<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: [February 18, 2021, 4:50am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/149 "2021-02-18T04:50:57Z")

</div>

> [@Vin](#):
>
> gifsicle worker: gifsicle not found; please provide proper binary or disable this worker (–no-gifsicle argument or :gifsicle =\> false through options)

That is not an issue, we removed our usage recently, the warning is not a concern. Are you working against old Discourse code?

---

<div class="post-metadata">

### Author: ![Vin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vin/32/209238_2.png) [@Vin](https://meta.discourse.org/u/Vin)
#### Post date: [February 18, 2021, 3:49pm UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/150 "2021-02-18T15:49:58Z")

</div>

Nope, it was the recent release. But I followed [this DigitalOcean’s tutorial](https://www.digitalocean.com/community/tutorials/how-to-install-discourse-on-ubuntu-14-04) and it’s perfectly working now.

---

<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, 7:57am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/151 "2021-04-02T07:57:33Z")

</div>

How to use plugins in this kind of setup?  
I am trying to follow [Install plugins on a self-hosted site](https://meta.discourse.org/t/install-plugins-in-discourse/19157), but it mentions `/var/discourse/containers/app.yml` file, which does not exist in my `discourse` directory.

---

<div class="post-metadata">

### Author: ![jessicah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jessicah/32/102653_2.png) [@jessicah](https://meta.discourse.org/u/jessicah)
#### Post date: [April 3, 2021, 9:45pm UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/152 "2021-04-03T21:45:02Z")

</div>

I’ve got building a discourse dev environment working and able to test my patch, but how do I get my patch into my production instance? I tried building `base`, and then `./launcher rebuild app --run-image discourse/base:build`, but it doesn’t seem to result in a running Discourse instance.

Usually I get an error about the `syslog` group missing, but I commented that out, and still didn’t end up with a running site. And nothing of note in docker logs.

---

<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: [April 15, 2021, 1:55am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/153 "2021-04-15T01:55:23Z")

</div>

We don’t really document this kind of stuff, but you would generate a “diff” file, the git apply the diff in a hook after you clone the repo. app.yml supports hooks.

A quick-and-dirty solution for self hosted single container things is just to edit the code in place and run `sv restart unicorn`

---

<div class="post-metadata">

### Author: ![juli](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juli/32/121043_2.png) [@juli](https://meta.discourse.org/u/juli)
#### Post date: [April 21, 2021, 5:54pm UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/154 "2021-04-21T17:54:23Z")

</div>

Not sure if this is the best place to ask about this problem but I’ve been unable to finish the Discourse installation using Docker on an Apple M1 computer.

After I run d/boot\_dev --init all dependencies are installed without any apparent problem but once I get to the `Migrating database` step, it stays there consuming 100% of one of my cores and it doesn’t seem to move from there.

I tried logging in to the docker container and the bundle migrate task is running at 100% but no apparent activity on the posgresql process.

Any ideas would be very helpful!

---

<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: [April 22, 2021, 12:28am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/155 "2021-04-22T00:28:20Z")

</div>

I think the virtualization support is really really new, not surprised it is a bit of an adventure.

@pmusaraj / @david any luck getting docker-dev working on m1?

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [April 22, 2021, 12:39am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/156 "2021-04-22T00:39:08Z")

</div>

I haven’t tried it yet.

---

<div class="post-metadata">

### Author: ![juli](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juli/32/121043_2.png) [@juli](https://meta.discourse.org/u/juli)
#### Post date: [April 22, 2021, 6:46pm UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/157 "2021-04-22T18:46:34Z")

</div>

If anyone is able to run Discourse using docker in a M1 Mac, please let me know. In the mean time, I’ll try to follow the other guide! Thank you!

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [April 22, 2021, 7:29pm UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/158 "2021-04-22T19:29:09Z")

</div>

I tried briefly today, and got stuck at the same step as you, but with an error:

```plaintext
Invalid gemspec in [/usr/local/lib/ruby/gems/2.7.0/specifications/default/zlib-1.1.0.gemspec]: Malformed version number string specification_version
bundler: failed to load command: rake (/usr/local/bin/rake)

```

> [@juli](#):
>
> follow the other guide

Yes, please do. There are multiple team members using Discourse on M1 (myself included) every day, so it works quite well!

Let us know if you run into any issues.

---

<div class="post-metadata">

### Author: ![juli](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juli/32/121043_2.png) [@juli](https://meta.discourse.org/u/juli)
#### Post date: [April 22, 2021, 7:44pm UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/159 "2021-04-22T19:44:54Z")

</div>

Thank you very much for your time and help! At least I’m not the only one stuck with it.

---

<div class="post-metadata">

### Author: ![hawm](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hawm](https://meta.discourse.org/u/hawm)
#### Post date: [May 2, 2021, 7:33am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/160 "2021-05-02T07:33:43Z")

</div>

Hi, i think we should make a description about the Ember-CLI here, and a shourcut for below command without enter into docker container.

 ![Screenshot from 2021-05-02 15-27-08](https://global.discourse-cdn.com/meta/original/3X/4/b/4baecec175099301dac491689ffbb47449e93176.png)

And i can’t get it work by execute above commands into container, seems container didn’t expose the 4200 port.  
 ![Screenshot from 2021-05-02 15-48-51](https://global.discourse-cdn.com/meta/optimized/3X/2/f/2f970cf4ddbc1c23804160e4d9c28c899388e081_2_690x35.png)

Manual expose the port 4200 by edit `d/boot_dev`:

 ![Screenshot from 2021-05-02 16-09-16](https://global.discourse-cdn.com/meta/original/3X/6/f/6f5a0a6a1473eaeee36def0717709dac2ab1b1e0.png)

After reboot container I access `localhost:4200` got this:

 ![Screenshot from 2021-05-02 16-03-33](https://global.discourse-cdn.com/meta/original/3X/2/c/2c331a15df91a77c7e9372ec0b0d9995cae766a6.png)

```plaintext
discourse@discourse:/tmp$ cat error.dump.cab4cc444229d44fc0fce2deb8695880.log 
=================================================================================

ENV Summary:

  TIME: Sun May 02 2021 08:01:12 GMT+0000 (Coordinated Universal Time)
  TITLE: ember
  ARGV:
  - /usr/bin/node
  - /src/app/assets/javascripts/node_modules/.bin/ember
  - server
  - --proxy
  - http://localhost:3000
  EXEC_PATH: /usr/bin/node
  TMPDIR: /tmp
  SHELL: /bin/bash
  PATH:
  - /tmp/yarn--1619942449179-0.1910991449592403
  - /src/app/assets/javascripts/discourse/node_modules/.bin
  - /home/discourse/.config/yarn/link/node_modules/.bin
  - /src/app/assets/javascripts/node_modules/.bin
  - /home/discourse/.yarn/bin
  - /usr/libexec/lib/node_modules/npm/bin/node-gyp-bin
  - /usr/lib/node_modules/npm/bin/node-gyp-bin
  - /usr/bin/node_modules/npm/bin/node-gyp-bin
  - /usr/local/sbin
  - /usr/local/bin
  - /usr/sbin
  - /usr/bin
  - /sbin
  - /bin
  PLATFORM: linux x64
  FREEMEM: 8603062272
  TOTALMEM: 41962496000
  UPTIME: 612639
  LOADAVG: 3.32177734375,2.19580078125,1.47900390625
  CPUS:
  - Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz - 3301
  - Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz - 3300
  - Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz - 3300
  - Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz - 3301
  ENDIANNESS: LE
  VERSIONS:
  - ares: 1.15.0
  - brotli: 1.0.7
  - cldr: 35.1
  - http_parser: 2.9.3
  - icu: 64.2
  - modules: 64
  - napi: 7
  - nghttp2: 1.41.0
  - node: 10.23.0
  - openssl: 1.1.1g
  - tz: 2019c
  - unicode: 12.1
  - uv: 1.34.2
  - v8: 6.8.275.32-node.59
  - zlib: 1.2.11

ERROR Summary:

  - broccoliBuilderErrorStack: [undefined]
  - code: ECONNREFUSED
  - codeFrame: [undefined]
  - errorMessage: connect ECONNREFUSED 127.0.0.1:3000
  - errorType: [undefined]
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
  - message: connect ECONNREFUSED 127.0.0.1:3000
  - name: Error
  - nodeAnnotation: [undefined]
  - nodeName: [undefined]
  - originalErrorMessage: [undefined]
  - stack: Error: connect ECONNREFUSED 127.0.0.1:3000
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)

=================================================================================

```

After edit `bin/ember-cli` PORT to `3000` to `9292` all working.  
 ![Screenshot from 2021-05-02 17-55-24](https://global.discourse-cdn.com/meta/optimized/3X/5/a/5a421212921a5928c8fe55581091db4fdec8d2b6_2_690x51.png)

Seems the `ember-cli` bash unable work with `ENV["UNICORN_PORT"]` .

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [May 3, 2021, 4:24am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/161 "2021-05-03T04:24:33Z")

</div>

The Ember CLI is a new (and hard fought) development; @eviltrout should be able to comment on that soon.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [May 3, 2021, 5:27pm UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/162 "2021-05-03T17:27:45Z")

</div>

Yes this will have to be updated. In the meantime you can disable that by setting the `NO_EMBER_CLI` environment variable to `1`.

---

<div class="post-metadata">

### Author: ![Daniel\_McQuillen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_mcquillen/32/160806_2.png) [@Daniel\_McQuillen](https://meta.discourse.org/u/Daniel_McQuillen)
#### Post date: [May 21, 2021, 3:02am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/163 "2021-05-21T03:02:21Z")

</div>

Probably obvious but could you clarify where you set the env variable @eviltrout ?

I tried in the d/unicorn file like this:

`docker exec -it -u discourse:discourse discourse_dev /bin/bash -c "$CMD" -e NO_EMBER_CLI=1`

…but that didn’t work (still getting " Ember CLI is Required in Development Mode" message at localhost:9292).

---

<div class="post-metadata">

### Author: ![Alex\_P](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alex_p/32/163548_2.png) [@Alex\_P](https://meta.discourse.org/u/Alex_P)
#### Post date: [May 21, 2021, 4:59am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/164 "2021-05-21T04:59:38Z")

</div>

```
d/boot_dev -e NO_EMBER_CLI=1

```

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [May 21, 2021, 3:51pm UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/165 "2021-05-21T15:51:52Z")

</div>

> [@juli](#):
>
> If anyone is able to run Discourse using docker in a M1 Mac

I tried this today, and also ran into issues. The error I saw was because Docker’s architecture emulation doesn’t support `inotify` (which we use a lot in Discourse development). For now, I’ve added a warning to `d/boot_dev` when a non-x86\_64 architecture is detected:

```plaintext
❯ d/boot_dev 
WARNING: Docker architecture is not x86_64.
Discourse development is unlikely to work using Docker's architecture emulation.
Please try a native development installation.

```

> [@hawm](#):
>
> Hi, i think we should make a description about the Ember-CLI here

I’ve now added a `d/ember-cli` helper, and forwarded port 4200 by default. The info at the top of this topis has also been updated. Once you’ve updated, run `d/rails s` in one terminal, and `d/ember-cli` in another. I’ve also set `NO_EMBER_CLI` as one of the variables which is passed through to Docker, so that is available if needed.

---

<div class="post-metadata">

### Author: ![Daniel\_McQuillen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/daniel_mcquillen/32/160806_2.png) [@Daniel\_McQuillen](https://meta.discourse.org/u/Daniel_McQuillen)
#### Post date: [June 1, 2021, 9:32pm UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/166 "2021-06-01T21:32:14Z")

</div>

@david probs inconsequential but just FYI: The boot\_dev script prints out a false error finding on the x86\_64 check when I accidentally ran without Docker on…(but the ‘Is the docker daemon running’ part is right)…

```plaintext
WARNING: Docker architecture is not x86_64.
Discourse development is unlikely to work using Docker's architecture emulation.
Please try a native development installation.
  ...(snip)...
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

```

---

<div class="post-metadata">

### Author: ![mint\_saxon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mint_saxon/32/167253_2.png) [@mint\_saxon](https://meta.discourse.org/u/mint_saxon)
#### Post date: [June 27, 2021, 10:23am UTC](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009/167 "2021-06-27T10:23:55Z")

</div>

Thanks for this image, and the super-clear instructions!

I got `psql: error: FATAL: Peer authentication failed for user "postgres"` when running `d/boot_dev --init`.

Although the `pg_hba.conf` in `data/postgres/` had all the authentication methods set to “trust”, there was another one in `/etc/postgresql/13/main/` which had the defaults (“peer” / “md5”).

I edited `/etc/postgresql/13/main/pg_hba.conf`, changed all the methods to `trust`, did `d/shell` and ran `sv restart postgres` to pick up the changes – and was able to continue by running `d/bundle install; d/rake db:migrate RAILS_ENV=development; d/rake admin:create` manually.

Leaving here in case it’s helpful for anyone else!

[Previous page](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009.md?page=3)

[Next page](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009.md?page=5)
