Hoe installeer je Discourse op een OVH VPS

Hello everyone,

After struggling for a while to set up my VPS with Discourse, I decided to share a simple step-by-step guide to help you install Discourse on an OVH VPS.

In my case, I’m using:

  • An OVH VPS

  • A domain name

  • A professional email (OVH Email Pro)

:warning: Note: I’m not a server configuration expert. If you notice any mistakes or improvements, feel free to let me know.


Step 0 – Prerequisites

You’ll need the following products from OVH:

  • VPS (with the following options when purchasing):

    • Choose a datacenter located in the country of your target audience (recommended).

    • Operating System: Debian 12

  • Domain name

  • Email (OVH Email Pro)

Note : Read the two important OVH emails you’ll receive

Additional tools & accounts:

  • (Optional) MaxMind – for extra security:

    • Create an account: MaxMind Signup

    • Go to Manage License Keys > Generate new license key (save both the ID and the key, as key won’t be shown again).

  • PuTTY (SSH client used in this guide): Download PuTTY


Step 1 – Configure your OVH services

  1. Domain → VPS

    • Go to: Web Cloud > Domain Names > yourdomain.com > DNS Zone

    • For each type A record, replace the target with your VPS IPv4 address.

  2. Domain → Email Pro

    • Go to: Web Cloud > Email Pro > Associated Domains

    • Add your purchased domain.

  3. Create an Email


Step 2 – VPS Setup

  1. Connect via SSH

    • Open PuTTY

    • Hostname: your VPS IPv4

    • Port: 22

    • In console : Log in with the username and password sent by email.

  2. Secure your server

    • Change your password.

    • Change SSH port (Recommended):
      sudo vi /etc/ssh/sshd_config

    • Find the line with “Port” (use arrow keys).

    • Remove the # and replace the port number (i to insert) with one between 49152 and 65535.

      Save and exit (Esc > :wq)

  3. Install dependencies (Debian)
    sudo apt install docker.io -y
    sudo apt install git -y

  4. Install Discourse
    sudo -s
    git clone https://github.com/discourse/discourse_docker.git /var/discourse
    cd /var/discourse
    chmod 700 containers

  5. Run the setup script
    sudo ./discourse-setup

    Fill in the prompts :

    1. Hostname: your domain (e.g. yourdomain.com)
    2. Admin Email: your personal email
    3. SMTP server address: found in OVH client area → Email Pro (e.g. proX.mail.ovh.net)
    4. SMTP Port: 587
    5. SMTP Username: the email you created earlier (e.g. contact@yourdomain.com)
    6. SMTP Password: password of that email account
    7. Notification Email: same as SMTP Username
    8. Let’s Encrypt Email: your personal email (recommended)
    9. MaxMind Account ID: from your MaxMind account
    10. MaxMind Key: license key you generated
  6. Fine-tune the SMTP settings
    sudo nano containers/app.yml

    Scroll to the SMTP section.

    1. Edit as follows:
      • SMTP domain: same as your SMTP hostname

      • SMTP authentication: replace “plain” with “login”

      • Enable STARTTLS: remove the # before the line

        Save & exit (Ctrl + O, Enter, Ctrl + X).

  7. Rebuild the app
    sudo ./launcher rebuild app


Step 3 – Final Test

Check if email sending works:

sudo ./discourse-doctor

  • Enter a test email address to receive a test message.

If everything works, you can now finish setting up Discourse directly from your website at https://yourdomain.com

Murffy

4 likes

Is OVH’s email a transactional email service? I couldn’t find anything related to it being transactional from a cursory search, but maybe not?

Awesome we needed some documentation for OVH which is one of my favorite providers. I really like the fact that with any domain name you purchase you receive a free email adress with it(I haven’t tested their email adress with a discourse setup, maybe I will later and report here).

@murffy By the way if your OVH VPS has only docker + discourse on it, you could maybe include a firewall setup(iptables/ufw) in the documentation so that it’s even more a plug and play documentation for an amateur?

I advise not doing this.
This is not a transactional email service, and you’ll likely face automatic blocking from OVH for suspected spam.
I’ve used a free OVH email for Discourse for a while, and it was a bad idea. I suggest you look for a proper email sending service instead. :slightly_smiling_face:

1 like

Thanks for the tip, I contacted OVH about this, we’ll see what they say. 200-500 mails per week with DKIM/SPF + official headers and an unsubscribe buttons is not asking them too much though to have it not considered at spam.

1 like

Tip: 6K ~ 200 day