# Discourse-app container start dan stopt stilzwijgend

**URL:** https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [13 september 2022 om 07:58 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859 "2022-09-13T07:58:45Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [13 september 2022 om 07:58 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/1 "2022-09-13T07:58:45Z")

</div>

Dear Community,

I’ve tried to install a private instance of Discourse, following the official instructions at [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md). Even though the scripts look utterly complex, I had to manually modify the container.yml and the discourse-setup files to set my own settings…

1st issue : despite its complexity, the installation script doesn’t allow for exposed port modification! Ports 80/443 can’t be used on my server, being used by nginx. So I had once again to tweak the setup script to set ports 3080/3443 as the required ports to access Discourse.

Then I managed to have all containers up and running. Looking at the stack with Portainer, I found out that the application starts and silently stops and the logs don’t give much information on the reason. As redis and postgres don’t publish any port, could the discourse app fails because it cannot connect to these components? What did I miss or do wrong?

 ![Capture d’écran 2022-09-13 095447](https://global.discourse-cdn.com/meta/original/4X/6/e/9/6e94bff4a75bb5baf3a4fa5ecd5e8c059ea85206.png)

[\_discourse-app\_logs.txt](https://meta.discourse.org/uploads/short-url/35Kbnn2ojcw43WqEYH8dIoXFbJZ.txt) (10,4 Ko)

Thanks in advance for any help!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [13 september 2022 om 08:09 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/2 "2022-09-13T08:09:45Z")

</div>

```plaintext
Caused by:

Errno::EADDRNOTAVAIL: Cannot assign requested address - connect(2) for [::1]:6379

```

So it’s unable to connect to Redis on the IPv6 loopback address.

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [13 september 2022 om 08:33 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/3 "2022-09-13T08:33:15Z")

</div>

Hi Richard, thanks for the quick answer! I’m not an IT professional, just like to play with tools: what would be the fix for this issue?

Thanks in advance for your advice!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [13 september 2022 om 09:20 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/4 "2022-09-13T09:20:49Z")

</div>

It seems like you have deviated from the [standard install](https://meta.discourse.org/t/142537?silent=true) by setting up separate containers for Redis and Postgres, so I’m afraid I don’t have an out of the box answer for you. How did you configure the Redis settings within Discourse?

Another thing - I do see `redis:4-alpine`. I’m afraid you’ll need to move to a newer version of Redis since Discourse requires version 6.20 or higher. I don’t think this is the cause of your issue though.

---

<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: [13 september 2022 om 09:53 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/5 "2022-09-13T09:53:15Z")

</div>

The setup script works only for a standard setup. If you’re doing something more complex you have to edit the yml by hand. That’s much simpler than modifying the script.

Discourse won’t work on a non standard port. You’ll need a reverse proxy in front. See topics like [Run other websites on the same machine as Discourse](https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247).

If you’re not going to use the provided postgres and redis then you’re on your own figuring out why yours doesn’t work. There are too many things that it could be that we cannot guess or infer. I’d recommend a [standard install](https://meta.discourse.org/t/142537?silent=true) on a separate vm to see how things work before trying a very complex setup.

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [13 september 2022 om 11:45 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/6 "2022-09-13T11:45:06Z")

</div>

I didn’t perform any ‘non-standard’ install! I’ve, as actually described in the documentation, download the whole stuff from Github, changed the exposed ports only and ran the script:

- I didn’t change anything in redis configuration, nor postgres.
- I didn’t change anything for redis version.  
These pieces of software have been installed by the genuine discourse-setup script.

@pfaffman what do you mean by “editing the yml by hand”? Which yml do you talk about? There are plenty of .yml files in “containers”…

By the way, I have actually a reverse proxy on the box, which seems to have a simple config: multiple subdomain.conf files which define the redirection subdomain:80 → port XXX. Is it what’s required?

> I’d recommend a [standard install](https://meta.discourse.org/t/142537) on a separate vm to see how things work before trying a very complex setup.

I don’t want a complex setup 😊, just need to run Discourse along some other containers, which is what Docker is designed for…

Thanks again for your help!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [13 september 2022 om 12:03 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/7 "2022-09-13T12:03:45Z")

</div>

In general `discourse-setup` does not install separate postgres and redis instances and certainly not versions 12 and 4.

Can you please post your configuration and the changes you made to `container.yml` and the scripts? Make sure to redact any confidential settings.  
Also, please let us know which commit of the `discourse_docker` repository you’re at.

---

<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: [13 september 2022 om 12:19 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/8 "2022-09-13T12:19:45Z")

</div>

> [@jlgarnier](#):
>
> I didn’t perform any ‘non-standard’ install!

You edited both the discourse-setup and a file that will be overwritten when you update discourse-docker. Changing anything other than your app.yml is decidedly non-standard.

> [@jlgarnier](#):
>
> I had to manually modify the container.yml and the discourse-setup files to set my own settings…

Why? And whatever it is that you needed to change there, that’s not how to do it. You’ll need to put those changes into your `app.yml`.

> [@jlgarnier](#):
>
> . So I had once again to tweak the setup script to set ports 3080/3443 as the required ports to access Discourse.

Discourse won’t work on a non-standard port, so this is not a [standard install](https://meta.discourse.org/t/142537?silent=true).

The [standard install](https://meta.discourse.org/t/142537?silent=true) includes postgres and redis in the single container. As pointed out, you’re using unsupported versions of redis and postgres. You can also do a two container installation as described here [Move from standalone container to separate web and data containers](https://meta.discourse.org/t/move-from-standalone-container-to-separate-web-and-data-containers/29413) (and you can use `./discourse-setup --two-container` to have `discourse-setup` create separate data and web containers, though it’s a bit more complicated to mainain (you have to know when to update the data container).

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [13 september 2022 om 15:00 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/9 "2022-09-13T15:00:19Z")

</div>

OK, I then need to:

- wipe all the software that was installed with the modified scripts (hope this will easily reversible).
- download the script again. I’ve used `git clone https://github.com/discourse/discourse_docker.git /var/discourse` for the current installation: is it OK?
- change possibly some settings in the file app.yml only, before running `./discourse-setup`.
- run the installation script for [standard install](https://meta.discourse.org/t/142537?silent=true) (I do prefer one single container).
- setup the nginx proxy to route [discourse.example.com:80/443](http://discourse.example.com:80/443) to the proper container. Does the documentation give hints for this part?

Please complete the list if I skipped any step!

Thanks again for your help!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [13 september 2022 om 20:33 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/10 "2022-09-13T20:33:33Z")

</div>

> [@jlgarnier](#):
>
> I’ve used `git clone https://github.com/discourse/discourse_docker.git /var/discourse` for the current installation: is it OK

✅

> [@jlgarnier](#):
>
> setup the nginx proxy to route [discourse.example.com:80/443](http://discourse.example.com:80/443) to the proper container. Does the documentation give hints for this part?

See [Run other websites on the same machine as Discourse](https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247)

---

<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: [14 september 2022 om 16:35 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/11 "2022-09-14T16:35:32Z")

</div>

> [@jlgarnier](#):
>
> wipe all the software that was installed w

The only thing it will install is docker.

> [@jlgarnier](#):
>
> download the script again. I’ve used `git clone https://github.com/discourse/discourse_docker.git /var/discourse` for the current installation: is it OK?

Looks good.

> [@jlgarnier](#):
>
> change possibly some settings in the file app.yml only, before running `./discourse-setup`.

`app.yml` gets created by `discourse-setup`. You can’t run `discourse-setup` if it can’t access the ports, but if you read the source you’ll see that you can `./discourse-setup --skip-connection-test` and run it anyway.

Your nginx will be responsible for let’s encrypt, so you’ll want to comment out the let’s encrypt template. I suspect that’s described in the reverse proxy topic linked above and below.

> [@jlgarnier](#):
>
> setup the nginx proxy

See [Using Nginx Proxy Manager to manage multiple sites with Discourse](https://meta.discourse.org/t/using-nginx-proxy-manager-to-manage-multiple-sites-with-discourse/206344) or [Run other websites on the same machine as Discourse](https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247) (which has already been linked).

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [15 september 2022 om 07:37 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/12 "2022-09-15T07:37:02Z")

</div>

Hi @pfaffman,

Reading the documentation on [Run other websites on the same machine as Discourse](https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247), I need some confirmation:

- The post says

> You cannot use `./discourse-setup` to set up Discourse if another server is using port 80 or 443. You will need to copy and edit `samples/standalone.yml` with your favorite text editor.

and I understand that I need to modify app.yml **before** running discourse-setup, as already said in the preamble

> You cannot use `./discourse-setup` to set up Discourse if another server is using port 80 or 443. You will need to copy and edit `samples/standalone.yml` with your favorite text editor.

Can you then please confirm the following process:

- download the whole stuff from Github
- run discourse-setup once with the option `--skip-connection-test` → this will create the containers/app.yml
- modify app.yml as decribed in the documentation above
- update the software with `/var/discourse/launcher rebuild app`
- create the nginx site to point to the Discourse socket and restart nginx
- finally launch a browser to access Discourse at [https://discourse.mydomain.com](https://discourse.mydomain.com), which simply points to the server IP.

Thanks in advance for your advice!

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [15 september 2022 om 09:15 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/13 "2022-09-15T09:15:19Z")

</div>

Update:

- download the whole stuff from Github : DONE
- run discourse-setup once with the option `--skip-connection-test` : everything went fine until the end, where the script returned

```plaintext
docker: Error response from daemon: driver failed programming external connectivity on endpoint app (784361985c928eb26b149d829f37882056562d9b1e77ef4ce71fbfe30c5d80b1): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use.

```

This looks normal to me, as the container tries to access the same ports than the existing webserver. However, as no discourse container has been created (as returned by `docker container ls`), I’d like you to confirm this before going further with the nginw config…

Thanks in advance for your help!

---

<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: [15 september 2022 om 10:18 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/14 "2022-09-15T10:18:02Z")

</div>

I think you need to comment out the ports.

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [15 september 2022 om 11:25 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/15 "2022-09-15T11:25:49Z")

</div>

You mean “before running discourse-setup”? In that case, which file should I modify, as app.yml doesn’t exist before I run the script? I want to install a 1-container app: should I run the same discourse-setup script again or the `/var/discourse/launcher rebuild app` command?

By the way, is my process above correct?

---

<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: [15 september 2022 om 12:41 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/16 "2022-09-15T12:41:50Z")

</div>

Edit the existing file with `nano` or similar and comment out the ports. `./launcher rebuild app`.

Probably for your case, you could also use `--skip-rebuild` as well, so you’d run

```plaintext
./discourse-setup --skip-connection-test --skeip-rebuild
nano containers/app.yml
./launcher rebuild app

```

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [15 september 2022 om 13:23 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/17 "2022-09-15T13:23:12Z")

</div>

Sorry to bother you, I need to be 100% sure as I’m definitely not an expert 😉:

- I run **once again** `./discourse-setup --skip-connection-test --skip-rebuild` (previous run was without the --skip-rebuild option). **I don’t need to delete what has been installed by the previous run**.
- Then I edit the existing app.yml file and comment out the ports (they’re already commented out)
- Then I run `./launcher rebuild app`

Thanks again for your time!

---

<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: [15 september 2022 om 16:58 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/18 "2022-09-15T16:58:05Z")

</div>

You don’t need to run `discourse-setup` ever again (unless, perhaps, you change the amount of RAM you have and want it to update the memory settings to the default recommended ones).

Just edit the ports and rebuild

---

<div class="post-metadata">

### Author: ![jlgarnier](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@jlgarnier](https://meta.discourse.org/u/jlgarnier)
#### Post date: [16 september 2022 om 07:52 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/19 "2022-09-16T07:52:55Z")

</div>

Hi Jay,

Here’s the result of this morning rebuild:

- `./launcher rebuild app` = OK, some warnings, but docker says local\_discourse/up is up and running.
- I’ve setup an nginx site according to instructions given in [Run other websites on the same machine as Discourse](https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247) and restarted nginx = OK.
- I’ve setup a DNS entry to have [discourse.mydomain.com](http://discourse.mydomain.com) pointing at the server IP address = OK.
- Opening a browser to [discourse.mydomain.com](http://discourse.mydomain.com) leads me to… the Nextcloud instance running on the server. Seems the configuration should be fixed, as traffic is not properly routed to the discourse container…

I don’t want to install NPM as I read it’s not a robust tool and the config for discourse involves IP hard-coding: should I anyway?

Thanks in advance for your advices!

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [16 september 2022 om 07:56 UTC](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859/20 "2022-09-16T07:56:37Z")

</div>

> [@jlgarnier](#):
>
> Seems the configuration should be fixed, as traffic is not properly routed to the discourse container

So this sounds like a problem on your reverse proxy nginx that you have in front of your Discourse installation.

> [@jlgarnier](#):
>
> I don’t want to install NPM as I read it’s not a robust tool

Wait…? What? And why would you need to install NPM outside of the container?

[Volgende pagina](https://meta.discourse.org/t/discourse-app-container-starts-then-silently-stops/238859.md?page=2)
