Skip to content

Instantly share code, notes, and snippets.

@xingh
Last active June 14, 2023 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xingh/38f903313215c2c7b111c334d1fbe065 to your computer and use it in GitHub Desktop.
Save xingh/38f903313215c2c7b111c334d1fbe065 to your computer and use it in GitHub Desktop.

Docker Compose for Redash (in Powershell)

  1. Make sure you have a docker machine up and running. to see if the docker machine is listed run docker-machine ls

  2. Make sure your current working directory is the root of this github repository.

  3. run git clone https://github.com/getredash/redash.git and then cd redash

  4. Run docker build .

  5. Run docker-compose up -d postgres to see if the docker container is up run docker ps

  6. Run These commands - will be moved to redash docker eventually but we can use it to point to a separate postgres here.

  • This will access the postgres container and set up the database.

    docker-compose run --rm -d redash /opt/redash/current/manage.py database create_tables

    docker-compose run --rm -d redash /opt/redash/current/manage.py users create --admin --password admin "Admin" "admin"

    (replace IP with your machine's IP)

    docker-compose run --rm -d postgres psql -h 192.168.99.100 -p 5432 -U postgres -c "CREATE ROLE redash_reader WITH PASSWORD 'redash_reader' NOCREATEROLE NOCREATEDB NOSUPERUSER LOGIN"

    docker-compose run --rm -d postgres psql -h 192.168.99.100 -p 5432 -U postgres -c "grant select(id,name,type) ON data_sources to redash_reader;"

    docker-compose run --rm -d postgres psql -h 192.168.99.100 -p 5432 -U postgres -c "grant select(id,name) ON users to redash_reader;"

    docker-compose run --rm -d postgres psql -h 192.168.99.100 -p 5432 -U postgres -c "grant select on events, queries, dashboards, widgets, visualizations, query_results to redash_reader;"

    docker-compose run --rm -d redash /opt/redash/current/manage.py ds new -n "re:dash metadata" -t "pg" -o "{'user': 'redash_reader', 'password': 'redash_reader', 'host': 'postgres', 'dbname': 'postgres'}"

  1. Run docker-compose up -d
  2. Run docker-machine ls, take note of the ip for the docker machine you are using, and open the web browser.
  3. Visit that docker machine ip at port 80, and you should see a redash login screen.
  4. Login as admin/admin, and you should be able to add data sources! Congrats!
@New-in-web
Copy link

New-in-web commented Jun 5, 2021

Hi i have this error when i run redash
[HPM] Error occurred while trying to proxy request /login?next=/ from localhost:8080 to http://localhost:5000/ (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
can you help me please

Try :

  • docker-compose build worker
  • docker-compose build server

@willywildan
Copy link

hi, i will run docker build .
error during connect: This error may indicate that the docker daemon is not running.: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&target=&ulimits=null&version=1": open //./pipe/docker_engine: The system cannot find the file specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment