Discourse Self Hosting with Docker compose

Hello everyone! :blush:

I hope you’re all doing well! I have a question about Discourse: Is it possible to self-host Discourse? I’m really interested in the platform and would love to know if anyone here has experience with it. Are there any specific requirements or tips I should keep in mind?

Thank you in advance for your help! :pray:

6 Likes

Yes, and there’s an entire Subcategory dedicated to it!:

Self-Hosting

You would want to specifically read standard install

14 Likes

Yes, you can host discourse in a http server.

3 Likes

Thank you very much for your answers!

I would like to have a standalone ‘docker-compose’ file that I can launch and use discourse in our association

Is that possible?

I’m not a fan of running a thousand scripts in the background that I don’t know

Yes it’s possible but you’d need to write and support it yourself.

Here’s a Dockerfile someone posted recently for development that might act as a starter

Discourse is open source. Why not read the launcher scripts and templates? (which would also inform your Compose)

3 Likes

This is unsupported, but there are efforts trying to keep up with mainline Discourse. You can search for docker compose here, or visit these two variants:

Careful though, maintaining Discourse across versions can prove difficult. But IndieHosters have been doing it for some years now.

Both projects use the original Discourse/base docker image but I’m not sure they’re tailoring the installation like @sam’s pups does for discourse-docker.

5 Likes

Thx for you’re replies!

I’ve installed only the discourse/base image but the container exited with no logs
The image shows a command-line interface displaying a container named "discourse-container" in a Docker environment, which was recently exited with no processes running.

Does you know why?

Because the base image does nothing by itself. You need to compile Discourse in it and then run it. And that is done by executing a ./launcher script outside of the image first. So you should first try to install it the official way and then think about the options.

The Discourse installation procedure is not very common but over the years I really like the approach for one reason, which you will only appreciate after being an admin for some time. And that is the possibility to upgrade it after each commit to the source code. It’s incredible. You report a Bug, after 1 hour it may very well be addressed by the team or the community, the automatical tests are executed and the commit is merged and available. And you can upgrade straight away. Because you recompile your Discourse on the latest source code.

So there is no image where any specific version would be compiled. You get an “empty” image and compile your version from the point you want and with the combination of plugins you need. And it still works!

You don’t get this kind of flexibility anywhere else.

So I am not sure, but if you want to make a docker compose file, you will need to replicate the ./launcher script procedure inside the compose file, so you compile it to another image, which you can then just plug in. But you cannot use the built-in procedure when you need an upgrade. You will have to go and compose a new version by yourself.

4 Likes

Thanks for your help guys. You make it easy for beginners like me to use Discourse!

Yes, but before I make Discourse available to my club, I wanted to run Discourse on the localhost and do some tests so that I can get along better with the admin interface and the command line of Discourse. If errors occur, I want to be able to fix them. For the ‘supported’ version I need a DNS entry, port 443 and 80 which is unnecessary in my case - at least I think so.

Does anyone know a hack on how to run this on the localhost?

1 Like

Install Docker and just do this.

1 Like

Yes:

https://meta.discourse.org/tags/c/documentation/developer-guides/56/dev-install

:slight_smile:

1 Like

Or that. Although I understood that Max is interested in getting to know how it behaves in production but to test it locally before purchasing a hosting environment. For that the docker setup would be more appropriate. In order to actually fix bugs, the dev setup is the right choice.

3 Likes