본문 바로가기
시각화/시각화

[Redash] Ubuntu 에서 Redash 설치하기

by imkus 2025. 1. 16.

https://github.com/getredash/redash/wiki/Local-development-setup

 

Local development setup

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data. - getredash/redash

github.com

 

2026.03.28 추가

> 이 글은 Redash 소스코드를 직접 빌드하여 Ubuntu 환경에서 로컬/개발용으로 실행해보는 과정입니다.  
> 운영 환경에서 사용하려면 reverse proxy, HTTPS/TLS, 보안 설정 등은 별도로 구성해야 합니다.  
> 또한 Redash 저장소의 의존성 상태에 따라 `make compose_build` 단계에서 추가 조치가 필요할 수 있습니다.

 

 

## 테스트 환경
- OS: Ubuntu 22.04
- Docker / Docker Compose: 작성 당시 기준
- Node.js: 18.x
- Yarn: 1.22.x
- Redash: GitHub 저장소 기준 소스 직접 빌드
- 참고: Redash는 시점에 따라 의존성 구성이 바뀔 수 있어, 동일한 명령어를 실행해도 추후에는 빌드 오류가 발생할 수 있습니다.

요구 사항들

이 문서는 Ubuntu 22.04 데스크톱에서 작성되고 있으므로 지침서는 다른 배포판 등에 대해 약간의 조정이 필요할 수 있습니다.

Ubuntu 22.04는 Python 3.10을 사용하므로, 이것이 우리가 사용할 Python 버전입니다 (필요한 경우).

 

윈도우 WSL2

이 지침들은 Windows WSL2에서 아무런 변경 없이 작동하는 것으로 보고되었습니다.

 

 

필요한 패키지 설정

$ sudo apt -y install docker.io docker-buildx docker-compose-v2
## NOTE: You may need to remove the corresponding docker plugins first if the above command fails
$ sudo apt -y install build-essential curl docker-compose pwgen python3-venv xvfb

 

 

사용자를 'docker' 그룹에 추가하기

$ sudo usermod -aG docker $USER
$ newgrp docker
$ sudo systemctl restart docker
$ sudo chmod 666 /var/run/docker.sock

 

 

 

노드버전 관리자 설치

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
## You may need to save as a script file first, then change she-bang to point to correct shell

 

 

 

NodeJS 버전 18 설치

$ nvm install --lts 18
$ nvm alias default 18
$ nvm use 18

 

Node 버전 18 확인

$ nvm list

 

 

 

Yarn 1.x 설치

$ npm install -g yarn@1.22.22

 

 

Redash 소스 코드를 복제하고 NodeJS 종속성을 설치

$ git clone https://github.com/getredash/redash
$ cd redash
$ yarn

 

 

DB파일이 저장될 위치를 지정하기 위해 compose.yaml 파일 수정

위 그림처럼 compose.yaml 파일에서 postgres 설정 부분에 빨간 네모박스에 나온 것 처럼 volumes 값을 를 추가 해줍니다.

위에서 /media/uskim/8TB/data/postgresql/data 이부분은 로컬(컨테이너 밖)에 저장될 위치를 의미하고

/var/lib/postgresql/data는 postgres 컨테이너 내부에 저장될 위치를 의미합니다.

위 예시에 나온 로컬에 저장될 위치는 저의 환경에만 맞는 경로이므로 설치자 각 환경에 맞게 지정하셔야 합니다.

이부분을 설정하지 않으면 make down 후 다시 make up 할 때마다 redash에 작업했던 내용들이 초기화 됩니다.

컴파일 및 빌드

Redash는 GNU Make를 사용하여 작업을 실행합니다. 따라서 무언가에 대해 확신이 서지 않는다면 도움이 될 수 있는 Makefile을 살펴보는 것이 좋습니다. 😄

 

 

 

Redash 프론트 엔드 구축

$ make build

 

 

 

로컬 Redash Docker 이미지 빌드

$ make compose_build

 

도커 이미지가 잘 만들어졌는지 확인하는 것이 좋습니다. 우리는 도커에게 이 세 가지 새로운 이미지를 포함해야 하는 지역 "도커 이미지"를 보여달라고 요청함으로써 그렇게 합니다. "생성된" 시간이 매우 최근임을 보여주는 것이 중요합니다... 그렇지 않다면, 그것들은 다른 것에서 남겨진 오래된 이미지들입니다.

 

$ docker image list
REPOSITORY         TAG       IMAGE ID       CREATED         SIZE
redash_scheduler   latest    85bc2dc57801   2 minutes ago   1.38GB
redash_server      latest    85bc2dc57801   2 minutes ago   1.38GB
redash_worker      latest    85bc2dc57801   2 minutes ago   1.38GB

 

compose_build 실행 시 오류가 나는 경우 (2026.03.28 기준)

더보기

작성 시점 기준으로 `make compose_build` 실행 중 아래와 같은 오류가 발생할 수 있습니다.

- `poetry install` 단계에서 빌드 실패
- `impyla`, `cassandra-driver` 관련 에러 발생
- `pkg_resources` 관련 오류
- PEP 517 빌드 관련 오류

이 문제는 Docker 자체의 문제가 아니라, Redash가 설치하는 일부 optional 데이터소스 패키지가 현재 Python/Poetry 빌드 환경과 충돌하면서 발생하는 경우가 있습니다.

Redash Dockerfile은 기본적으로 다양한 데이터소스 드라이버까지 함께 설치하도록 되어 있는데, 이 과정에서 일부 패키지가 정상적으로 빌드되지 않아 `compose_build` 전체가 실패할 수 있습니다.

 

해결 방법
기본 기능 위주로 Redash를 먼저 실행해보려는 경우에는 `all_ds` 그룹을 제외하고 빌드하는 방법이 가장 간단합니다.
`compose.yaml`의 build args 부분에 아래 내용을 추가하거나 수정합니다.

build:
  context: .
  args:
    skip_frontend_build: "true"
    install_groups: "main,dev"

 

 

Dockerfile 도 아래와 같이 변경 필요합니다.

FROM node:18-bookworm AS frontend-builder

RUN npm install --global --force yarn@1.22.22

# Controls whether to build the frontend assets
ARG skip_frontend_build

ENV CYPRESS_INSTALL_BINARY=0
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1

RUN useradd -m -d /frontend redash
USER redash

WORKDIR /frontend
COPY --chown=redash package.json yarn.lock .yarnrc /frontend/
COPY --chown=redash viz-lib /frontend/viz-lib
COPY --chown=redash scripts /frontend/scripts

# Controls whether to instrument code for coverage information
ARG code_coverage
ENV BABEL_ENV=${code_coverage:+test}

# Avoid issues caused by lags in disk and network I/O speeds when working on top of QEMU emulation for multi-platform image building.
RUN yarn config set network-timeout 300000

RUN if [ "x$skip_frontend_build" = "x" ] ; then yarn --frozen-lockfile --network-concurrency 1; fi

COPY --chown=redash client /frontend/client
COPY --chown=redash webpack.config.js /frontend/
RUN <<EOF
  if [ "x$skip_frontend_build" = "x" ]; then
    yarn build
  else
    mkdir -p /frontend/client/dist
    touch /frontend/client/dist/multi_org.html
    touch /frontend/client/dist/index.html
  fi
EOF

FROM python:3.10-slim-bookworm

EXPOSE 5000

RUN useradd --create-home redash

# Ubuntu packages
RUN apt-get update && \
  apt-get install -y --no-install-recommends \
  pkg-config \
  curl \
  gnupg \
  build-essential \
  pwgen \
  libffi-dev \
  sudo \
  git-core \
  # Kerberos, needed for MS SQL Python driver to compile on arm64
  libkrb5-dev \
  # Postgres client
  libpq-dev \
  # ODBC support:
  g++ unixodbc-dev \
  # for SAML
  xmlsec1 \
  # Additional packages required for data sources:
  libssl-dev \
  default-libmysqlclient-dev \
  freetds-dev \
  libsasl2-dev \
  unzip \
  libsasl2-modules-gssapi-mit && \
  apt-get clean && \
  rm -rf /var/lib/apt/lists/*

ARG TARGETPLATFORM
ARG databricks_odbc_driver_url=https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/odbc/2.6.26/SimbaSparkODBC-2.6.26.1045-Debian-64bit.zip
RUN <<EOF
  if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
    curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
    curl https://packages.microsoft.com/config/debian/12/prod.list > /etc/apt/sources.list.d/mssql-release.list
    apt-get update
    ACCEPT_EULA=Y apt-get install  -y --no-install-recommends msodbcsql18
    apt-get clean
    rm -rf /var/lib/apt/lists/*
    curl "$databricks_odbc_driver_url" --location --output /tmp/simba_odbc.zip
    chmod 600 /tmp/simba_odbc.zip
    unzip /tmp/simba_odbc.zip -d /tmp/simba
    dpkg -i /tmp/simba/*.deb
    printf "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini
    rm /tmp/simba_odbc.zip
    rm -rf /tmp/simba
  fi
EOF

WORKDIR /app

ENV POETRY_VERSION=1.8.3
ENV POETRY_HOME=/etc/poetry
ENV POETRY_VIRTUALENVS_CREATE=false
RUN curl -sSL https://install.python-poetry.org | python3 -

# Avoid crashes, including corrupted cache artifacts, when building multi-platform images with GitHub Actions.
RUN /etc/poetry/bin/poetry cache clear pypi --all

COPY pyproject.toml poetry.lock ./

ARG POETRY_OPTIONS="--no-root --no-interaction --no-ansi"

# for LDAP authentication, install with `ldap3` group
# disabled by default due to GPL license conflict

# MODIFIED: all_ds 를 제거하고 main,dev 만 사용
# 이유: all_ds 전체 설치 시 불필요한 datasource 의존성까지 함께 설치되어 빌드 실패 가능성이 있음
ARG install_groups="main,dev"

# MODIFIED: poetry install 후 mysqlclient 를 별도 설치
# 이유: Redash UI에서 MySQL datasource를 보이게 하려면 MySQLdb(mysqlclient)가 필요함
RUN /etc/poetry/bin/poetry install --only $install_groups $POETRY_OPTIONS && \
    python -m pip install --no-cache-dir mysqlclient==2.1.1

COPY --chown=redash . /app
COPY --from=frontend-builder --chown=redash /frontend/client/dist /app/client/dist
RUN chown redash /app
USER redash

ENTRYPOINT ["/app/bin/docker-entrypoint"]
CMD ["server"]

 

 

더보기

이렇게 하면 문제가 되는 일부 optional 데이터소스 드라이버 설치를 건너뛰고, Redash의 기본 실행에 필요한 패키지 위주로 빌드할 수 있습니다.

다만 이 경우 일부 외부 데이터소스 연결 기능은 제외될 수 있으므로, 추후 실제 사용 목적에 맞게 필요한 드라이버를 개별적으로 검토하는 것이 좋습니다.

 

수정 후 실행 순서
`compose.yaml` , 'Dockerfile' 수정 후에는 아래 순서로 다시 진행합니다.

docker compose down
docker compose build --no-cache server worker scheduler
docker compose up -d
docker compose exec server bash -lc 'python -c "import MySQLdb; print(\"OK\")"'

방금 만든 도커 이미지를 사용하여 로컬로 Redash 시작

$ make create_database
$ make up

 

확인

$ docker compose ps
       Name                     Command                  State                                  Ports                            
---------------------------------------------------------------------------------------------------------------------------------
redash_email_1       bin/maildev                      Up (healthy)   1025/tcp, 1080/tcp, 0.0.0.0:1080->80/tcp,:::1080->80/tcp    
redash_postgres_1    docker-entrypoint.sh postg ...   Up             0.0.0.0:15432->5432/tcp,:::15432->5432/tcp                  
redash_redis_1       docker-entrypoint.sh redis ...   Up             6379/tcp                                                    
redash_scheduler_1   /app/bin/docker-entrypoint ...   Up             5000/tcp                                                    
redash_server_1      /app/bin/docker-entrypoint ...   Up             0.0.0.0:5001->5000/tcp,:::5001->5000/tcp,                   
                                                                     0.0.0.0:5678->5678/tcp,:::5678->5678/tcp                    
redash_worker_1      /app/bin/docker-entrypoint ...   Up             5000/tcp

 

 

Redash 웹 인터페이스는 http://localhost:5001에서도 사용할 수 있습니다.

(port를 변경하려면 compose.yml 파일에서 port 포워딩 부분 수정 필요함)

 

 

 

모든 것이 원하는 방식으로 작동하는지 확인한 후에는 다음과 같은 방법으로 컨테이너를 종료합니다:

$ make down