Install Discourse on Plesk(Ubuntu 18.04 LTS)

Hello Guys,

i have followed the Install Tutorial for Plesk Onyx (Ubuntu 14.04), but i had many problems.

Now i have everything working on my Plesk and i decided to make a new Tutorial(Mail with the Plesk Mail Server)

1. Set options in Plesk

2. Install Docker

  • Go to Extensions.
    docker_1

  • Search for Docker and install the extension. Now you have Docker as menu point in the side menu.
    docker_2

3. Install Discourse

Now you need an ssh access to your server who is Plesk hosted.
My example data:
Domain: forum.domain.tld
E-Mail: mail@domain.tld
E-Mail: password123

  • Download the git.

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

  • Now we must edit the setup script.

    nano discourse-setup

  • Scroll down to this:
    setup_before

  • And change it to this:

  • Exit with STRG+X and type Y then press enter to save the file.

  • Launch the setup.

    ./discourse-setup

  • Now answer some questions.

    Hostname for your Discourse? [discourse.example.com]: forum.domain.tld
    Email address for admin account(s)? [me@example.com,you@example.com]: mail@domain.tld
    SMTP server address? [smtp.example.com]: Plesk (Yeah write Plesk in the line)
    SMTP port? [587]: 25 (The Port from the Mailserver in Plesk is 25)
    SMTP user name? [user@example.com]: mail@domain.tld
    SMTP password? [pa$$word]: password123
    Let's Encrypt account email? (ENTER to skip) [me@example.com]: (to skip this press enter)

  • It takes a while, wait until you get back to the command line. The Docker container fails to start. It doesn’t matter. Now we change the app.yml to work with Plesk.

    nano containers/app.yml

  • Change the Ports and comment two lines. Before:

  • After:

  • Exit with STRG+X and type Y then press enter to save the file.

  • It’s time to rebuild the container.

    ./launcher rebuild app

  1. Change the hosts File in the docker emulation.
  • Now we change the hosts file, so discourse can use the Plesk Mail Server. Enter the Docker container.

    ./launcher enter app

  • Wait until the command line comes back. Now we install nano.

    apt-get install nano

  • Let us change the hosts file.

    nano /etc/hosts

  • add the last line:
    hosts
  • Exit with STRG+X and type Y then press enter to save the file
  • Exit the container

    exit

  1. Change the Plesk Proxy settings

I hope i can help somebody.

Greetings from germany

PS: Thanks to Google Translator :smiley:

4 Likes

@Vault1337 Ich bekomme es nicht zum laufen wäre super wenn du mir helfen konntest danke.

Hi!

Still getting:
“WARNING:: This server does not appear to be accessible at discourse.domain.com:443

Even if I changed checked ports in discourse-setup, and opened 8060 and 9443 in the firewall.

The subdomain discourse.agoraludica.eu is accessible from the internet.

Is there something like an IP to whitelist?

I have Discourse on Plesk since 2017. I didn’t have to edit /etc/hosts but a friend made me add this in Apache & nginx Settings → Additional nginx directives :

location =/ {
	proxy_pass http://0.0.0.0:8060;
	proxy_set_header Host             $host;
	proxy_set_header X-Real-IP        $remote_addr;
	proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
	proxy_set_header X-Forwarded-Proto https;
}

Any idea why?

Also, my installation works perfectly, the only downside is that I have to temporarily disable the port redirection in Plesk when I need to renew the certificate.

1 Like

You’ll need to edit app.yml yourself and

./launcher rebuild app

Discourse-setup works only for a standard installation.

Those lines tell discourse to ignore your proxy servers address and report the address of the actual computer making the request.

The let’s encrypt issue, is because you need not to pass that request to discourse but to the let’s encrypt client that the reverse proxy is running. You could probably add some stuff to tell it to handle that /well-known request itself. Perhaps you’re friends W can help figure that out

1 Like

Hi,

Solved this issue restarting the docker service on host, to force a rebuilding of the nerwork bridge.

1 Like