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 e-mail een transactionele e-maildienst? Ik kon niets vinden dat erop wijst dat het transactioneel is na een oppervlakkige zoekopdracht, maar misschien wel?

Geweldig, we hadden wat documentatie nodig voor OVH, een van mijn favoriete providers. Ik vind het erg fijn dat je bij elke domeinnaam die je koopt een gratis e-mailadres krijgt (ik heb hun e-mailadres nog niet getest met een Discourse-setup, misschien doe ik dat later en rapporteer ik hier).

@murffy Trouwens, als je OVH VPS alleen Docker + Discourse erop heeft, zou je misschien een firewall-setup (iptables/ufw) in de documentatie kunnen opnemen, zodat het nog meer een plug-and-play documentatie is voor een 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.

Update From OVH = 200 mails per hours ; nice limit for a free mail though :slight_smile: and to avoid spam here is their suggestion :

  • Three or more words in capital letters in the subject line of your email. * No subject line or no text in the email. * The email contains only one large image (> 1MB) and a few words, or many images and little text. * Certain keywords in the subject line or at the beginning of the email: Hello, FREE, BUY, BUYING, etc. * The email contains more than 70% white space (excessive use of the SPACE or ENTER key on the keyboard). * The font used to write the email is too large. * The font color and background color are identical, making the text unreadable. * The link(s) in the email are incorrect. * The URLs are not secure (e.g., declared as https:// when the URL only exists as http://) or link to a hacked or malicious site. * The email contains pornographic or similar terms. * The email contains an executable file (EXE, BAT, PIF, XML, XLSX, or any document with a macro), even if zipped. * Your recipients are listed in BCC only or mainly, even though you are not using a system suitable for mailing lists.
1 like

Tip: 6K ~ 200 day