Hosting your own instance

Up and running in under a minute

Prerequisites

We highly recommend using Docker to host the application. It's the easiest and fastest way to get started and stay up to date with any future release.

You'll also need:

  • PostgreSQL 9.6 Database

    This tutorial uses a Docker PostgreSQL image for the sake of simplicity, but we highly recommend you to use a database outside Docker.

  • E-mail sender service:

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

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 variable with your connection string.

Step 2: Pull the images and run it

Open your favorite terminal, navigate to the folder in which you create file above 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