Hosting your own instance

Up and running in under a minute

Prerequisites

  • Docker

    As we don't distribute Linux or Windows specific binaries, Docker is a must to host Fider. It provides a consistent runtime environment and is widely adopted. You can run it standalone or in your favorite container-orchestration system, whatever floats your boat.

  • PostgreSQL 9.6+ Database

    This tutorial uses a Docker PostgreSQL image for the sake of simplicity, but we strongly recommend the usage of a database outside Docker, unless you're very confident on how to host a Database inside Docker.

  • E-mail sender service:

    You can choose to use either a SMTP Server or Mailgun.

Installing and Running

Step 1: Create a docker compose file

Create a /var/fider folder and copy content below into a file /var/fider/docker-compose.yml. Read the inline comments to know what each setting is used for.

version: '2'
services:
  db:
    restart: always
    image: postgres:9.6
    volumes:
      - /var/fider/pg_data:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: fider
      POSTGRES_PASSWORD: s0m3g00dp4ssw0rd

  app:
    restart: always
    image: getfider/fider:stable
    ports:
      - "9999:3000"
    environment:
      ###
      # REQUIRED
      #
      # All these settings are required
      ###

      # Use production for best performance
      # Use development for verbose logs
      GO_ENV: production
      
      # Connection string to the PostgreSQL database. 
      # This example uses the Docker service defined above
      DATABASE_URL: postgres://fider:s0m3g00dp4ssw0rd@db:5432/fider?sslmode=disable
      
      # CHANGE THIS! You can generate a strong secret at https://randomkeygen.com/
      JWT_SECRET: tXQhvSMWMS11qZ9euEhE6lf2ferf0FR6RYGd8iMXiTxxXtJ1XDVdTXPaLtV12ZGp

      # From which account e-mails will be sent (required)
      EMAIL_NOREPLY: noreply@yourdomain.com

      ###
      # EMAIL
      #
      # Either EMAIL_MAILGUN_* or EMAIL_SMTP_* is required
      ###

      # EMAIL_MAILGUN_API: key-yourkeygoeshere
      # EMAIL_MAILGUN_DOMAIN: yourdomain.com

      # EMAIL_SMTP_HOST: smtp.yourdomain.com
      # EMAIL_SMTP_PORT: 587
      # EMAIL_SMTP_USERNAME: user@yourdomain.com
      # EMAIL_SMTP_PASSWORD: s0m3p4ssw0rd
      
      ###
      # OPTIONAL
      #
      # Following settings are optional
      ###

      # Social OAuth: 
      # Read more on https://getfider.com/docs/configuring-oauth/

      # Facebook
      # OAUTH_FACEBOOK_APPID: <fb_app_id>
      # OAUTH_FACEBOOK_SECRET: <fb_app_secret>

      # Google
      # OAUTH_GOOGLE_CLIENTID: <google_app_id>
      # OAUTH_GOOGLE_SECRET: <google_app_secret>

      # GitHub
      # OAUTH_GITHUB_CLIENTID: <github_client_id>
      # OAUTH_GITHUB_SECRET: <github_secret>

    depends_on:
      - db

The Docker Compose above defines two services: db and app. In case you're using an external Postgres database, remove db service and replace DATABASE_URL environment variable with your connection string.

Step 2: Pull the images and run it

Open your favorite terminal, navigate to /var/fider and run following command.

$ docker-compose pull
$ docker-compose up

Important! If you see messages like Error: dial tcp <any_ip>:5432: connect: connection refused. Don't panic, that's expected when using a docker PostgreSQL. That might happen because the application is trying to start while the database is still initializing.

The message http server started on :3000 means everything went well and you're ready to go.

Just open your favorite browser and navigate to http://localhost:9999. You should see a page like the following.

Installation page of a clean Fider instance

Going forward

You now have a brand new Fider instance running, that's great! For a production environment we have a few recommendations.

  • Reverse Proxy

    While you can expose Fider directly to the internet, we recommend the usage of a reverse proxy that supports TLS/SSL termination and load balancing, like Varnish, NGINX, Apache or Traefik.

  • TLS/SSL

    If you choose to expose Fider to the internet, enable SSL. Take a look at How to enable TLS/SSL.

  • Container Orchestration

    Although not required, we encourage the usage of a Container Orchestration like Kubernetes or Docker Swarm. If you choose to not use one, we recommend the usage of systemd to manage your Container, read more on Using systemd to control the Docker daemon.

F.A.Q.

I have filled in the installation form but I haven’t got any confirmation email.

First of all, check your Spam folder, it shouldn’t be there, but just be sure about that first. If not, it’s highly likely that you either input the wrong email or your email configurations are invalid. When this happens, you’ll notice that you can’t fill in that form again as you’ll be presented with a 404 page. This page will only go away when you click the confirmation link that Fider sends.

To solve this you’ll need to log into your Postgres Database and run TRUNCATE TABLE tenants RESTART IDENTITY CASCADE;. This command will purge all the data from Fider, thus making the installation page available again. You may now change your email configurations and try again. You can repeat this as much as you need.