Setup self-hosted Redash in windows (Local Machine/AWS)

kishan D
3 min readJul 28, 2019

--

Looking for building a dashboard with historical analytics graphs without spending time on searching for a paid BI tool and time-series database migration, then your spaceship landed in a correct space

Let's discuss the few points that Redash can achieve for your project

  1. Provide Historical analytic data
  2. Integrated through Embed link / API
  3. Real-Time Alerts

As we said Historical analytics means we can connect our database to redash and can fetch historical data through queries like a count of a specific task performed in a particular time

Integration comes into a picture where most of the UI developers will be worrying about, but you don’t if your project is built with a redash tool.

It will be as easy as you can use an embed link directly or you can use your own graphs/charts in client-side and integrate the data from the redash API’s.

Coming to the knowledge as far as I was into redash, let me guide you guys to set up a redash local environment in your machine, where you can explore the redash as much as you can.

Setting up Redash in Windows System

Pre-requisites :

  1. Docker desktop with the default configuration using Linux containers
  2. Git

let's start with setting up the environment for redash

Redash requires PostgreSQL (as Database), Redis & NGINX(server)

let's create an empty folder and in that a file named docker-compose.yml in that.

we are creating this file docker-compose for letting docker understand how we are to want a redash container

version: ‘2’

x-redash-service: &redash-service

image: redash/redash:latest

depends_on:

- postgres

- redis

env_file: redash.env

restart: always

services:

server:

<<: *redash-service

command: server

ports:

- “5000:5000”

environment:

REDASH_WEB_WORKERS: 4

scheduler:

<<: *redash-service

command: scheduler

environment:

QUEUES: “celery”

WORKERS_COUNT: 1

scheduled_worker:

<<: *redash-service

command: worker

environment:

QUEUES: “scheduled_queries,schemas”

WORKERS_COUNT: 1

adhoc_worker:

<<: *redash-service

command: worker

environment:

QUEUES: “queries”

WORKERS_COUNT: 2

redis:

image: redis:latest

restart: always

postgres:

image: postgres:latest

env_file: redash.env

restart: always

nginx:

image: nginx:latest

ports:

- “80:80”

depends_on:

- server

links:

- server:redash

restart: always

If you are still confusing about this docker-compose.yml file, please go through this video https://www.youtube.com/watch?v=HUpIoF_conA

Create an env file with the name redash.env in the same folder

REDASH_HOST=http://localhost/redash
PYTHONUNBUFFERED=0
REDASH_LOG_LEVEL=INFO
REDASH_REDIS_URL=redis://redis:6379/0
POSTGRES_PASSWORD=
REDASH_COOKIE_SECRET=redash-selfhosted
REDASH_SECRET_KEY=redash-selfhosted
REDASH_DATABASE_URL=postgresql://postgres@postgres/postgres

As we will use PostgreSQL and Redis images from the docker-hub we can leave the POSTGRES_PASSWORD as blank and REDASH_DATABASE_URL as it is.

Open the command prompt and navigate to the created folder which contains docker-compose.yml and redash.env files

The below command will create a DB to store necessary information of Redash in PostgreSQL.

docker-compose run — rm server create_db

If there is any error then repeat the previous steps otherwise it should be ok

docker-compose up -d

Here “-d” means detach mode in docker

Use the browser and navigate to localhost:5000, there u should be able to see the below screen.

Start page of redash

Here redash asks to create an admin user to access the tool, even though we give our email in the setup, we should configure the mail setup for redash for this to work.

After this setup, you should be able to see the user dashboard where we can connect to our DB

Using the connect option will ask you for the below details

After this setup process, you will be able to create queries, add visualization, create dashboards with multiple visualizations, etc in your local machine.

--

--