Install Reacher on OVH

Install Reacher on OVH

Last updated: August 20th 2022.

 
This guide goes through installing Reacher on an OVH dedicated server.

Requirements

Create an account on https://www.ovhcloud.com.
Buy a dedicated server.
  • I do not recommend using a VPS, as you will be sharing the same IP address with other customers, which can make email verification results unreliable.
  • Computation power is often not the bottleneck, so you can get the cheap dedicated Eco servers.
Make sure you have the correct license to self host, see 🏠Self-Host Guide.
(Only if you want to enable 💪Bulk Email Verification ) Have access to a PostgreSQL database. Heroku offers some for free.

🤓 Step by Step Guide

  1. Set up your dedicated server by following the official OVH documentation. I recommend “Debian 11” as the Linux distribution, but it should work with “Debian 10” too.
  1. Log into your server.
    1. ssh debian@<ip_address_of_your_server>
  1. Create the file ovh_postinstall.sh and paste the following content into it. You can use vim or nano to do this. Configure the variables on the top of the file accordingly.
    1. #!/bin/bash
      
      # Postinstall script of Reacher Backend on an OVH debian 11 server.
      # As a postinstall, this script is meant to be run once, but for convenience,
      # it's actually idempotent.
      
      # Fail early.
      set -e
      
      # TODO: Configure these variables.
      # Required variables:
      RCH_ENABLE_BULK=0                    # Enable bulk email verification, disabled by default
      RCH_VERSION=v0.4.0-beta19            # Docker version of reacherhq/backend
      DATABASE_URL="<your_db_url>"         # URL of a Postgres database, required only if RCH_ENABLE_BULK == 1
      # Optional variables
      # RCH_SENTRY_DSN="<your_sentry_dsn>" # Send bug reports to a Sentry.io dashboard.
      
      echo "Installing Reacher backend $RCH_VERSION on host $HOSTNAME..."
      
      # Install Docker
      # https://docs.docker.com/engine/install/debian/
      sudo apt-get update
      sudo apt-get upgrade --yes
      sudo apt-get install \
          ca-certificates \
          curl \
          gnupg \
          lsb-release
      sudo mkdir -p /etc/apt/keyrings
      curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg --yes
      echo \
          "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
          $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
      sudo apt-get update
      sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin --yes
      
      # Create `docker` group
      # https://docs.docker.com/engine/install/linux-postinstall/
      getent group docker || sudo groupadd docker
      sudo usermod -aG docker debian
      # Reload users and groups, see
      # https://superuser.com/questions/272061/reload-a-linux-users-group-assignments-without-logging-out
      su - $USER
      
      # Run the backend
      docker run -d \
          -e RCH_ENABLE_BULK=$RCH_ENABLE_BULK\
          -e DATABASE_URL=$DATABASE_URL \
          -e RCH_BACKEND_NAME=$HOSTNAME \
          -e RCH_SENTRY_DSN=$RCH_SENTRY_DSN \
          -p 80:8080 \
          reacherhq/backend:$RCH_VERSION
      
      echo "Everything set. You can close this terminal."
  1. Run the script above.
    1. # Make the script executable.
      chmod a+x ovh_postinstall.sh
      # Run it.
      ./ovh_postinstall
  1. Wait a couple of minutes until the script finishes. It should end with:
    1. --snip--
      <long_hexadecimal_string>
      Everything set. You can close this terminal.
      The long hexadecimal string represents the Docker container ID, should you wish to start/stop it or monitor its logs.
  1. In a new terminal, test the server by sending an email verification request.
    1. curl -X POST \
      	-H'Content-Type: application/json' \
      	-d'{"to_email":"amaury@reacher.email"}' \
      	http://<ip_address_of_your_server>/v0/check_email
      It should return a JSON with is_reachable=safe!

Next Steps

Your server is now correctly set up.
  • Instead of single email verifications as in step 6, try 💪Bulk Email Verification after setting the RCH_ENABLE_BULK environment variable to 1.

🤔 Something went wrong?

Please email ✉️ amaury@reacher.email with some logs about your error. I run part of Reacher’s infrastructure on OVH, so I can help here.