Running a Discourse Community Locally

SummaryPreface. Testing plugin changes directly in production can disrupt a community, so a local Discourse environment is useful for development and testing. Environment: Ubuntu 18.04.2 LTS x64 with at least 1 GB RAM, preferably 2 GB or more. Install Docker, then install Discourse by creating /var/discourse and cloning the official Docker repository…

discourse

Preface

Testing plugin changes directly in production can disrupt a community, so a local Discourse environment is useful for development and testing.

Environment

  • Operating system: Ubuntu 18.04.2 LTS x64
  • Memory: 1 GB minimum; 2 GB or more recommended
1.png

Install Docker

2.png
TEXT
wget -qO- https://get.docker.com/ | sh
3.png

Install Discourse

Create /var/discourse and clone the official Discourse Docker repository.

4.png

Run the following command:

TEXT
sudo -s
mkdir /var/discourse
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse

Run the installer:

5.png
TEXT
./discourse-setup

Answer the following questions interactively with temporary values; they will be edited together later:

6.png
7.png

Discourse does not support access by IP address, so app.yml must be changed explicitly. The email configuration also needs updating.

TEXT
sudo vim /var/discourse/containers/app.yml
8.png

Change it to:

9.png

For QQ Mail, enable SMTP in the account settings:

10.png
11.png
12.png

Now begin the long build process.

TEXT
./launcher rebuild app
13.png
14.png

After the build completes, enter the address in a browser:http://192.168.159.157/ Open it in a browser.

15.png

Registration does not actually work in this setup. Create an administrator directly from the console with:

TEXT
./launcher enter app
16.png

Then create an administrator account:

17.png

Return to the original page and sign in with the account information just created.

18.png
19.png