Set up visual data analysis platform redash in 1 hour

Set up visual data analysis platform redash in 1 hour

There are many BI choices, such as Tableau, PowerBI, Superset, Metabase, and redash introduced today. Tableaus are expensive and drag-and-drop. For a data analyst, there is a lot of SQL to write, so consider superset vs. Metabase vs.Reash, superset has been built and used before. Airbnb is beautiful, but it doesn't seem to be very useful, Metabase hasn't been used, PowerBI has known before that it hasn't been studied in depth. The previous company used redash and had a good experience. There are also some limitations in the work, so consider building a simple data analysis locally.Platform to do some simple analysis and monitoring reports, the solution is: Windows 10+Docker+Redash+Python. Python automatically crawls data every day to insert postgresql database, redash writes SQL code to generate reports.

I think this solution would be better than installing a mysql database locally or using Tableau/PowerBI to click a little bit and a half a day there.

Installation steps

# Install docker first
 Download one online Docker for windows perhaps for mac,The latest version is still good, but previous versions were hard to use.
Configure Domestic Mirror: Baidu Search comes soon
  "debug": true,
  "registry-mirrors": [
  "experimental": true

# Download the source from GitHub [you can open GitHub without git and click download and unzip]
git clone

# Open cmd/Termina to redash directory
cd redash

# Create a docker-compose.production.yml file that references the YML configuration.
# The git download above also contains a docker-compose.yml file, which is for development purposes and needs to be replaced.
# You can create a new one without touch ing.
touch docker-compose.production.yml

#Create db, install without error
docker-compose -f docker-compose.production.yml run --rm server create_db

#redash runs and there's something installed there as well
docker-compose -f docker-compose.production.yml up

#redash runs in the background
docker-compose -f docker-compose.production.yml up -d

Contents of docker-compose.production.yml file

This configuration REDASH_ADDITIONAL_QUERY_RUNNERS:'redash.query_runner.python'can be used to run Python, but it is python2 and I don't know how to change it to python3. I don't know what to configure these parameters like, just run. It is recommended that the image version not be the latest, download is slow and installation is unsuccessful...

# This is an example configuration for Docker Compose. Make sure to atleast update
# the cookie secret & postgres database password.
# Some other recommendations:
# 1. To persist Postgres data, assign it a volume host location.
# 2. Split the worker service to adhoc workers and scheduled queries workers.
version: '2'
    image: redash/redash:8.0.2.b37747
    command: server
      - postgres
      - redis
      - "5000:5000"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      REDASH_COOKIE_SECRET: "suibianxieyige"
      REDASH_MAIL_USE_TLS: "true"
      REDASH_MAIL_USE_SSL: "true"
      REDASH_HOST: ""
      REDASH_ADDITIONAL_QUERY_RUNNERS: "redash.query_runner.python"
    restart: always
    image: redash/redash:8.0.2.b37747
    command: scheduler
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
      REDASH_ADDITIONAL_QUERY_RUNNERS: "redash.query_runner.python"
      QUEUES: "queries,scheduled_queries,celery"
    restart: always
    image: redis:3.0-alpine
     - "6379:6379"
      - ./data/redis_data:/data
    restart: always
    image: postgres:9.5.6-alpine
     - "5432:5432"
      - ./data/postgresql_data:/var/lib/postgresql/data
    restart: always
    image: redash/nginx:latest
      - "80:80"
      - ./data/nginx:/etc/nginx
    #  - server
      - server:redash
    restart: always

If the installation is OK, open the browser and enter can access it as follows

There is no data source just in, so you need to add one. There are many kinds of data sources that can be added. We add a default database, postgresql, database name and host whatever, in the yaml profile postgresql://postgres@postgres/postgres.

Create a new query, write a sql, and run an analysis platform locally

Dashboard [Fake Data]

Graphs are plotly based, and this library has a python version and is very powerful for drawing.

The query for each chart can set the update time, so this is great. For example, if you want to see the report every morning, you can set the update time at 8 a.m. and turn on the computer at 9 a.m. That's where the data comes from.

Conditionally, you can connect directly to large data platforms or mysql databases or whatever. You can also write your own python code to automatically update your data every day.

It's also nice to think that you can grab house price data and stock market data every day and visualize it yourself. I think this redash is more convenient than Tableau.

So much for now, follow-up:

(1) If you want to change the source code, then you can read the local csv file directly to the database, and you want God to guide you;

(2) You can run python 3 directly instead, run machine learning models, visualize python results directly, etc.

(3) Link neo4j to show social network maps, do fraud analysis, etc.

(4) Explore new usages...


Reference link: [Thank you guys for the tutorial]

Installation Tutorial:

No results were queried:
dockerhub redash:

Docker Hub
Selection and Practice Series of Redash as a Data Visualization Scheme

Team Report System Customization - Redash-based Secondary Development

There's a lot of stuff on medium and github that you can check out.

redash research

Tags: Python Database PostgreSQL

Posted on Mon, 27 Sep 2021 12:26:03 -0400 by Darkness Soul