Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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!
@amitwats

This comment has been minimized.

Copy link

@amitwats amitwats commented Feb 15, 2019

I have an error thrown :npm ERR! code ELIFECYCLE in step docker build . any idea what could be the cause?

@MakremHammali

This comment has been minimized.

Copy link

@MakremHammali MakremHammali commented Mar 7, 2019

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

@New-in-web

This comment has been minimized.

Copy link

@New-in-web 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment